blacklight-spotlight 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/app/components/spotlight/uneditable_non_default_language_component.html.erb +5 -0
  3. data/app/components/spotlight/uneditable_non_default_language_component.rb +25 -0
  4. data/app/controllers/concerns/spotlight/catalog.rb +1 -1
  5. data/app/controllers/concerns/spotlight/controller.rb +1 -1
  6. data/app/controllers/spotlight/browse_controller.rb +2 -2
  7. data/app/controllers/spotlight/catalog_controller.rb +1 -1
  8. data/app/controllers/spotlight/searches_controller.rb +2 -1
  9. data/app/models/sir_trevor_rails/blocks/displayable.rb +2 -1
  10. data/app/models/spotlight/lock.rb +1 -1
  11. data/app/models/spotlight/page.rb +7 -0
  12. data/app/views/spotlight/about_pages/_contact.html.erb +1 -1
  13. data/app/views/spotlight/accessibility/alt_text.html.erb +3 -0
  14. data/app/views/spotlight/appearances/edit.html.erb +14 -9
  15. data/app/views/spotlight/exhibits/_form.html.erb +2 -2
  16. data/app/views/spotlight/metadata_configurations/edit.html.erb +47 -44
  17. data/app/views/spotlight/pages/_order_pages.html.erb +34 -29
  18. data/app/views/spotlight/pages/_page.html.erb +1 -1
  19. data/app/views/spotlight/search_configurations/_facets.html.erb +1 -1
  20. data/app/views/spotlight/search_configurations/edit.html.erb +40 -34
  21. data/app/views/spotlight/searches/_group.html.erb +1 -1
  22. data/app/views/spotlight/searches/_search.html.erb +1 -1
  23. data/app/views/spotlight/searches/index.html.erb +4 -2
  24. data/app/views/spotlight/tags/_tag.html.erb +1 -1
  25. data/app/views/spotlight/translations/_page.html.erb +1 -1
  26. data/config/locales/spotlight.en.yml +5 -0
  27. data/lib/spotlight/version.rb +1 -1
  28. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a26266b1d604813d250c2b425946aac71d949a2fbab512afc7df223b47e05289
4
- data.tar.gz: d83e03919f89b14dacb40962671ceff6423293055d08195e976156e6dfa312d1
3
+ metadata.gz: '08d617eac0c85933f2ac4c6f0e50c82f8e6880b7296edf8730b0978aa9d81d7f'
4
+ data.tar.gz: 31c89e414dfd108a7bb02c5a16c64f7d1f8bbfea9c8c88e5bde93a8748475e0a
5
5
  SHA512:
6
- metadata.gz: 158c210f757f5f4d264e9015b6b6e274ea2a6fbc4623d681fee5705cf189aaae248936b271079ee2419ef6ee81c4e55095de0ed730614d2d75b1fdfa7f872b53
7
- data.tar.gz: 28b4acb8124c98fc4c55a445626e89fca4d937e409a7146250ddfbb41fe52f9a9096f7a215ea6165562e04e2acd108093933caae0e4cd449e0edc668a52b8d33
6
+ metadata.gz: a229baf50bb0314fde2767c5200017e254a9325d83a9a8722f2177540b9c5bf3a9d567f07df7b18485dee9752de4fc613d3ace636445229d3257570105cade36
7
+ data.tar.gz: 338366a9da9b8321748c957a31fb5ef210b5d2c95fb2594be0fa01d51e2a8cba0adc22736d0e1665fa1d4e30a319a1987bdcb9b2f6b6070eb8b965549d12dbf3
@@ -0,0 +1,5 @@
1
+ <p>
2
+ <%= t('spotlight.exhibits.form.uneditable_non_default_language_form.instructions') %>
3
+ </p>
4
+ <%= edit_translations_button %>
5
+ <%= switch_to_default_language_button %>
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ # Displays a message that this exhibit information cannot be edited in the
5
+ # currently selected language and provides other options.
6
+ class UneditableNonDefaultLanguageComponent < ViewComponent::Base
7
+ def initialize(current_exhibit:, current_language:)
8
+ @current_exhibit = current_exhibit
9
+ @current_language = current_language
10
+ super
11
+ end
12
+
13
+ def edit_translations_button
14
+ link_to I18n.t('spotlight.exhibits.form.uneditable_non_default_language_form.translations'),
15
+ helpers.spotlight.edit_exhibit_translations_path(@current_exhibit, locale: @current_language),
16
+ class: 'btn btn-primary'
17
+ end
18
+
19
+ def switch_to_default_language_button
20
+ link_to I18n.t('spotlight.exhibits.form.uneditable_non_default_language_form.default_language'),
21
+ helpers.spotlight.edit_exhibit_path(@current_exhibit, locale: I18n.default_locale),
22
+ class: 'btn btn-primary'
23
+ end
24
+ end
25
+ end
@@ -34,7 +34,7 @@ module Spotlight
34
34
  # rubocop:enable Metrics/MethodLength
35
35
 
36
36
  def render_curator_actions?
37
- (current_exhibit && can?(:curate, current_exhibit)) &&
37
+ current_exhibit && can?(:curate, current_exhibit) &&
38
38
  !(params[:controller] == 'spotlight/catalog' && params[:action] == 'admin')
39
39
  end
40
40
  end
@@ -57,7 +57,7 @@ module Spotlight
57
57
  end
58
58
 
59
59
  def exhibit_masthead?
60
- current_exhibit&.masthead && current_exhibit.masthead.display?
60
+ current_exhibit&.masthead&.display?
61
61
  end
62
62
 
63
63
  def set_locale
@@ -73,7 +73,7 @@ module Spotlight
73
73
  end
74
74
 
75
75
  def attach_search_breadcrumb
76
- add_breadcrumb(@search.full_title, (@group.present? ? exhibit_browse_group_path(@exhibit, @group, @search) : exhibit_browse_path(@exhibit, @search)))
76
+ add_breadcrumb(@search.full_title, @group.present? ? exhibit_browse_group_path(@exhibit, @group, @search) : exhibit_browse_path(@exhibit, @search))
77
77
  end
78
78
 
79
79
  def _prefixes
@@ -89,7 +89,7 @@ module Spotlight
89
89
  end
90
90
 
91
91
  def resource_masthead?
92
- @search&.masthead && @search.masthead.display?
92
+ @search&.masthead&.display?
93
93
  end
94
94
 
95
95
  # This is overidden for the browse controller context from where it is defined in a helper
@@ -226,7 +226,7 @@ module Spotlight
226
226
  redirect_to spotlight.exhibit_root_path(@exhibit) unless has_search_parameters?
227
227
  end
228
228
 
229
- def has_search_parameters? # rubocop:disable Naming/PredicateName
229
+ def has_search_parameters? # rubocop:disable Naming/PredicatePrefix
230
230
  super || params[:browse_category_id].present?
231
231
  end
232
232
 
@@ -35,7 +35,8 @@ module Spotlight
35
35
  end
36
36
 
37
37
  def create
38
- @search.assign_attributes(search_params.except((:title unless @search.new_record?)))
38
+ params_to_exclude = :title unless @search.new_record?
39
+ @search.assign_attributes(search_params.except(params_to_exclude))
39
40
  @search.query_params = query_params
40
41
 
41
42
  if @search.save
@@ -20,7 +20,8 @@ module SirTrevorRails
20
20
  private
21
21
 
22
22
  def item_values
23
- Array((item.values if item.present?))
23
+ values = item.values if item.present?
24
+ Array(values)
24
25
  end
25
26
  end
26
27
  end
@@ -16,7 +16,7 @@ module Spotlight
16
16
  end
17
17
 
18
18
  def stale?
19
- created_at < (12.hours.ago)
19
+ created_at < 12.hours.ago
20
20
  end
21
21
  end
22
22
  end
@@ -52,6 +52,13 @@ module Spotlight
52
52
  translated_page_for(I18n.locale)&.title || super
53
53
  end
54
54
 
55
+ # Returns the title of the page in the default locale regardless of the current locale.
56
+ def default_locale_title
57
+ return self[:title] if I18n.locale == I18n.default_locale || default_locale_page.blank?
58
+
59
+ default_locale_page[:title]
60
+ end
61
+
55
62
  def content_changed!
56
63
  @content = nil
57
64
  end
@@ -1,4 +1,4 @@
1
- <%= render layout: 'spotlight/shared/dd3_item', locals: { id: f.object.id.to_s, field: f, enabled_method: :show_in_sidebar, label_method: :name } do |_, section| %>
1
+ <%= render layout: 'spotlight/shared/dd3_item', locals: { id: f.object.id.to_s, field: f, index: f.index, enabled_method: :show_in_sidebar, label_method: :name } do |_, section| %>
2
2
  <% case section when nil %>
3
3
  <div class="d-flex flex-grow-1">
4
4
  <%= f.check_box :show_in_sidebar, hide_label: true, inline: true %>
@@ -43,6 +43,9 @@
43
43
  </svg>
44
44
  <% end %>
45
45
  </span>
46
+ <% unless page.published? %>
47
+ <div class="badge bg-info unpublished align-baseline p-1"><%= t('.unpublished') %></div>
48
+ <% end %>
46
49
  </h4>
47
50
  <%= render Spotlight::EditViewLinksComponent.new(page:, classes:'page-links pt-0') %>
48
51
  </td>
@@ -66,15 +66,20 @@
66
66
  </div>
67
67
 
68
68
  <div role="tabpanel" class="tab-pane" id="main-menu">
69
- <%= field_set_tag do %>
70
- <p class="instructions"><%= t(:'.main_navigation.help') %></p>
71
- <div class="card-group dd main_navigation_admin col-sm-7" id="nested-navigation" data-behavior="nestable" data-max-depth="1">
72
- <ol class="dd-list">
73
- <%= f.fields_for :main_navigations do |label| %>
74
- <%= render layout: 'spotlight/shared/dd3_item', locals: { id: label.object.nav_type, field: label, label: label.object.label_or_default, default_value: label.object.default_label, index: label.index, enabled_method: :display } do; end %>
75
- <% end %>
76
- </ol>
77
- </div>
69
+ <%# These fields are translatable and should only be edited here in the default locale %>
70
+ <% if default_language? %>
71
+ <%= field_set_tag do %>
72
+ <p class="instructions"><%= t(:'.main_navigation.help') %></p>
73
+ <div class="card-group dd main_navigation_admin col-sm-7" id="nested-navigation" data-behavior="nestable" data-max-depth="1">
74
+ <ol class="dd-list">
75
+ <%= f.fields_for :main_navigations do |label| %>
76
+ <%= render layout: 'spotlight/shared/dd3_item', locals: { id: label.object.nav_type, field: label, label: label.object.label_or_default, default_value: label.object.default_label, index: label.index, enabled_method: :display } do; end %>
77
+ <% end %>
78
+ </ol>
79
+ </div>
80
+ <% end %>
81
+ <% else %>
82
+ <%= render Spotlight::UneditableNonDefaultLanguageComponent.new(current_exhibit:, current_language: I18n.locale)%>
78
83
  <% end %>
79
84
  </div>
80
85
  </div>
@@ -1,8 +1,8 @@
1
1
  <%= bootstrap_form_for @exhibit, url: ((spotlight.exhibit_path(@exhibit) if @exhibit.persisted?) || spotlight.exhibits_path), layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10', html: {class: "row"} do |f| %>
2
2
  <div class="col-md-12">
3
3
  <%= f.text_field :title, disabled: !default_language?, help: !default_language? ? t('.uneditable_non_default_language') : '' %>
4
- <%= f.text_field :subtitle %>
5
- <%= f.text_area :description %>
4
+ <%= f.text_field :subtitle, disabled: !default_language?, help: !default_language? ? t('.uneditable_non_default_language') : '' %>
5
+ <%= f.text_area :description, disabled: !default_language?, help: !default_language? ? t('.uneditable_non_default_language') : '' %>
6
6
  <%= render Spotlight::TagListFormComponent.new(form: f) %>
7
7
  <%= f.form_group(:contact_emails, label: { text: nil, class: nil, for: 'exhibit_contact_email_0' }, class: 'form-group mb-3', help: nil) do %>
8
8
  <%= f.fields_for :contact_emails do |contact| %>
@@ -3,59 +3,59 @@
3
3
  <% end %>
4
4
 
5
5
  <%= configuration_page_title %>
6
- <%= bootstrap_form_for @blacklight_configuration, url: spotlight.exhibit_metadata_configuration_path(@exhibit), layout: :horizontal, label_col: 'col-md-3 col-sm-3', control_col: 'col-md-5 col-sm-5' do |f| %>
7
- <h2><%= t(:'.order_header') %></h2>
6
+ <%# These fields are translatable and should only be edited here in the default locale %>
7
+ <% if default_language? %>
8
+ <%= bootstrap_form_for @blacklight_configuration, url: spotlight.exhibit_metadata_configuration_path(@exhibit), layout: :horizontal, label_col: 'col-md-3 col-sm-3', control_col: 'col-md-5 col-sm-5' do |f| %>
9
+ <h2><%= t(:'.order_header') %></h2>
8
10
 
9
- <p class="instructions"><%= t :'.instructions' %></p>
11
+ <p class="instructions"><%= t :'.instructions' %></p>
10
12
 
11
- <table id="nested-fields" class="metadata-configuration table table-striped dd-table">
12
- <thead>
13
- <tr>
14
- <th class="w-50"><%= t :'.field.label' %></th>
15
- <th class="text-center">
16
- <div>
17
- <%= t :'.view.show' %>
18
- </div>
19
- <div class="text-center">
20
- <%= label_tag 'item_details', class: 'select-label' do %>
21
- <%= select_deselect_action(t :'.view.select_id') %>
22
- <%= t(:'.select_all') %>
23
- <% end %>
24
- </div>
25
- </th>
26
- <% available_view_fields.keys.each do |type| %>
13
+ <table id="nested-fields" class="metadata-configuration table table-striped dd-table">
14
+ <thead>
15
+ <tr>
16
+ <th class="w-50"><%= t :'.field.label' %></th>
27
17
  <th class="text-center">
28
- <div>
29
- <%= t :".view.#{type}", default: t("blacklight.search.view.#{type}", default: type.to_s.humanize.titleize) %>
18
+ <div>
19
+ <%= t :'.view.show' %>
30
20
  </div>
31
21
  <div class="text-center">
32
- <%= label_tag t(:'.deselect_all') + type.to_s, class: 'select-label' do %>
33
- <%= select_deselect_action(t(:'.deselect_all') + type.to_s) %>
34
- <%= t(:'.select_all') %>
35
- <% end %>
22
+ <%= label_tag 'item_details', class: 'select-label' do %>
23
+ <%= select_deselect_action(t :'.view.select_id') %>
24
+ <%= t(:'.select_all') %>
25
+ <% end %>
36
26
  </div>
37
27
  </th>
28
+ <% available_view_fields.keys.each do |type| %>
29
+ <th class="text-center">
30
+ <div>
31
+ <%= t :".view.#{type}", default: t("blacklight.search.view.#{type}", default: type.to_s.humanize.titleize) %>
32
+ </div>
33
+ <div class="text-center">
34
+ <%= label_tag t(:'.deselect_all') + type.to_s, class: 'select-label' do %>
35
+ <%= select_deselect_action(t(:'.deselect_all') + type.to_s) %>
36
+ <%= t(:'.select_all') %>
37
+ <% end %>
38
+ </div>
39
+ </th>
40
+ <% end %>
41
+ <th class="text-center"><%= t :'.type_label' %></th>
42
+ </tr>
43
+ </thead>
44
+ <tbody class="metadata_fields dd dd-list" data-behavior="nestable" data-max-depth="1" data-list-node-name="tbody" data-item-node-name="tr" data-expand-btn-HTML=" " data-collapse-btn-HTML=" ">
45
+ <%= f.fields_for :index_fields do |idxf| %>
46
+ <% @blacklight_configuration.blacklight_config.index_fields.select { |k, v| blacklight_configuration_context.evaluate_if_unless_configuration(v.original) }.each do |key, config| %>
47
+ <%= render partial: 'metadata_field', locals: { key: key, config: config, f: idxf } %>
48
+ <% end %>
38
49
  <% end %>
39
- <th class="text-center"><%= t :'.type_label' %></th>
40
- </tr>
41
- </thead>
42
- <tbody class="metadata_fields dd dd-list" data-behavior="nestable" data-max-depth="1" data-list-node-name="tbody" data-item-node-name="tr" data-expand-btn-HTML=" " data-collapse-btn-HTML=" ">
43
- <%= f.fields_for :index_fields do |idxf| %>
44
- <% @blacklight_configuration.blacklight_config.index_fields.select { |k, v| blacklight_configuration_context.evaluate_if_unless_configuration(v.original) }.each do |key, config| %>
45
- <%= render partial: 'metadata_field', locals: { key: key, config: config, f: idxf } %>
46
- <% end %>
47
- <% end %>
48
- </tbody>
49
- </table>
50
+ </tbody>
51
+ </table>
50
52
 
51
- <div class="form-actions">
52
- <div class="primary-actions">
53
- <%= f.submit nil, class: 'btn btn-primary' %>
53
+ <div class="form-actions">
54
+ <div class="primary-actions">
55
+ <%= f.submit nil, class: 'btn btn-primary' %>
56
+ </div>
54
57
  </div>
55
- </div>
56
- <% end %>
57
-
58
-
58
+ <% end %>
59
59
  <h2 class="mt-4"><%= t(:'.exhibit_specific.header') %></h2>
60
60
  <p class="instructions"><%= t(:'.exhibit_specific.instructions') %></p>
61
61
 
@@ -80,4 +80,7 @@
80
80
  </table>
81
81
 
82
82
 
83
- <%= exhibit_create_link Spotlight::CustomField.new, class: 'btn btn-primary' %>
83
+ <%= exhibit_create_link Spotlight::CustomField.new, class: 'btn btn-primary' %>
84
+ <% else %>
85
+ <%= render Spotlight::UneditableNonDefaultLanguageComponent.new(current_exhibit:, current_language: I18n.locale) %>
86
+ <% end %>
@@ -1,33 +1,38 @@
1
1
  <%= curation_page_title t(:"spotlight.pages.index.#{page_collection_name}.header") %>
2
- <%= bootstrap_form_for @exhibit, url: polymorphic_path([:update_all, @exhibit, page_collection_name.to_sym]), layout: :horizontal, control_col: 'col-sm-10', html: {:'data-form-observer' => true} do |f| %>
2
+ <%# These fields are translatable and should only be edited here in the default locale %>
3
+ <% if default_language? %>
4
+ <%= bootstrap_form_for @exhibit, url: polymorphic_path([:update_all, @exhibit, page_collection_name.to_sym]), layout: :horizontal, control_col: 'col-sm-10', html: {:'data-form-observer' => true} do |f| %>
3
5
 
4
- <%= render partial: 'header', locals: {f: f} %>
5
- <h2 class="mt-4"><%= t :'.pages_header' %></h2>
6
- <p class="instructions"><%= t :'.instructions' %></p>
7
- <div class="panel-group dd <%= page_collection_name %>_admin" id="nested-pages" data-behavior="nestable" <%= nestable_data_attributes(page_collection_name).html_safe %> >
8
- <ol class="dd-list">
9
- <%= f.fields_for page_collection_name do |p| %>
10
- <%- if p.object.about_page? || p.object.top_level_page? -%>
11
- <%= render partial: 'page', locals: {f: p, parent_form: f} %>
12
- <%- end -%>
13
- <% end %>
14
- </ol>
15
- </div>
16
- <div class="form-actions float-end">
17
- <div class="primary-actions">
18
- <%= button_tag action_label(page_collection_name, :update_all), class: "btn btn-primary", disabled: disable_save_pages_button? %>
6
+ <%= render partial: 'header', locals: {f: f} %>
7
+ <h2 class="mt-4"><%= t :'.pages_header' %></h2>
8
+ <p class="instructions"><%= t :'.instructions' %></p>
9
+ <div class="panel-group dd <%= page_collection_name %>_admin" id="nested-pages" data-behavior="nestable" <%= nestable_data_attributes(page_collection_name).html_safe %> >
10
+ <ol class="dd-list">
11
+ <%= f.fields_for page_collection_name do |p| %>
12
+ <%- if p.object.about_page? || p.object.top_level_page? -%>
13
+ <%= render partial: 'page', locals: {f: p, parent_form: f} %>
14
+ <%- end -%>
15
+ <% end %>
16
+ </ol>
17
+ </div>
18
+ <div class="form-actions float-end">
19
+ <div class="primary-actions">
20
+ <%= button_tag action_label(page_collection_name, :update_all), class: "btn btn-primary", disabled: disable_save_pages_button? %>
21
+ </div>
19
22
  </div>
20
- </div>
21
- <%- end -%>
22
- <div>
23
- <%= form_for @page, url: spotlight.polymorphic_path([@exhibit, page_collection_name.to_sym]), html: {class: "expanded-add-button"} do |f|%>
24
- <a href='#add-new' class="btn btn-primary" data-turbo="false" data-turbolinks="false" data-expanded-add-button="true" data-field-target="[data-title-field]">
25
- <%= t(:'.new_page') %> <%= blacklight_icon('chevron_right') %>
26
- <span data-title-field="true" class="input-field">
27
- <%= f.text_field(:title) %>
28
- <%= f.submit t(:'.save'), data: {behavior: "save"} %>
29
- <%= f.submit t(:'.cancel'), data: {behavior: "cancel"} %>
30
- </span>
31
- </a>
32
23
  <%- end -%>
33
- </div>
24
+ <div>
25
+ <%= form_for @page, url: spotlight.polymorphic_path([@exhibit, page_collection_name.to_sym]), html: {class: "expanded-add-button"} do |f|%>
26
+ <a href='#add-new' class="btn btn-primary" data-turbo="false" data-turbolinks="false" data-expanded-add-button="true" data-field-target="[data-title-field]">
27
+ <%= t(:'.new_page') %> <%= blacklight_icon('chevron_right') %>
28
+ <span data-title-field="true" class="input-field">
29
+ <%= f.text_field(:title) %>
30
+ <%= f.submit t(:'.save'), data: {behavior: "save"} %>
31
+ <%= f.submit t(:'.cancel'), data: {behavior: "cancel"} %>
32
+ </span>
33
+ </a>
34
+ <%- end -%>
35
+ </div>
36
+ <% else %>
37
+ <%= render Spotlight::UneditableNonDefaultLanguageComponent.new(current_exhibit:, current_language: I18n.locale)%>
38
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  <% page = f.object %>
2
- <%= render layout: 'spotlight/shared/dd3_item', locals: { id: page.id.to_s, field: f, label: page.title, label_method: :title, enabled_method: :published } do |_, section| %>
2
+ <%= render layout: 'spotlight/shared/dd3_item', locals: { id: page.id.to_s, index: f.index, field: f, label: page.title, label_method: :title, enabled_method: :published } do |_, section| %>
3
3
  <% case section when :additional_options %>
4
4
  <%= render Spotlight::EditViewLinksComponent.new(page:, delete_link: true) %>
5
5
  <%- if page.feature_page? -%>
@@ -6,7 +6,7 @@
6
6
  <% metadata = @field_metadata.field(key) %>
7
7
  <% next unless metadata[:document_count] > 0 || config.custom_field %>
8
8
  <%= idxf.fields_for key, config do |facet| %>
9
- <%= render layout: 'spotlight/shared/dd3_item', locals: { id: key, field: facet, dd3_content_classes: "facet-config-#{key.parameterize} page" , enabled_method: :show, label_method: :label, label: facet_field_label(key) } do |_, section| %>
9
+ <%= render layout: 'spotlight/shared/dd3_item', locals: { id: key, field: facet, index: facet.index, dd3_content_classes: "facet-config-#{key.parameterize} page" , enabled_method: :show, label_method: :label, label: facet_field_label(key) } do |_, section| %>
10
10
  <% case section when :additional_content %>
11
11
  <div class="mt-2">
12
12
  <%= facet.form_group :terms, label_col: 'col-md-2 offset-md-1', label: { text: t(:'spotlight.search_configurations.facets.sort_by.label') } do %>
@@ -3,45 +3,51 @@
3
3
  <% end %>
4
4
 
5
5
  <%= configuration_page_title %>
6
- <%= bootstrap_form_for @blacklight_configuration, url: spotlight.exhibit_search_configuration_path(@exhibit), layout: :horizontal, label_col: 'col-md-3 col-sm-3', control_col: 'col-md-5 col-sm-5' do |f| %>
7
-
8
- <div role="tabpanel">
9
- <ul class="nav nav-tabs" role="tablist">
10
- <li role="presentation" class="nav-item">
11
- <a href="#options" aria-controls="options" role="tab" data-bs-toggle="tab" class="nav-link active"><%= t(:'.tab.options') %></a>
12
- </li>
13
- <li role="presentation" class="nav-item">
14
- <a href="#facets" aria-controls="facets" role="tab" data-bs-toggle="tab" class="nav-link"><%= t(:'.tab.facets') %></a>
15
- </li>
16
- <li role="presentation" class="nav-item">
17
- <a href="#results" aria-controls="results" role="tab" data-bs-toggle="tab" class="nav-link"><%= t(:'.tab.results') %></a>
18
- </li>
19
- </ul>
20
- <div class="tab-content">
21
- <div role="tabpanel" class="tab-pane active" id="options">
22
- <%= render 'search_fields', f: f %>
23
- </div>
24
-
25
- <div role="tabpanel" class="tab-pane" id="facets">
26
- <%= render 'facets', f: f %>
27
- </div>
28
6
 
29
- <div role="tabpanel" class="tab-pane" id="results">
30
- <%= field_set_tag do %>
31
- <%= render 'document_index_view_types', f: f %>
32
- <%= render 'default_per_page', f: f %>
33
- <% end %>
7
+ <%# These fields are translatable and should only be edited here in the default locale %>
8
+ <% if default_language? %>
9
+ <%= bootstrap_form_for @blacklight_configuration, url: spotlight.exhibit_search_configuration_path(@exhibit), layout: :horizontal, label_col: 'col-md-3 col-sm-3', control_col: 'col-md-5 col-sm-5' do |f| %>
10
+
11
+ <div role="tabpanel">
12
+ <ul class="nav nav-tabs" role="tablist">
13
+ <li role="presentation" class="nav-item">
14
+ <a href="#options" aria-controls="options" role="tab" data-bs-toggle="tab" class="nav-link active"><%= t(:'.tab.options') %></a>
15
+ </li>
16
+ <li role="presentation" class="nav-item">
17
+ <a href="#facets" aria-controls="facets" role="tab" data-bs-toggle="tab" class="nav-link"><%= t(:'.tab.facets') %></a>
18
+ </li>
19
+ <li role="presentation" class="nav-item">
20
+ <a href="#results" aria-controls="results" role="tab" data-bs-toggle="tab" class="nav-link"><%= t(:'.tab.results') %></a>
21
+ </li>
22
+ </ul>
23
+ <div class="tab-content">
24
+ <div role="tabpanel" class="tab-pane active" id="options">
25
+ <%= render 'search_fields', f: f %>
26
+ </div>
27
+
28
+ <div role="tabpanel" class="tab-pane" id="facets">
29
+ <%= render 'facets', f: f %>
30
+ </div>
31
+
32
+ <div role="tabpanel" class="tab-pane" id="results">
33
+ <%= field_set_tag do %>
34
+ <%= render 'document_index_view_types', f: f %>
35
+ <%= render 'default_per_page', f: f %>
36
+ <% end %>
37
+
38
+ <%= render 'sort', f: f %>
39
+ </div>
34
40
 
35
- <%= render 'sort', f: f %>
36
41
  </div>
37
-
38
42
  </div>
39
- </div>
40
43
 
41
- <div class="form-actions">
42
- <div class="primary-actions">
43
- <%= f.submit nil, class: 'btn btn-primary' %>
44
+ <div class="form-actions">
45
+ <div class="primary-actions">
46
+ <%= f.submit nil, class: 'btn btn-primary' %>
47
+ </div>
44
48
  </div>
45
- </div>
46
49
 
50
+ <% end %>
51
+ <% else %>
52
+ <%= render Spotlight::UneditableNonDefaultLanguageComponent.new(current_exhibit:, current_language: I18n.locale)%>
47
53
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <% group = f.object %>
2
- <%= render layout: 'spotlight/shared/dd3_item', locals: { id: group.id.to_s, field: f, dd3_content_classes: "group" , enabled_method: :published, label_method: :title, label: group.title } do |_, section| %>
2
+ <%= render layout: 'spotlight/shared/dd3_item', locals: { id: group.id.to_s, index: f.index, field: f, dd3_content_classes: "group" , enabled_method: :published, label_method: :title, label: group.title } do |_, section| %>
3
3
  <% case section when nil %>
4
4
  <div class="d-flex flex-grow-1">
5
5
  <div>
@@ -1,5 +1,5 @@
1
1
  <% search = f.object %>
2
- <%= render layout: 'spotlight/shared/dd3_item', locals: { id: search.id.to_s, field: f, dd3_content_classes: "search" , enabled_method: :published, label_method: :title, label: search.title } do |_, section| %>
2
+ <%= render layout: 'spotlight/shared/dd3_item', locals: { id: search.id.to_s, field: f, index: f.index, dd3_content_classes: "search" , enabled_method: :published, label_method: :title, label: search.title } do |_, section| %>
3
3
  <% case section when nil %>
4
4
  <div class="d-flex flex-grow-1">
5
5
  <div>
@@ -4,14 +4,14 @@
4
4
 
5
5
  <%= curation_page_title %>
6
6
 
7
- <% if @searches.empty? %>
7
+ <% if @searches.empty? && default_language? %>
8
8
  <%= t :'.no_saved_searches' %>
9
9
  <% unless @exhibit.searchable? %>
10
10
  <p class="instructions alert-warning">
11
11
  <%= t(:'.not_searchable_html', href: link_to(t(:'spotlight.configuration.sidebar.search_configuration'), spotlight.edit_exhibit_search_configuration_path(@exhibit))) %>
12
12
  </p>
13
13
  <% end %>
14
- <% else %>
14
+ <% elsif default_language? %>
15
15
  <div role="tabpanel">
16
16
  <ul class="nav nav-tabs" role="tablist">
17
17
  <li role="presentation" class="nav-item">
@@ -74,4 +74,6 @@
74
74
  </div>
75
75
  </div>
76
76
  </div>
77
+ <% else %>
78
+ <%= render Spotlight::UneditableNonDefaultLanguageComponent.new(current_exhibit:, current_language: I18n.locale) %>
77
79
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <% tag = f.object %>
2
2
 
3
- <%= render layout: 'spotlight/shared/dd3_item', locals: { id: tag.id.to_s, field: f, dd3_content_classes: "tag" , enabled_method: :present?, label_method: :name, label: tag.name } do |_, section| %>
3
+ <%= render layout: 'spotlight/shared/dd3_item', locals: { id: tag.id.to_s, field: f, index: f.index, dd3_content_classes: "tag" , enabled_method: :present?, label_method: :name, label: tag.name } do |_, section| %>
4
4
  <% case section when nil %>
5
5
  <div class="d-flex flex-grow-1">
6
6
  <div class="flex-grow-1 mx-2 main">
@@ -1,7 +1,7 @@
1
1
  <% translated_page = page.translated_page_for(@language) %>
2
2
  <tr data-translation-progress-item="true">
3
3
  <td>
4
- <%= link_to page.title, polymorphic_path([spotlight, current_exhibit, page]) %>
4
+ <%= link_to page.default_locale_title, polymorphic_path([spotlight, current_exhibit, page], locale: I18n.default_locale) %>
5
5
  <p class="<%= 'default-page-outdated' if page.updated_after? translated_page %>">
6
6
  <%= l(page.updated_at, format: :long) %>
7
7
  </p>
@@ -200,6 +200,7 @@ en:
200
200
  has_alt_text: Items with alt text
201
201
  page_title: Page title
202
202
  total_items: Of the items displayed via widgets, <b>%{has_alt_text} of %{total_alt_items}</b> have entered alt text (or a checked decorative box).
203
+ unpublished: Unpublished
203
204
  header: Accessibility
204
205
  admin_users:
205
206
  create:
@@ -575,6 +576,10 @@ en:
575
576
  published:
576
577
  help_block: ''
577
578
  uneditable_non_default_language: This field is not editable in the current language. Switch to the default language to edit it.
579
+ uneditable_non_default_language_form:
580
+ default_language: Switch to default language
581
+ instructions: Please use the translations editor or switch to the default language to make configuration changes.
582
+ translations: Edit translations
578
583
  groups:
579
584
  all: All
580
585
  import:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spotlight
4
- VERSION = '5.0.0'
4
+ VERSION = '5.1.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2025-03-24 00:00:00.000000000 Z
14
+ date: 2025-06-09 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activejob-status
@@ -897,6 +897,8 @@ files:
897
897
  - app/components/spotlight/title_component.rb
898
898
  - app/components/spotlight/translations/subheading_component.html.erb
899
899
  - app/components/spotlight/translations/subheading_component.rb
900
+ - app/components/spotlight/uneditable_non_default_language_component.html.erb
901
+ - app/components/spotlight/uneditable_non_default_language_component.rb
900
902
  - app/controllers/concerns/spotlight/base.rb
901
903
  - app/controllers/concerns/spotlight/catalog.rb
902
904
  - app/controllers/concerns/spotlight/config.rb