blacklight-spotlight 4.5.0 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/spotlight/blocks/sir-trevor-icons.svg +1 -1
  3. data/app/assets/javascripts/spotlight/spotlight.esm.js +19 -22
  4. data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
  5. data/app/assets/javascripts/spotlight/spotlight.js +19 -22
  6. data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
  7. data/app/assets/stylesheets/spotlight/_blacklight_configuration.scss +5 -4
  8. data/app/components/spotlight/bulk_action_component.html.erb +8 -0
  9. data/app/components/spotlight/bulk_action_component.rb +20 -0
  10. data/app/components/spotlight/header_navigation_link_component.html.erb +1 -0
  11. data/app/components/spotlight/header_navigation_link_component.rb +14 -0
  12. data/app/components/spotlight/save_search_component.html.erb +25 -0
  13. data/app/components/spotlight/save_search_component.rb +25 -0
  14. data/app/components/spotlight/translations/subheading_component.html.erb +3 -0
  15. data/app/components/spotlight/translations/subheading_component.rb +17 -0
  16. data/app/controllers/spotlight/accessibility_controller.rb +1 -3
  17. data/app/helpers/spotlight/application_helper.rb +6 -7
  18. data/app/helpers/spotlight/main_app_helpers.rb +1 -1
  19. data/app/javascript/spotlight/admin/blacklight_configuration.js +18 -21
  20. data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +2 -2
  21. data/app/models/spotlight/page_configurations.rb +2 -1
  22. data/app/views/catalog/_bulk_actions.html.erb +1 -10
  23. data/app/views/catalog/_save_search.html.erb +1 -25
  24. data/app/views/shared/_about_navbar.html.erb +1 -1
  25. data/app/views/shared/_browse_navbar.html.erb +1 -1
  26. data/app/views/shared/_curated_features_navbar.html.erb +4 -1
  27. data/app/views/spotlight/accessibility/alt_text.html.erb +1 -7
  28. data/app/views/spotlight/admin_users/index.html.erb +2 -2
  29. data/app/views/spotlight/metadata_configurations/edit.html.erb +12 -2
  30. data/app/views/spotlight/translations/_general.html.erb +2 -6
  31. data/app/views/spotlight/translations/_metadata.html.erb +1 -3
  32. data/app/views/spotlight/translations/_pages.html.erb +4 -9
  33. data/app/views/spotlight/translations/_search_fields.html.erb +3 -9
  34. data/config/locales/spotlight.en.yml +1 -1
  35. data/lib/generators/spotlight/templates/spotlight.scss +0 -1
  36. data/lib/spotlight/engine.rb +7 -0
  37. data/lib/spotlight/version.rb +1 -1
  38. metadata +10 -3
  39. data/app/assets/stylesheets/spotlight/_variables_bootstrap.scss +0 -7
@@ -11,13 +11,11 @@
11
11
  @include edit-in-place-highlighting;
12
12
  }
13
13
 
14
- // the effect of position: relative on table elements is undefined, so put a div in there.
15
- // this fix is for Firefox
16
14
  .handle-wrap {
17
- position: relative;
18
15
  padding: 0.75rem 0.75rem 0.75rem 40px;
19
16
  margin: 0;
20
17
  margin-top: -1px;
18
+ height: 100%;
21
19
  }
22
20
 
23
21
  .dd3-handle:before {
@@ -77,7 +75,10 @@
77
75
  .metadata-select {
78
76
  display: inline-block;
79
77
  text-wrap: nowrap;
80
- min-width: 72px;
78
+ }
79
+
80
+ .select-label {
81
+ font-weight: normal;
81
82
  }
82
83
  }
83
84
 
@@ -0,0 +1,8 @@
1
+ <div class="dropdown bulk-actions-dropdown">
2
+ <%= button %>
3
+ <div class="dropdown-menu" aria-labelledby="bulk-actions-button">
4
+ <% bulk_actions.each do |key, _config| %>
5
+ <%= link_to t("spotlight.bulk_actions.#{key}.heading"), '#', class: 'dropdown-item', data: { toggle: "modal", "bs-toggle": "modal", target: "##{key.to_s.dasherize}-modal", "bs-target": "##{key.to_s.dasherize}-modal" } %>
6
+ <% end %>
7
+ </div>
8
+ </div>
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ # Displays the "Bulk actions" button and dropdown
5
+ class BulkActionComponent < ViewComponent::Base
6
+ def initialize(bulk_actions:, button_classes: 'btn btn-secondary dropdown-toggle')
7
+ @bulk_actions = bulk_actions
8
+ @button_classes = button_classes
9
+ super
10
+ end
11
+
12
+ attr_reader :button_classes, :bulk_actions
13
+
14
+ def button
15
+ button_tag t(:'spotlight.bulk_actions.label'), id: 'bulk-actions-button', class: button_classes,
16
+ data: { toggle: 'dropdown', 'bs-toggle': 'dropdown' },
17
+ aria: { haspopup: true, expanded: false }
18
+ end
19
+ end
20
+ end
@@ -0,0 +1 @@
1
+ <li class="nav-item <%= "active" if @active %>"><%= link_to @label, @path, class: 'nav-link' %></li>
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ # This draws a navigation link in the header.
5
+ # A downstream application may switch out the implementation to use different styles, etc.
6
+ class HeaderNavigationLinkComponent < ViewComponent::Base
7
+ def initialize(path:, active:, label:)
8
+ @path = path
9
+ @active = active
10
+ @label = label
11
+ super
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,25 @@
1
+ <%= button %>
2
+ <div class="modal fade" id="save-modal" tabindex="-1" role="dialog" aria-labelledby="save-modal-label" aria-hidden="true">
3
+ <div class="modal-dialog">
4
+ <%= bootstrap_form_for form_path, html: { novalidate: true } do |f| %>
5
+ <div class="modal-content">
6
+ <div class="modal-header">
7
+ <h4 class="modal-title" id="save-modal-label"><%= t(:'spotlight.saved_search.label') %></h4>
8
+ <button type="button" class="blacklight-modal-close close btn-close" data-dismiss="modal" data-bs-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
9
+ <span aria-hidden="true" class="visually-hidden">&times;</span>
10
+ </button>
11
+ </div>
12
+ <div class="modal-body">
13
+ <%= f.text_field :title, label: t(:'spotlight.saved_search.title') %>
14
+ <%= label_tag :id, t(:'spotlight.saved_search.id'), class: 'col-form-label' %>
15
+ <%= select_tag :id, options_for_select(searches.map { |s| [s.full_title, s.id] }), include_blank: true, class: 'form-control' %>
16
+ <%= render Blacklight::HiddenSearchStateComponent.new(params: search_state.params_for_search.except(:qt, :page)) %>
17
+ </div>
18
+ <div class="modal-footer d-flex flex-row-reverse justify-content-start">
19
+ <%= f.submit nil, class: 'btn btn-primary' %>
20
+ <button type="button" class="btn btn-link" data-dismiss="modal" data-bs-dismiss="modal"><%= t :cancel %></button>
21
+ </div>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+ </div>
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ # Displays the "Save this search" button and modal
5
+ class SaveSearchComponent < ViewComponent::Base
6
+ def initialize(button_classes: 'btn btn-secondary')
7
+ @button_classes = button_classes
8
+ super
9
+ end
10
+
11
+ attr_reader :button_classes
12
+
13
+ delegate :search_state, :current_exhibit, to: :helpers
14
+ delegate :searches, to: :current_exhibit
15
+
16
+ def button
17
+ button_tag t(:'spotlight.saved_search.label'), id: 'save-this-search', class: button_classes,
18
+ data: { toggle: 'modal', 'bs-toggle': 'modal', target: '#save-modal', 'bs-target': '#save-modal' }
19
+ end
20
+
21
+ def form_path
22
+ [helpers.spotlight, current_exhibit, Spotlight::Search.new]
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,3 @@
1
+ <h2 class='translation-subheading mt-4'>
2
+ <%= text %>
3
+ </h2>
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ module Translations
5
+ # Draws a sub-heading for a translation.
6
+ class SubheadingComponent < ViewComponent::Base
7
+ def initialize(key:)
8
+ @key = key
9
+ super
10
+ end
11
+
12
+ def text
13
+ t(@key, scope: 'spotlight.translations')
14
+ end
15
+ end
16
+ end
17
+ end
@@ -8,11 +8,9 @@ module Spotlight
8
8
  load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
9
9
 
10
10
  def alt_text
11
- @limit = 5
12
11
  # Sort by newest except for the homepage, which is always first
13
12
  pages_with_alt = @exhibit.pages.order(Arel.sql('id = 1 DESC, created_at DESC')).select { |elem| elem.content.any?(&:alt_text?) }
14
- pages = params[:show_all] ? pages_with_alt : pages_with_alt.first(@limit)
15
- @pages = pages.map { |page| get_alt_info(page) }
13
+ @pages = pages_with_alt.map { |page| get_alt_info(page) }
16
14
  @has_alt_text = @pages.sum { |page| page[:has_alt_text] }
17
15
  @total_alt_items = @pages.sum { |page| page[:can_have_alt_text] }
18
16
 
@@ -124,14 +124,13 @@ module Spotlight
124
124
  end.keys.map(&:to_s)
125
125
  end
126
126
 
127
- def select_deselect_button
128
- button_tag(
129
- t(:'.deselect_all'),
130
- class: 'btn btn-secondary btn-sm metadata-select',
127
+ # Create checkbox for selecting/deselecting metadata fields for a given view in metadata configuration
128
+ def select_deselect_action(id)
129
+ check_box_tag(
130
+ id,
131
+ class: 'metadata-select',
131
132
  data: {
132
- behavior: 'metadata-select',
133
- 'deselect-text' => t(:'.deselect_all'),
134
- 'select-text' => t(:'.select_all')
133
+ behavior: 'metadata-select'
135
134
  }
136
135
  )
137
136
  end
@@ -46,7 +46,7 @@ module Spotlight
46
46
  if current_exhibit_theme && current_exhibit&.theme != 'default'
47
47
  stylesheet_link_tag "#{tag}_#{current_exhibit_theme}"
48
48
  else
49
- Rails.logger.warn "Exhibit theme '#{current_exhibit_theme}' not in the list of available themes: #{current_exhibit&.themes}"
49
+ Rails.logger.debug { "Exhibit theme '#{current_exhibit_theme}' not in the list of available themes: #{current_exhibit&.themes}" }
50
50
  stylesheet_link_tag(tag)
51
51
  end
52
52
  end
@@ -1,53 +1,50 @@
1
1
  export default class {
2
2
  connect() {
3
- // Add Select/Deselect all button behavior
3
+ // Add Select/Deselect all input behavior
4
4
  this.addCheckboxToggleBehavior();
5
5
  this.addEnableToggleBehavior();
6
6
  }
7
7
 
8
- // Add Select/Deselect all button behavior
8
+ // Add Select/Deselect all behavior for metadata field names for a given view e.g. Item details.
9
9
  addCheckboxToggleBehavior() {
10
10
  $("[data-behavior='metadata-select']").each(function(){
11
- var button = $(this)
12
- var parentCell = button.parents("th");
11
+ var selectCheckbox = $(this);
12
+ var parentCell = selectCheckbox.parents("th");
13
13
  var table = parentCell.closest("table");
14
14
  var columnRows = $("tr td:nth-child(" + (parentCell.index() + 1) + ")", table);
15
15
  var checkboxes = $("input[type='checkbox']", columnRows);
16
- swapSelectAllButtonText(button, columnRows);
17
- // Add the check/uncheck behavior to the button
18
- // and swap the button text if necessary
19
- button.on('click', function(e){
20
- e.preventDefault();
16
+ updateSelectAllInput(selectCheckbox, columnRows);
17
+ // Add the check/uncheck behavior to the select/deselect all checkbox
18
+ selectCheckbox.on('click', function(e){
21
19
  var allChecked = allCheckboxesChecked(columnRows);
22
20
  columnRows.each(function(){
23
21
  $("input[type='checkbox']", $(this)).prop('checked', !allChecked);
24
- swapSelectAllButtonText(button, columnRows);
25
22
  });
26
23
  });
27
- // Swap button text when a checkbox value changes
24
+ // When a single checkbox is selected/unselected, the "All" checkbox should be updated accordingly.
28
25
  checkboxes.each(function(){
29
26
  $(this).on('change', function(){
30
- swapSelectAllButtonText(button, columnRows);
27
+ updateSelectAllInput(selectCheckbox, columnRows);
31
28
  });
32
- });
29
+ });
33
30
  });
31
+
34
32
  // Check number of checkboxes against the number of checked
35
33
  // checkboxes to determine if all of them are checked or not
36
34
  function allCheckboxesChecked(elements) {
37
35
  return ($("input[type='checkbox']", elements).length == $("input[type='checkbox']:checked", elements).length)
38
36
  }
39
- // Swap the button text to "Deselect all"
40
- // when all the checkboxes are checked and
41
- // "Select all" when any are unchecked
42
- function swapSelectAllButtonText(button, elements) {
37
+
38
+ // Check or uncheck the "All" checkbox for each view column, e.g. Item details, List, etc.
39
+ function updateSelectAllInput(checkbox, elements) {
43
40
  if ( allCheckboxesChecked(elements) ) {
44
- button.text(button.data('deselect-text'));
41
+ checkbox.prop('checked', true);
45
42
  } else {
46
- button.text(button.data('select-text'));
43
+ checkbox.prop('checked', false);
47
44
  }
48
45
  }
49
46
  }
50
-
47
+
51
48
  addEnableToggleBehavior() {
52
49
  $("[data-behavior='enable-feature']").each(function(){
53
50
  var checkbox = $(this);
@@ -62,4 +59,4 @@ export default class {
62
59
  });
63
60
  });
64
61
  }
65
- }
62
+ }
@@ -137,8 +137,8 @@ SirTrevor.Blocks.UploadedItems = (function(){
137
137
  </div>
138
138
  <div class="col-md-4">
139
139
  <input name="${this.zpr_key}" type="hidden" value="false" />
140
- <input name="${this.zpr_key}" id="${this.formId(this.zpr_key)}" data-key=${this.zpr_key}" type="checkbox" value="true" />
141
- <label for="${this.formId(this.zpr_key)}">${ i18n.t("blocks:solr_documents:zpr:title")}</label>
140
+ <input name="${this.zpr_key}" id="${this.formId(this.zpr_key)}" data-key="${this.zpr_key}" type="checkbox" value="true" />
141
+ <label for="${this.formId(this.zpr_key)}">${i18n.t("blocks:solr_documents:zpr:title")}</label>
142
142
  </div>
143
143
  </div>
144
144
  ${this.text_area()}
@@ -40,7 +40,8 @@ module Spotlight
40
40
  'autocomplete-exhibit-pages-path': page_autocomplete_endpoint,
41
41
  'autocomplete-exhibit-browse-groups-path': browse_groups_autocomplete_endpoint,
42
42
  'autocomplete-exhibit-searches-path': search_autocomplete_endpoint,
43
- 'preview-url': page_preview_url
43
+ 'preview-url': page_preview_url,
44
+ 'exhibit-path': spotlight.exhibit_path(current_exhibit)
44
45
  }.merge(downstream_parameters)
45
46
  end
46
47
 
@@ -1,12 +1,3 @@
1
- <div class="dropdown bulk-actions-dropdown">
2
- <button class="btn btn-secondary dropdown-toggle" type="button" id="bulk-actions-button" data-toggle="dropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
3
- <%= t(:'spotlight.bulk_actions.label') %>
4
- </button>
5
- <div class="dropdown-menu" aria-labelledby="bulk-actions-button">
6
- <% blacklight_config.bulk_actions.each do |key, _config| %>
7
- <%= link_to t("spotlight.bulk_actions.#{key}.heading"), '#', class: 'dropdown-item', data: { toggle: "modal", "bs-toggle": "modal", target: "##{key.to_s.dasherize}-modal", "bs-target": "##{key.to_s.dasherize}-modal" } %>
8
- <% end %>
9
- </div>
10
- </div>
1
+ <%= render Spotlight::BulkActionComponent.new(bulk_actions: blacklight_config.bulk_actions) %>
11
2
 
12
3
  <%= render_filtered_partials(blacklight_config.bulk_actions) %>
@@ -1,25 +1 @@
1
- <%= button_tag t(:'spotlight.saved_search.label'), id: "save-this-search", class: 'btn btn-secondary', data: { toggle: "modal", "bs-toggle": "modal", target: "#save-modal", "bs-target": "#save-modal" } %>
2
- <div class="modal fade" id="save-modal" tabindex="-1" role="dialog" aria-labelledby="save-modal-label" aria-hidden="true">
3
- <div class="modal-dialog">
4
- <%= bootstrap_form_for [spotlight, current_exhibit, Spotlight::Search.new], html: { novalidate: true } do |f| %>
5
- <div class="modal-content">
6
- <div class="modal-header">
7
- <h4 class="modal-title" id="save-modal-label"><%= t(:'spotlight.saved_search.label') %></h4>
8
- <button type="button" class="blacklight-modal-close close btn-close" data-dismiss="modal" data-bs-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
9
- <span aria-hidden="true" class="visually-hidden">&times;</span>
10
- </button>
11
- </div>
12
- <div class="modal-body">
13
- <%= f.text_field :title, label: t(:'spotlight.saved_search.title') %>
14
- <%= label_tag :id, t(:'spotlight.saved_search.id'), class: 'col-form-label' %>
15
- <%= select_tag :id, options_for_select(current_exhibit.searches.map { |s| [s.full_title, s.id] }), include_blank: true, class: 'form-control' %>
16
- <%= render Blacklight::HiddenSearchStateComponent.new(params: search_state.params_for_search.except(:qt, :page)) %>
17
- </div>
18
- <div class="modal-footer d-flex flex-row-reverse justify-content-start">
19
- <%= f.submit nil, class: 'btn btn-primary' %>
20
- <button type="button" class="btn btn-link" data-dismiss="modal" data-bs-dismiss="modal"><%= t :cancel %></button>
21
- </div>
22
- </div>
23
- <% end %>
24
- </div>
25
- </div>
1
+ <%= render Spotlight::SaveSearchComponent.new %>
@@ -1,3 +1,3 @@
1
1
  <% if current_exhibit.main_about_page %>
2
- <li class="nav-item <%= "active" if on_about_page? %>"><%= link_to navigation.label_or_default, [spotlight, current_exhibit, current_exhibit.main_about_page], class: 'nav-link' %></li>
2
+ <%= render Spotlight::Engine.config.spotlight.header_navigation_link_component.new(active: on_about_page?, label: navigation.label_or_default, path: [spotlight, current_exhibit, current_exhibit.main_about_page]) %>
3
3
  <% end %>
@@ -1,3 +1,3 @@
1
1
  <% if current_exhibit.browse_categories? %>
2
- <li class="nav-item <%= "active" if on_browse_page? %>"><%= link_to navigation.label_or_default, spotlight.exhibit_browse_index_path(current_exhibit), class: 'nav-link' %></li>
2
+ <%= render Spotlight::Engine.config.spotlight.header_navigation_link_component.new(active: on_browse_page?, label: navigation.label_or_default, path: spotlight.exhibit_browse_index_path(current_exhibit)) %>
3
3
  <% end %>
@@ -10,6 +10,9 @@
10
10
  </ul>
11
11
  </li>
12
12
  <% else %>
13
- <li class="nav-item <%= "active" if current_page?(url_for([spotlight, published_top_level_feature_pages.first.exhibit, published_top_level_feature_pages.first])) %>"><%= link_to published_top_level_feature_pages.first.title, [spotlight, published_top_level_feature_pages.first.exhibit, published_top_level_feature_pages.first], class: 'nav-link' %></li>
13
+ <%= render Spotlight::Engine.config.spotlight.header_navigation_link_component.new(active: current_page?(url_for([spotlight, published_top_level_feature_pages.first.exhibit, published_top_level_feature_pages.first])),
14
+ label: published_top_level_feature_pages.first.title,
15
+ path: [spotlight, published_top_level_feature_pages.first.exhibit, published_top_level_feature_pages.first]) %>
16
+
14
17
  <% end %>
15
18
  <% end %>
@@ -55,10 +55,4 @@
55
55
  </tr>
56
56
  <% end %>
57
57
  </tbody>
58
- </table>
59
-
60
- <% unless params[:show_all] || @pages.length < @limit %>
61
- <%= link_to '?show_all=true', class: 'ml-3' do %>
62
- Show all<%= blacklight_icon('chevron_right') %>
63
- <% end %>
64
- <% end %>
58
+ </table>
@@ -53,7 +53,7 @@
53
53
  <div class="mb-4">
54
54
  <h3 class="instructions"><%= t :'.admins_curators' %></h3>
55
55
  <div id="admins_curators" class="card card-body bg-light">
56
- <div class='btn-toolbar float-right float-end'>
56
+ <div class='btn-toolbar float-right align-self-end'>
57
57
  <button class="btn btn-sm btn-secondary copy-email-addresses" data-clipboard-target="#admins_curators">
58
58
  <%= t('.copy') %>
59
59
  </button>
@@ -87,7 +87,7 @@
87
87
  data: { method: :delete, turbo_method: :delete },
88
88
  class: 'btn btn-sm btn-danger') unless user == current_user %>
89
89
  <% else %>
90
- <%= link_to(t('.update'), admin_user_path(user),
90
+ <%= link_to(t('.update'), admin_user_path(user),
91
91
  data: { method: :patch, turbo_method: :patch },
92
92
  class: 'btn btn-sm btn-secondary') %>
93
93
  <% end %>
@@ -16,14 +16,24 @@
16
16
  <div>
17
17
  <%= t :'.view.show' %>
18
18
  </div>
19
- <%= select_deselect_button %>
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>
20
25
  </th>
21
26
  <% available_view_fields.keys.each do |type| %>
22
27
  <th class="text-center">
23
28
  <div>
24
29
  <%= t :".view.#{type}", default: t("blacklight.search.view.#{type}", default: type.to_s.humanize.titleize) %>
25
30
  </div>
26
- <%= select_deselect_button %>
31
+ <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 %>
36
+ </div>
27
37
  </th>
28
38
  <% end %>
29
39
  <th class="text-center"><%= t :'.type_label' %></th>
@@ -4,9 +4,7 @@
4
4
  <%= hidden_field_tag :language, @language %>
5
5
 
6
6
  <div class='translation-basic-settings'>
7
- <h2 class='translation-subheading'>
8
- <%= t('.basic_settings.label') %>
9
- </h2>
7
+ <%= render Spotlight::Translations::SubheadingComponent.new(key: 'general.basic_settings.label') %>
10
8
 
11
9
  <% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "#{current_exhibit.slug}.title", locale: @language) %>
12
10
  <%= f.fields_for :translations, translation do |translation_fields| %>
@@ -73,9 +71,7 @@
73
71
  <% end %>
74
72
  </div>
75
73
  <div class='translation-main-menu'>
76
- <h2 class='translation-subheading'>
77
- <%= t('.main_menu.label') %>
78
- </h2>
74
+ <%= render Spotlight::Translations::SubheadingComponent.new(key: 'general.main_menu.label') %>
79
75
 
80
76
  <% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "spotlight.curation.nav.home", locale: @language) %>
81
77
  <%= f.fields_for :translations, translation do |translation_fields| %>
@@ -31,9 +31,7 @@
31
31
 
32
32
  <% if current_exhibit.custom_fields.any? %>
33
33
  <div class='translation-exhibit-specific-fields'>
34
- <h2 class='translation-subheading'>
35
- <%= t('.exhibit_specific_fields.label') %>
36
- </h2>
34
+ <%= render Spotlight::Translations::SubheadingComponent.new(key: 'metadata.exhibit_specific_fields.label') %>
37
35
 
38
36
  <% current_exhibit.custom_fields.each do |custom_field| %>
39
37
  <% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "blacklight.search.fields.#{custom_field.field}", locale: @language) %>
@@ -3,17 +3,14 @@
3
3
 
4
4
  <%= bootstrap_form_for @exhibit, url: polymorphic_path([:update_all, @exhibit, :pages]), layout: :horizontal, control_col: 'col-sm-10', html: {:'data-form-observer' => true} do |f| %>
5
5
  <div class="translation-home-page-settings">
6
- <h2 class="translation-subheading">
7
- <%= t('.home_page.label') %>
8
- </h2>
6
+ <%= render Spotlight::Translations::SubheadingComponent.new(key: 'pages.home_page.label') %>
7
+
9
8
  <%= render 'pages_table', pages: [current_exhibit.home_page], f: f %>
10
9
  </div>
11
10
 
12
11
  <% if current_exhibit.feature_pages.any? %>
13
12
  <div class="translation-feature-page-settings">
14
- <h2 class="translation-subheading">
15
- <%= t('.feature_pages.label') %>
16
- </h2>
13
+ <%= render Spotlight::Translations::SubheadingComponent.new(key: 'pages.feature_pages.label') %>
17
14
 
18
15
  <%= render 'pages_table', pages: current_exhibit.feature_pages.for_default_locale, f: f %>
19
16
  </div>
@@ -21,9 +18,7 @@
21
18
 
22
19
  <% if current_exhibit.about_pages.any? %>
23
20
  <div class="translation-about-page-settings">
24
- <h2 class="translation-subheading">
25
- <%= t('.about_pages.label') %>
26
- </h2>
21
+ <%= render Spotlight::Translations::SubheadingComponent.new(key: 'pages.about_pages.label') %>
27
22
 
28
23
  <%= render 'pages_table', pages: current_exhibit.about_pages.for_default_locale, f: f %>
29
24
  </div>
@@ -5,9 +5,7 @@
5
5
  <%= hidden_field_tag :tab, 'search_fields', id: nil %>
6
6
 
7
7
  <div class='translation-field-based-search-fields'>
8
- <h2 class='translation-subheading'>
9
- <%= t('.field_based_search_fields.label') %>
10
- </h2>
8
+ <%= render Spotlight::Translations::SubheadingComponent.new(key: 'search_fields.field_based_search_fields.label') %>
11
9
 
12
10
  <% current_exhibit.blacklight_config.search_fields.select { |_, config| config.if }.each do |key, search_config| %>
13
11
  <% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "blacklight.search.fields.search.#{key}", locale: @language) %>
@@ -35,9 +33,7 @@
35
33
  </div>
36
34
 
37
35
  <div class='translation-facet-fields'>
38
- <h2 class='translation-subheading'>
39
- <%= t('.facet_fields.label') %>
40
- </h2>
36
+ <%= render Spotlight::Translations::SubheadingComponent.new(key: 'search_fields.facet_fields.label') %>
41
37
 
42
38
  <% current_exhibit.blacklight_config.facet_fields.each do |key, facet_config| %>
43
39
  <% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "blacklight.search.fields.facet.#{key}", locale: @language) %>
@@ -65,9 +61,7 @@
65
61
  </div>
66
62
 
67
63
  <div class='translation-sort-fields'>
68
- <h2 class='translation-subheading'>
69
- <%= t('.sort_fields.label') %>
70
- </h2>
64
+ <%= render Spotlight::Translations::SubheadingComponent.new(key: 'search_fields.sort_fields.label') %>
71
65
 
72
66
  <% current_exhibit.blacklight_config.sort_fields.each do |key, sort_config| %>
73
67
  <% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "blacklight.search.fields.sort.#{key}", locale: @language) %>
@@ -720,7 +720,7 @@ en:
720
720
  header: Metadata
721
721
  instructions: Select metadata fields to display on each type of page. Select a field name to edit its display label. Drag and drop fields to specify the order in which they are displayed.
722
722
  order_header: Display and order metadata fields
723
- select_all: Select all
723
+ select_all: All
724
724
  type_label: Type
725
725
  view:
726
726
  show: Item details
@@ -1,5 +1,4 @@
1
1
  @import 'bootstrap-tagsinput';
2
- @import 'spotlight/variables_bootstrap';
3
2
  @import 'bootstrap';
4
3
  @import 'sir-trevor/main';
5
4
  @import 'leaflet';
@@ -188,6 +188,13 @@ module Spotlight
188
188
  end
189
189
  end
190
190
 
191
+ initializer 'components.initialize' do
192
+ ActiveSupport::Reloader.to_prepare do
193
+ Spotlight::Engine.config.spotlight = OpenStruct.new
194
+ Spotlight::Engine.config.spotlight.header_navigation_link_component = Spotlight::HeaderNavigationLinkComponent
195
+ end
196
+ end
197
+
191
198
  # After creating a property for your site on Google Analytics, you need to:
192
199
  # a) Enable Google Analytics API in https://console.cloud.google.com/
193
200
  # b) generate and download the JSON key and make it accessible to your application
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spotlight
4
- VERSION = '4.5.0'
4
+ VERSION = '4.6.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: 4.5.0
4
+ version: 4.6.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: 2024-12-04 00:00:00.000000000 Z
14
+ date: 2024-12-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activejob-status
@@ -897,7 +897,6 @@ files:
897
897
  - app/assets/stylesheets/spotlight/_uploaded_items_block.scss
898
898
  - app/assets/stylesheets/spotlight/_utilities.scss
899
899
  - app/assets/stylesheets/spotlight/_variables.scss
900
- - app/assets/stylesheets/spotlight/_variables_bootstrap.scss
901
900
  - app/assets/stylesheets/spotlight/_view_larger.scss
902
901
  - app/assets/stylesheets/spotlight/browse_group_categories_block.scss
903
902
  - app/assets/stylesheets/spotlight/typeahead.scss
@@ -922,6 +921,8 @@ files:
922
921
  - app/components/spotlight/analytics/dashboard_component.rb
923
922
  - app/components/spotlight/breadcrumbs_component.html.erb
924
923
  - app/components/spotlight/breadcrumbs_component.rb
924
+ - app/components/spotlight/bulk_action_component.html.erb
925
+ - app/components/spotlight/bulk_action_component.rb
925
926
  - app/components/spotlight/document_admin_table_component.html.erb
926
927
  - app/components/spotlight/document_admin_table_component.rb
927
928
  - app/components/spotlight/document_component.rb
@@ -931,11 +932,17 @@ files:
931
932
  - app/components/spotlight/exhibit_navbar_component.rb
932
933
  - app/components/spotlight/header_component.html.erb
933
934
  - app/components/spotlight/header_component.rb
935
+ - app/components/spotlight/header_navigation_link_component.html.erb
936
+ - app/components/spotlight/header_navigation_link_component.rb
934
937
  - app/components/spotlight/icon_component.rb
938
+ - app/components/spotlight/save_search_component.html.erb
939
+ - app/components/spotlight/save_search_component.rb
935
940
  - app/components/spotlight/solr_document_legacy_embed_component.html.erb
936
941
  - app/components/spotlight/solr_document_legacy_embed_component.rb
937
942
  - app/components/spotlight/tag_list_form_component.html.erb
938
943
  - app/components/spotlight/tag_list_form_component.rb
944
+ - app/components/spotlight/translations/subheading_component.html.erb
945
+ - app/components/spotlight/translations/subheading_component.rb
939
946
  - app/controllers/concerns/spotlight/base.rb
940
947
  - app/controllers/concerns/spotlight/catalog.rb
941
948
  - app/controllers/concerns/spotlight/config.rb
@@ -1,7 +0,0 @@
1
- // $font-size-base: 14px;
2
- // $h1-font-size: floor(($font-size-base * 2.15)) !default; // ~30px
3
- // $h2-font-size: floor(($font-size-base * 1.7)) !default; // ~24px
4
- // $h3-font-size: ceil(($font-size-base * 1.53)) !default; // ~201px
5
- // $h4-font-size: ceil(($font-size-base * 1.21)) !default; // ~17px
6
- // $h5-font-size: $font-size-base !default;
7
- // $h6-font-size: ceil(($font-size-base * 0.85)) !default; // ~12px