2023-04-05 22:30:59 +00:00
|
|
|
- if site.locales.count > 1
|
|
|
|
%fieldset
|
|
|
|
%legend= post_label_t(attribute, post: post)
|
2020-05-23 16:52:58 +00:00
|
|
|
|
2023-04-05 22:30:59 +00:00
|
|
|
= render 'posts/attribute_feedback',
|
|
|
|
post: post, attribute: attribute, metadata: metadata
|
2020-05-23 16:52:58 +00:00
|
|
|
|
2023-04-05 22:30:59 +00:00
|
|
|
- site.locales.each do |locale|
|
|
|
|
- next if post.lang.value == locale
|
|
|
|
- locale_t = t("locales.#{locale}.name", default: locale.to_s.humanize)
|
|
|
|
- value = metadata.value.find do |v|
|
|
|
|
- metadata.values[locale].values.include? v
|
2020-05-23 16:52:58 +00:00
|
|
|
|
2023-04-05 22:30:59 +00:00
|
|
|
.form-group
|
|
|
|
= label_tag "#{base}_#{attribute}_#{locale}", locale_t
|
2020-05-23 16:52:58 +00:00
|
|
|
|
2023-04-05 22:30:59 +00:00
|
|
|
= select_tag("#{plain_field_name_for(base, attribute)}[]",
|
|
|
|
options_for_select(metadata.values[locale], value),
|
|
|
|
**field_options(attribute, metadata), include_blank: t('.empty'))
|