blacklight-spotlight 4.4.0 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) 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/assets/stylesheets/spotlight/_browse.scss +3 -11
  9. data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +4 -2
  10. data/app/components/spotlight/bulk_action_component.html.erb +8 -0
  11. data/app/components/spotlight/bulk_action_component.rb +20 -0
  12. data/app/components/spotlight/header_navigation_link_component.html.erb +1 -0
  13. data/app/components/spotlight/header_navigation_link_component.rb +14 -0
  14. data/app/components/spotlight/save_search_component.html.erb +25 -0
  15. data/app/components/spotlight/save_search_component.rb +25 -0
  16. data/app/components/spotlight/translations/subheading_component.html.erb +3 -0
  17. data/app/components/spotlight/translations/subheading_component.rb +17 -0
  18. data/app/controllers/spotlight/accessibility_controller.rb +3 -8
  19. data/app/helpers/spotlight/application_helper.rb +6 -7
  20. data/app/helpers/spotlight/main_app_helpers.rb +1 -1
  21. data/app/javascript/spotlight/admin/blacklight_configuration.js +18 -21
  22. data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +2 -2
  23. data/app/models/spotlight/blacklight_configuration.rb +2 -1
  24. data/app/models/spotlight/page_configurations.rb +2 -1
  25. data/app/views/catalog/_bulk_actions.html.erb +1 -10
  26. data/app/views/catalog/_save_search.html.erb +1 -25
  27. data/app/views/layouts/spotlight/base.html.erb +1 -1
  28. data/app/views/shared/_about_navbar.html.erb +1 -1
  29. data/app/views/shared/_browse_navbar.html.erb +1 -1
  30. data/app/views/shared/_curated_features_navbar.html.erb +4 -1
  31. data/app/views/shared/_masthead.html.erb +1 -1
  32. data/app/views/spotlight/accessibility/alt_text.html.erb +1 -7
  33. data/app/views/spotlight/admin_users/index.html.erb +2 -2
  34. data/app/views/spotlight/bulk_updates/_upload.html.erb +1 -1
  35. data/app/views/spotlight/custom_fields/form_group/_text.html.erb +1 -1
  36. data/app/views/spotlight/custom_fields/form_group/_vocab.html.erb +1 -1
  37. data/app/views/spotlight/feature_pages/_header.html.erb +2 -2
  38. data/app/views/spotlight/metadata_configurations/_metadata_field.html.erb +7 -0
  39. data/app/views/spotlight/metadata_configurations/edit.html.erb +13 -2
  40. data/app/views/spotlight/shared/_honeypot_field.html.erb +2 -2
  41. data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -1
  42. data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +1 -1
  43. data/app/views/spotlight/sir_trevor/blocks/_featured_pages_block.html.erb +1 -1
  44. data/app/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb +1 -1
  45. data/app/views/spotlight/translations/_general.html.erb +2 -6
  46. data/app/views/spotlight/translations/_import.html.erb +1 -1
  47. data/app/views/spotlight/translations/_metadata.html.erb +1 -3
  48. data/app/views/spotlight/translations/_pages.html.erb +4 -9
  49. data/app/views/spotlight/translations/_search_fields.html.erb +3 -9
  50. data/config/locales/spotlight.en.yml +5 -1
  51. data/lib/generators/spotlight/templates/spotlight.scss +0 -1
  52. data/lib/spotlight/engine.rb +7 -0
  53. data/lib/spotlight/version.rb +1 -1
  54. metadata +10 -3
  55. 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
 
@@ -48,12 +48,6 @@ $image-overlay-max-height: 300px;
48
48
 
49
49
  .browse-landing {
50
50
  text-align: center;
51
- // Placeholder for vertically alignment - might already be available from use in another feature
52
- %vertical-align {
53
- position: relative;
54
- top: 50%;
55
- transform: translateY(-50%);
56
- }
57
51
 
58
52
  .category {
59
53
  margin-bottom: $spacer;
@@ -77,18 +71,16 @@ $image-overlay-max-height: 300px;
77
71
  bottom: 0;
78
72
  left: 0;
79
73
  width: 100%;
80
- height: 100%;
81
- background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .2), rgba(0, 0, 0, .4));
74
+ background: linear-gradient(0deg, rgba(46, 45, 41, 0.7) 70%, rgba(46, 45, 41, 0) 100%);
82
75
  color: $white;
83
- padding: 8%;
76
+ padding: 50px 20px 20px 20px;
84
77
  text-align: center;
85
- text-shadow: 0 1px 0 $black;
78
+
86
79
  // prevents potential blur caused by the vertical-align technique
87
80
  transform-style: preserve-3d;
88
81
 
89
82
  .browse-category-title {
90
83
  font-size: $h3-font-size;
91
- @extend %vertical-align;
92
84
 
93
85
  .category-subtitle {
94
86
  display: block;
@@ -61,12 +61,14 @@ $xl-sidebar-five-tile-width: ($container-xl-sidebar * 0.2) - $tile-margin;
61
61
  position: relative;
62
62
 
63
63
  .category-caption {
64
- bottom: 16px; // assumes default font-size of 16px, using browser default of 1 rem == 16px
64
+ bottom: 0px;
65
65
  color: $featured-browse-category-caption-color;
66
66
  position: absolute;
67
67
  text-align: center;
68
- text-shadow: 0 1px 0 $black;
69
68
  width: 100%;
69
+ padding: 35px 15px 15px;
70
+ background: linear-gradient(0deg, rgba(46, 45, 41, 0.7) 70%, rgba(46, 45, 41, 0) 100%);
71
+ border-radius: $border-radius-lg;
70
72
  }
71
73
 
72
74
  .category-title {
@@ -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
@@ -7,17 +7,10 @@ module Spotlight
7
7
  before_action :authenticate_user!
8
8
  load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
9
9
 
10
- include Spotlight::Base
11
- include Spotlight::SearchHelper
12
-
13
10
  def alt_text
14
- authorize! :curate, @exhibit
15
-
16
- @limit = 5
17
11
  # Sort by newest except for the homepage, which is always first
18
12
  pages_with_alt = @exhibit.pages.order(Arel.sql('id = 1 DESC, created_at DESC')).select { |elem| elem.content.any?(&:alt_text?) }
19
- pages = params[:show_all] ? pages_with_alt : pages_with_alt.first(@limit)
20
- @pages = pages.map { |page| get_alt_info(page) }
13
+ @pages = pages_with_alt.map { |page| get_alt_info(page) }
21
14
  @has_alt_text = @pages.sum { |page| page[:has_alt_text] }
22
15
  @total_alt_items = @pages.sum { |page| page[:can_have_alt_text] }
23
16
 
@@ -30,6 +23,8 @@ module Spotlight
30
23
  can_have_alt_text = 0
31
24
  has_alt_text = 0
32
25
  page.content.each do |content|
26
+ next unless content.alt_text?
27
+
33
28
  content.item&.each_value do |item|
34
29
  can_have_alt_text += 1
35
30
  has_alt_text += 1 if item['alt_text'].present? || item['decorative'].present?
@@ -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()}
@@ -253,7 +253,7 @@ module Spotlight
253
253
  original_config = blacklight_config.index_fields[custom_field.field] || {}
254
254
  field = Blacklight::Configuration::IndexField.new original_config.merge(
255
255
  custom_field.configuration.merge(
256
- key: custom_field.field, field: custom_field.solr_field, custom_field: true
256
+ key: custom_field.field, field: custom_field.solr_field, custom_field: true, type: 'custom-field'
257
257
  )
258
258
  )
259
259
  [custom_field.field, field]
@@ -358,6 +358,7 @@ module Spotlight
358
358
 
359
359
  options = f.blacklight_options || {}
360
360
  options[:label] = f.label if f.label
361
+ options[:type] = 'uploaded'
361
362
 
362
363
  config.add_index_field key, options
363
364
  end
@@ -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 %>
@@ -36,7 +36,7 @@
36
36
  <%= render partial: 'shared/masthead' %>
37
37
  <%= content_for?(:header_content) ? yield(:header_content) : "" %>
38
38
 
39
- <main id="main-container" class="<%= container_classes %>" role="main" aria-label="<%= t('blacklight.main.aria.main_container') %>">
39
+ <main id="main-container" class="<%= container_classes %>" aria-label="<%= t('blacklight.main.aria.main_container') %>">
40
40
  <%= content_for(:container_header) %>
41
41
 
42
42
  <%= render partial: 'shared/flash_msg', layout: 'shared/flash_messages' %>
@@ -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 %>
@@ -14,7 +14,7 @@
14
14
  <% end %>
15
15
  <% end %>
16
16
 
17
- <header class="masthead <%= 'image-masthead' if current_masthead %> <%= 'resource-masthead' if resource_masthead? %>" role="banner">
17
+ <header class="masthead <%= 'image-masthead' if current_masthead %> <%= 'resource-masthead' if resource_masthead? %>">
18
18
  <% if current_masthead %>
19
19
  <span class='background-container' style="background-image: url('<%= current_masthead.iiif_url %>')"></span>
20
20
  <span class='background-container-gradient'></span>
@@ -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 %>
@@ -9,7 +9,7 @@
9
9
  <div class="input-group">
10
10
  <%= file_field_tag :file, class: 'form-control', accept: '.csv,text/csv', 'aria-described-by': 'bulk-update-form-help' %>
11
11
  <div class="input-group-append">
12
- <%= f.submit t('.submit'), class: 'btn btn-primary' %>
12
+ <%= f.submit t('.submit'), class: 'btn btn-primary rounded-0 rounded-end' %>
13
13
  </div>
14
14
  </div>
15
15
  </div>
@@ -18,6 +18,6 @@
18
18
  <%= f.text_area_without_bootstrap field.slug, multiple: field.is_multiple?, value: nil, class: "form-control field-#{field.slug}" %>
19
19
  </div>
20
20
  <% end %>
21
- <%= content_tag :button, t('helpers.action.add_another'), class: 'btn btn-info btn-sm h-100', data: { action: 'add-another', template_id: "spotlight-field-template-#{field.slug}" } %>
21
+ <%= content_tag :button, t('helpers.action.add_another'), class: 'btn btn-info btn-sm col-auto h-100', data: { action: 'add-another', template_id: "spotlight-field-template-#{field.slug}" } %>
22
22
  <% end %>
23
23
  </div>
@@ -18,6 +18,6 @@
18
18
  <%= f.text_field_without_bootstrap field.slug, multiple: field.is_multiple?, value: nil, class: "form-control field-#{field.slug}" %>
19
19
  </div>
20
20
  <% end %>
21
- <%= content_tag :button, t('helpers.action.add_another'), class: 'btn btn-info btn-sm h-100', data: { action: 'add-another', template_id: "spotlight-field-template-#{field.slug}" } %>
21
+ <%= content_tag :button, t('helpers.action.add_another'), class: 'btn btn-info btn-sm col-auto h-100', data: { action: 'add-another', template_id: "spotlight-field-template-#{field.slug}" } %>
22
22
  <% end %>
23
23
  </div>
@@ -2,8 +2,8 @@
2
2
  <% page = p.object %>
3
3
  <div class="home_page">
4
4
  <h2><%= t('spotlight.pages.index.feature_pages.home_pages_header') %></h2>
5
- <div class="card d-flex">
6
- <div class="card-body d-flex bg-light page main">
5
+ <div class="card d-flex bg-light">
6
+ <div class="card-body d-flex page main">
7
7
  <div class="flex-grow-1 align-self-center">
8
8
  <%= p.hidden_field :id, value: page.id , class: 'form-control form-control-sm' %>
9
9
  <h3 class="h6 card-title" data-in-place-edit-target=".edit-in-place" data-in-place-edit-field-target="[data-edit-field-target='true']">
@@ -27,5 +27,12 @@
27
27
  <%= field.check_box_without_bootstrap type, checked: config.send(type), disabled: !config.immutable.send(type).nil?, hide_label: true %>
28
28
  </td>
29
29
  <% end %>
30
+ <td class="text-center">
31
+ <% if config.type %>
32
+ <%= t(:".types.#{config.type}") %>
33
+ <% end %>
34
+ </td>
35
+
36
+
30
37
  <% end %>
31
38
  </tr>
@@ -16,16 +16,27 @@
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 %>
39
+ <th class="text-center"><%= t :'.type_label' %></th>
29
40
  </tr>
30
41
  </thead>
31
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=" ">
@@ -1,4 +1,4 @@
1
- <span style="display:none;visibility:hidden;">
1
+ <div style="display:none;visibility:hidden;">
2
2
  <% honeypot_field_name = Spotlight::Engine.config.spambot_honeypot_email_field %>
3
3
  <%= f.email_field honeypot_field_name, label: t(:'spotlight.shared.report_a_problem.honeypot_field_explanation') %>
4
- </span>
4
+ </div>
@@ -5,7 +5,7 @@
5
5
  <% browse_block.searches.each_with_index do |search, index| %>
6
6
  <div class="box category-<%= (index + 1) %>">
7
7
  <%= link_to spotlight.exhibit_browse_path(search.exhibit, search) do %>
8
- <div class="browse-category" style='background-image: linear-gradient(rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5)), url("<%= search.thumbnail.iiif_url if search.thumbnail %>")'>
8
+ <div class="browse-category" style='background-image: url("<%= search.thumbnail.iiif_url if search.thumbnail %>")'>
9
9
  <div class="category-caption">
10
10
  <p class="category-title">
11
11
  <%= search.title %>
@@ -23,7 +23,7 @@
23
23
  <% group.searches.published.each_with_index do |search, index| %>
24
24
  <div class="box category-1 justify-content-center justify-content-md-space-around">
25
25
  <%= link_to spotlight.exhibit_browse_group_path(current_exhibit, group, search), class: 'justify-content-center' do %>
26
- <div class="browse-category" style='background-image: linear-gradient(rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5)), url("<%= search.thumbnail.iiif_url if search.thumbnail %>")'>
26
+ <div class="browse-category" style='background-image: url("<%= search.thumbnail.iiif_url if search.thumbnail %>")'>
27
27
  <div class="category-caption">
28
28
  <p class="category-title">
29
29
  <%= search.title %>