5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-29 23:46:22 +00:00
panel/app/views/posts/attributes/_locales.haml

20 lines
730 B
Text
Raw Normal View History

- if site.locales.count > 1
%fieldset
%legend= post_label_t(attribute, post: post)
2020-05-23 16:52:58 +00:00
= render 'posts/attribute_feedback',
post: post, attribute: attribute, metadata: metadata
2020-05-23 16:52:58 +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
.form-group
= label_tag "#{base}_#{attribute}_#{locale}", locale_t
2020-05-23 16:52:58 +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'))