<%= bootstrap_form_for current_exhibit, url: spotlight.exhibit_translations_path(current_exhibit), layout: :horizontal do |f| %> <% # Add a hidden field for the language so the redirect knows how to come back here %> <%= hidden_field_tag :language, @language %>

<%= t('spotlight.exhibits.translations.general.basic_settings.label') %>

<% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "#{current_exhibit.slug}.title", locale: @language) %> <%= f.fields_for :translations, translation do |translation_fields| %> <%= translation_fields.hidden_field :key %> <%= translation_fields.hidden_field :locale %>
<%= translation_fields.label :value, t('spotlight.exhibits.translations.general.basic_settings.title'), class: 'col-form-label col-12 col-sm-2' %>
<%= translation_fields.text_field_without_bootstrap :value, class: 'form-control' %> <%= current_exhibit[:title] %>
<% if translation.value.present? %> <%= blacklight_icon('check', classes: 'translation-complete') %> <% end %>
<% end %> <% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "#{current_exhibit.slug}.subtitle", locale: @language) %> <%= f.fields_for :translations, translation do |translation_fields| %> <%= translation_fields.hidden_field :key %> <%= translation_fields.hidden_field :locale %>
<%= translation_fields.label :value, t('spotlight.exhibits.translations.general.basic_settings.subtitle'), class: 'col-form-label col-12 col-sm-2' %>
<%= translation_fields.text_field_without_bootstrap :value, class: 'form-control' %> <%= current_exhibit[:subtitle] %>
<% if translation.value.present? %> <%= blacklight_icon('check', classes: 'translation-complete') %> <% end %>
<% end %> <% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "#{current_exhibit.slug}.description", locale: @language) %> <%= f.fields_for :translations, translation do |translation_fields| %> <%= translation_fields.hidden_field :key %> <%= translation_fields.hidden_field :locale %>
<%= translation_fields.label :value, t('spotlight.exhibits.translations.general.basic_settings.description'), class: 'col-form-label col-12 col-sm-2' %>
<%= translation_fields.text_area_without_bootstrap :value, class: 'form-control' %> <%= current_exhibit.description %>
<% if translation.value.present? %> <%= blacklight_icon('check', classes: 'translation-complete') %> <% end %>
<% end %>

<%= t('spotlight.exhibits.translations.general.main_menu.label') %>

<% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "spotlight.curation.nav.home", locale: @language) %> <%= f.fields_for :translations, translation do |translation_fields| %> <%= translation_fields.hidden_field :key %> <%= translation_fields.hidden_field :locale %>
<%= translation_fields.label :value, t('spotlight.exhibits.translations.general.main_menu.home'), class: 'col-form-label col-12 col-sm-2' %>
<%= translation_fields.text_field_without_bootstrap :value, class: 'form-control' %> <%= t(:'spotlight.curation.nav.home', locale: I18n.default_locale) %>
<% if translation.value.present? %> <%= blacklight_icon('check', classes: 'translation-complete') %> <% end %>
<% end %> <% current_exhibit.main_navigations.each do |navigation| %> <% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "main_navigation.#{navigation.nav_type}.label", locale: @language) %> <%= f.fields_for :translations, translation do |translation_fields| %> <%= translation_fields.hidden_field :key %> <%= translation_fields.hidden_field :locale %> <% end %> <% end %> <% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: 'spotlight.catalog.breadcrumb.index', locale: @language) %> <%= f.fields_for :translations, translation do |translation_fields| %> <%= translation_fields.hidden_field :key %> <%= translation_fields.hidden_field :locale %>
<%= translation_fields.label :value, t('spotlight.catalog.breadcrumb.index'), class: 'col-form-label col-12 col-sm-2' %>
<%= translation_fields.text_field_without_bootstrap :value, class: 'form-control' %> <%= t(:'spotlight.catalog.breadcrumb.index', locale: I18n.default_locale) %>
<% if translation.value.present? %> <%= blacklight_icon('check', classes: 'translation-complete') %> <% end %>
<% end %>
<%= f.submit nil, class: 'btn btn-primary' %>
<% end %>