A lot :)
This commit is contained in:
parent
aad67af0d1
commit
63fc206c27
153 changed files with 2043 additions and 646 deletions
|
|
@ -4,4 +4,16 @@ module ApplicationHelper
|
|||
include Pagy::Frontend
|
||||
|
||||
delegate :filter_params, to: :controller
|
||||
|
||||
def multilang_form_field(form, attribute, as: :text_field)
|
||||
col_width = as == :rich_text_area ? 12 : 12 / I18n.available_locales.count
|
||||
tag.div(class: "row") do
|
||||
fields = I18n.available_locales.map { _1.to_s.split("-").first }.map do |lang|
|
||||
tag.div(class: "col-lg-#{col_width}") do
|
||||
form.send(as, "#{attribute}_#{lang}")
|
||||
end
|
||||
end
|
||||
safe_join(fields)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue