<%= t(:'.main_navigation.help') %>
- - <% end %> -diff --git a/app/components/spotlight/tab_component.html.erb b/app/components/spotlight/tab_component.html.erb new file mode 100644 index 0000000000..2d441fd953 --- /dev/null +++ b/app/components/spotlight/tab_component.html.erb @@ -0,0 +1,3 @@ +<%= tag.div role: 'tabpanel', class: @classes.join(' '), id: @id, data: @data do %> + <%= content %> +<% end %> diff --git a/app/components/spotlight/tab_component.rb b/app/components/spotlight/tab_component.rb new file mode 100644 index 0000000000..2380821b7c --- /dev/null +++ b/app/components/spotlight/tab_component.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Spotlight + # Component for a single tab panel pane, with responsibility for also building + # out the tab panel's control + class TabComponent < ViewComponent::Base + def initialize(id:, label:, active: false, label_data: {}) + super + + @id = id + @label = label + @active = active + @classes = ['tab-pane', ('active' if active)].compact + @label_data = label_data + end + + def render_label + tag.li role: 'presentation', class: 'nav-item' do + link_to @label, + "##{@id}", + aria: { + controls: @id + }, + role: 'tab', + data: { toggle: 'tab' }.merge(@label_data), + class: ['nav-link', ('active' if @active)].compact.join(' ') + end + end + end +end diff --git a/app/components/spotlight/tab_panel_component.html.erb b/app/components/spotlight/tab_panel_component.html.erb new file mode 100644 index 0000000000..edc8f6813d --- /dev/null +++ b/app/components/spotlight/tab_panel_component.html.erb @@ -0,0 +1,19 @@ +<% tabs_content = capture do %> +
+<% end %> + +<%= tabs_content if @tab_position == :outside %> + +<%= t(:'.site_theme.help') %>
<%= f.form_group :theme, label: { text: t(:'.site_theme.label') } do %> <% current_exhibit.themes.each do |theme| %> @@ -48,37 +28,36 @@<%= t(:'.site_masthead.help') %>
- <%= f.fields_for(:masthead, current_exhibit.masthead || current_exhibit.build_masthead) do |m| %> - <%= render '/spotlight/featured_images/form', f: m, initial_crop_selection: Spotlight::Engine.config.masthead_initial_crop_selection, crop_type: :masthead %> - <% end %> -<%= t(:'.site_masthead.help') %>
+ <%= f.fields_for(:masthead, current_exhibit.masthead || current_exhibit.build_masthead) do |m| %> + <%= render '/spotlight/featured_images/form', f: m, initial_crop_selection: Spotlight::Engine.config.masthead_initial_crop_selection, crop_type: :masthead %> + <% end %>`` + <% end %> -<%= t(:'.site_thumbnail.help') %>
- <%= f.fields_for(:thumbnail, current_exhibit.thumbnail || current_exhibit.build_thumbnail) do |m| %> - <%= render '/spotlight/featured_images/form', f: m, initial_crop_selection: Spotlight::Engine.config.thumbnail_initial_crop_selection, crop_type: :thumbnail %> - <% end %> -<%= t(:'.site_thumbnail.help') %>
+ <%= f.fields_for(:thumbnail, current_exhibit.thumbnail || current_exhibit.build_thumbnail) do |m| %> + <%= render '/spotlight/featured_images/form', f: m, initial_crop_selection: Spotlight::Engine.config.thumbnail_initial_crop_selection, crop_type: :thumbnail %> + <% end %> + <% end %> - -<%= t(:'.main_navigation.help') %>
+ + <% end %> + <% end %> + <% end %><%= t(:".warning_html", export_link: link_to(t(:'spotlight.exhibits.export.download'), spotlight.edit_exhibit_path(current_exhibit, anchor: 'export'))) %>
-<%= t(:".warning_html", export_link: link_to(t(:'spotlight.exhibits.export.download'), spotlight.edit_exhibit_path(current_exhibit, anchor: 'export'))) %>
+<%= t :'.instructions' %>
-<%= t :'.instructions' %>
+<%= t :'.instructions' %>
-<%= t :'.instructions' %>
+<%= t :'spotlight.exhibits.languages.selection_instructions' %>
+<%= t :'spotlight.exhibits.languages.selection_instructions' %>
- <%= bootstrap_form_for [current_exhibit, Spotlight::Language.new], layout: :horizontal, html: { class: 'row' }, label_col: "col-sm-3", control_col: "col-sm-9" do |f| %> -<%= t :'spotlight.exhibits.languages.current_instructions' %>
+<% if current_exhibit.languages.any? && current_exhibit.languages.last.persisted? %> +<%= t :'spotlight.exhibits.languages.current_instructions' %>
- <%= bootstrap_form_for current_exhibit, layout: :horizontal do |f| %> -<%= t('.table_heading.language') %> | -<%= t('.table_heading.public') %> | -<%= t('.table_heading.action') %> | -
---|---|---|
<%= t("locales.#{language.locale}") %> | -
-
- <%= languages.label :public, class: 'sr-only' %>
- <%= languages.check_box_without_bootstrap :public %>
-
- |
- <%= link_to t('.remove'), exhibit_language_path(current_exhibit, language), method: :delete, data: { confirm: t('.modal.confirm') }, class: 'btn btn-sm btn-danger' %> | -
<%= t('.table_heading.language') %> | +<%= t('.table_heading.public') %> | +<%= t('.table_heading.action') %> | +
---|---|---|
<%= t("locales.#{language.locale}") %> | +
+
+ <%= languages.label :public, class: 'sr-only' %>
+ <%= languages.check_box_without_bootstrap :public %>
+
+ |
+ <%= link_to t('.remove'), exhibit_language_path(current_exhibit, language), method: :delete, data: { confirm: t('.modal.confirm') }, class: 'btn btn-sm btn-danger' %> | +
<%= t('.no_languages_help_text') %>
+<%= t('.no_languages_help_text') %>
+<% end %> diff --git a/app/views/spotlight/exhibits/_public_exhibits.html.erb b/app/views/spotlight/exhibits/_public_exhibits.html.erb new file mode 100644 index 0000000000..7e8ddce80d --- /dev/null +++ b/app/views/spotlight/exhibits/_public_exhibits.html.erb @@ -0,0 +1,11 @@ +<%= render 'tags', tags: @exhibits.published.all_tags %> +<%= render 'exhibits', exhibits: @published_exhibits %> + +<% if @published_exhibits.total_count > @published_exhibits.size %> + +<% end %> diff --git a/app/views/spotlight/exhibits/edit.html.erb b/app/views/spotlight/exhibits/edit.html.erb index 0a7efa15fd..1aa437c41b 100644 --- a/app/views/spotlight/exhibits/edit.html.erb +++ b/app/views/spotlight/exhibits/edit.html.erb @@ -3,45 +3,39 @@ <% end %> <%= configuration_page_title %> -<%= t :'spotlight.exhibits.filter.instructions' %>
+<%= bootstrap_form_for [@exhibit, @exhibit.filters.first_or_initialize], layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10' do |f| %> +<%= t :'spotlight.exhibits.filter.instructions' %>
- <%= f.text_field :field %> - <%= f.text_field :value %> - <%= hidden_field_tag :tab, 'filter' %> + <%= f.text_field :field %> + <%= f.text_field :value %> + <%= hidden_field_tag :tab, 'filter' %> -<%= t(:'.thumbnail.help') %>
<%= render '/spotlight/featured_images/form', f: m, initial_crop_selection: Spotlight::Engine.config.featured_image_thumb_size, crop_type: :thumbnail %> <% end %> -<%= t(:'.group.help') %>
- <%= f.collection_check_boxes(:group_ids, @groups, :id, :title, hide_label: true) %> - <% else %> -<%= t(:'.group.help_no_groups') %>
- <% end %> -<%= t(:'.masthead.help') %>
-<%= t(:'.masthead.help_secondary') %>
- <%= render '/spotlight/featured_images/form', f: m, initial_crop_selection: Spotlight::Engine.config.masthead_initial_crop_selection, crop_type: :masthead %> - <% end %> -<%= t(:'.thumbnail.help') %>
- <%= render '/spotlight/featured_images/form', f: m, initial_crop_selection: Spotlight::Engine.config.featured_image_thumb_size, crop_type: :thumbnail %> - <% end %> -<%= t(:'.group.help') %>
+ <%= f.collection_check_boxes(:group_ids, @groups, :id, :title, hide_label: true) %> + <% else %> +<%= t(:'.group.help_no_groups') %>
+ <% end %> + <% end %> + + <% component.tab(id: 'search-masthead', label: t(:'.search_masthead')) do %> + <%= f.fields_for :masthead, (@search.masthead || @search.build_masthead) do |m| %> +<%= t(:'.masthead.help') %>
+<%= t(:'.masthead.help_secondary') %>
+ <%= render '/spotlight/featured_images/form', f: m, initial_crop_selection: Spotlight::Engine.config.masthead_initial_crop_selection, crop_type: :masthead %> + <% end %> + <% end %> + + <% component.tab(id: 'search-thumbnail', label: t(:'.search_thumbnail')) do %> + <%= f.fields_for :thumbnail, (@search.thumbnail || @search.build_thumbnail) do |m| %> +<%= t(:'.thumbnail.help') %>
+ <%= render '/spotlight/featured_images/form', f: m, initial_crop_selection: Spotlight::Engine.config.featured_image_thumb_size, crop_type: :thumbnail %> + <% end %> + <% end %> + <% end %><%= t(:'.categories_instructions') %>
- <% unless @exhibit.searchable? %> -- <%= t(:'.not_searchable_html', href: link_to(t(:'spotlight.configuration.sidebar.search_configuration'), spotlight.edit_exhibit_search_configuration_path(@exhibit))) %> -
- <% end %> - <%= bootstrap_form_for @exhibit, url: update_all_exhibit_searches_path(@exhibit), layout: :horizontal, control_col: 'col-sm-10' do |f| %> +<%= t(:'.site_masthead.help') %>
- <%= f.fields_for(:masthead, @site.masthead || @site.build_masthead) do |m| %> - <%= render '/spotlight/featured_images/upload_form', f: m, initial_crop_selection: Spotlight::Engine.config.masthead_initial_crop_selection, crop_type: :masthead %> - <% end %> -<%= t(:'.site_masthead.help') %>
+ <%= f.fields_for(:masthead, @site.masthead || @site.build_masthead) do |m| %> + <%= render '/spotlight/featured_images/upload_form', f: m, initial_crop_selection: Spotlight::Engine.config.masthead_initial_crop_selection, crop_type: :masthead %> + <% end %> + <% end %> + <% end %>