blacklight-spotlight 4.7.1 → 5.0.0.pre.alpha2

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 (157) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -12
  3. data/Rakefile +8 -1
  4. data/app/assets/javascripts/spotlight/application.js +0 -1
  5. data/app/assets/javascripts/spotlight/spotlight.esm.js +3621 -3847
  6. data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
  7. data/app/assets/javascripts/spotlight/spotlight.js +3620 -3852
  8. data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
  9. data/app/assets/stylesheets/spotlight/_accessibility.scss +0 -9
  10. data/app/assets/stylesheets/spotlight/_autocomplete.scss +49 -0
  11. data/app/assets/stylesheets/spotlight/_blacklight_configuration.scss +0 -1
  12. data/app/assets/stylesheets/spotlight/_blacklight_overrides.scss +1 -6
  13. data/app/assets/stylesheets/spotlight/_browse.scss +2 -2
  14. data/app/assets/stylesheets/spotlight/_catalog.scss +40 -41
  15. data/app/assets/stylesheets/spotlight/_curation.scss +1 -1
  16. data/app/assets/stylesheets/spotlight/_exhibit_admin.scss +7 -0
  17. data/app/assets/stylesheets/spotlight/_exhibits_index.scss +8 -5
  18. data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +3 -3
  19. data/app/assets/stylesheets/spotlight/_header.scss +13 -0
  20. data/app/assets/stylesheets/spotlight/_mixins.scss +3 -4
  21. data/app/assets/stylesheets/spotlight/_nestable.scss +2 -12
  22. data/app/assets/stylesheets/spotlight/_pages.scss +11 -9
  23. data/app/assets/stylesheets/spotlight/_report_a_problem.scss +1 -3
  24. data/app/assets/stylesheets/spotlight/_sir-trevor_overrides.scss +2 -2
  25. data/app/assets/stylesheets/spotlight/_spotlight.scss +2 -1
  26. data/app/assets/stylesheets/spotlight/_tag_selector.scss +34 -0
  27. data/app/assets/stylesheets/spotlight/_variables.scss +0 -8
  28. data/app/components/spotlight/analytics/dashboard_component.html.erb +3 -3
  29. data/app/components/spotlight/blocks/heading_block_component.erb +2 -0
  30. data/app/components/spotlight/blocks/heading_block_component.rb +36 -0
  31. data/app/components/spotlight/breadcrumbs_component.html.erb +13 -19
  32. data/app/components/spotlight/bulk_action_component.rb +1 -1
  33. data/app/components/spotlight/document_component.rb +1 -1
  34. data/app/components/spotlight/save_search_component.rb +1 -1
  35. data/app/components/spotlight/select_image_component.html.erb +17 -0
  36. data/app/components/spotlight/select_image_component.rb +24 -0
  37. data/app/components/spotlight/skip_link_component.rb +16 -0
  38. data/app/components/spotlight/tag_selector_component.html.erb +40 -0
  39. data/app/components/spotlight/tag_selector_component.rb +41 -0
  40. data/app/components/spotlight/tag_selector_component.yml +6 -0
  41. data/app/components/spotlight/title_component.html.erb +8 -0
  42. data/app/components/spotlight/title_component.rb +22 -0
  43. data/app/controllers/spotlight/accessibility_controller.rb +2 -2
  44. data/app/controllers/spotlight/catalog_controller.rb +7 -2
  45. data/app/controllers/spotlight/contact_email_controller.rb +8 -2
  46. data/app/controllers/spotlight/languages_controller.rb +9 -4
  47. data/app/helpers/spotlight/application_helper.rb +7 -0
  48. data/app/helpers/spotlight/crop_helper.rb +4 -0
  49. data/app/helpers/spotlight/meta_helper.rb +59 -36
  50. data/app/javascript/spotlight/admin/blacklight_configuration.js +1 -1
  51. data/app/javascript/spotlight/admin/block_mixins/autocompleteable.js +70 -34
  52. data/app/javascript/spotlight/admin/blocks/block.js +1 -0
  53. data/app/javascript/spotlight/admin/blocks/browse_block.js +8 -12
  54. data/app/javascript/spotlight/admin/blocks/browse_group_categories_block.js +14 -18
  55. data/app/javascript/spotlight/admin/blocks/pages_block.js +6 -10
  56. data/app/javascript/spotlight/admin/blocks/resources_block.js +33 -15
  57. data/app/javascript/spotlight/admin/blocks/solr_documents_base_block.js +11 -6
  58. data/app/javascript/spotlight/admin/blocks/solr_documents_embed_block.js +1 -0
  59. data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +4 -3
  60. data/app/javascript/spotlight/admin/copy_email_addresses.js +2 -0
  61. data/app/javascript/spotlight/admin/crop.js +45 -17
  62. data/app/javascript/spotlight/admin/croppable.js +8 -1
  63. data/app/javascript/spotlight/admin/croppable_modal.js +68 -0
  64. data/app/javascript/spotlight/admin/exhibits.js +15 -10
  65. data/app/javascript/spotlight/admin/form_observer.js +1 -1
  66. data/app/javascript/spotlight/admin/index.js +0 -10
  67. data/app/javascript/spotlight/admin/locks.js +15 -5
  68. data/app/javascript/spotlight/admin/pages.js +1 -1
  69. data/app/javascript/spotlight/admin/search_typeahead.js +62 -55
  70. data/app/javascript/spotlight/admin/spotlight_nestable.js +173 -50
  71. data/app/javascript/spotlight/admin/visibility_toggle.js +1 -11
  72. data/app/javascript/spotlight/controllers/index.js +8 -0
  73. data/app/javascript/spotlight/controllers/tag_selector_controller.js +203 -0
  74. data/app/javascript/spotlight/core.js +4 -6
  75. data/app/javascript/spotlight/index.js +2 -0
  76. data/app/javascript/spotlight/user/browse_group_categories.js +2 -0
  77. data/app/javascript/spotlight/user/carousel.js +3 -1
  78. data/app/javascript/spotlight/user/index.js +0 -2
  79. data/app/javascript/spotlight/user/zpr_links.js +2 -0
  80. data/app/models/sir_trevor_rails/block.rb +4 -5
  81. data/app/models/sir_trevor_rails/blocks/solr_documents_block.rb +1 -1
  82. data/app/models/sir_trevor_rails/blocks/solr_documents_embed_block.rb +1 -1
  83. data/app/models/sir_trevor_rails/blocks/uploaded_items_block.rb +1 -1
  84. data/app/models/spotlight/page_configurations.rb +1 -1
  85. data/app/services/spotlight/exhibit_import_export_service.rb +2 -2
  86. data/app/views/catalog/_add_tags.html.erb +2 -2
  87. data/app/views/catalog/_change_visibility.html.erb +1 -1
  88. data/app/views/catalog/_remove_tags.html.erb +2 -2
  89. data/app/views/layouts/spotlight/base.html.erb +24 -13
  90. data/app/views/layouts/spotlight/spotlight.html.erb +6 -6
  91. data/app/views/shared/_masthead.html.erb +4 -31
  92. data/app/views/shared/_site_sidebar.html.erb +1 -1
  93. data/app/views/shared/_user_util_links.html.erb +3 -1
  94. data/app/views/spotlight/accessibility/alt_text.html.erb +2 -2
  95. data/app/views/spotlight/admin_users/index.html.erb +3 -3
  96. data/app/views/spotlight/appearances/edit.html.erb +1 -1
  97. data/app/views/spotlight/browse/_search_box.html.erb +8 -8
  98. data/app/views/spotlight/browse/show.html.erb +1 -1
  99. data/app/views/spotlight/bulk_updates/_download.html.erb +1 -1
  100. data/app/views/spotlight/bulk_updates/_upload.html.erb +1 -1
  101. data/app/views/spotlight/catalog/_admin_header.html.erb +1 -1
  102. data/app/views/spotlight/catalog/_edit_default.html.erb +2 -1
  103. data/app/views/spotlight/catalog/select_image.html.erb +1 -0
  104. data/app/views/spotlight/contacts/_form.html.erb +1 -1
  105. data/app/views/spotlight/exhibits/_contact.html.erb +5 -6
  106. data/app/views/spotlight/exhibits/_delete.html.erb +1 -1
  107. data/app/views/spotlight/exhibits/_languages.html.erb +3 -2
  108. data/app/views/spotlight/featured_images/_form.html.erb +6 -2
  109. data/app/views/spotlight/featured_images/_upload_form.html.erb +1 -1
  110. data/app/views/spotlight/metadata_configurations/_metadata_field.html.erb +1 -1
  111. data/app/views/spotlight/metadata_configurations/edit.html.erb +6 -6
  112. data/app/views/spotlight/pages/show.html.erb +1 -1
  113. data/app/views/spotlight/resources/csv_upload/_form.html.erb +1 -1
  114. data/app/views/spotlight/resources/upload/_form.html.erb +1 -1
  115. data/app/views/spotlight/roles/index.html.erb +1 -1
  116. data/app/views/spotlight/searches/_form.html.erb +1 -1
  117. data/app/views/spotlight/shared/_dd3_item.html.erb +1 -1
  118. data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +1 -1
  119. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +1 -1
  120. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +1 -1
  121. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +1 -1
  122. data/app/views/spotlight/tags/index.html.erb +2 -3
  123. data/app/views/spotlight/translations/_import.html.erb +2 -2
  124. data/config/importmap.rb +5 -0
  125. data/config/locales/spotlight.en.yml +2 -0
  126. data/config/routes.rb +5 -3
  127. data/lib/generators/spotlight/assets/generator_common_utilities.rb +36 -0
  128. data/lib/generators/spotlight/assets/importmap_generator.rb +87 -0
  129. data/lib/generators/spotlight/assets/propshaft_generator.rb +96 -0
  130. data/lib/generators/spotlight/assets_generator.rb +22 -0
  131. data/lib/generators/spotlight/install_generator.rb +8 -36
  132. data/lib/generators/spotlight/scaffold_resource_generator.rb +1 -1
  133. data/lib/generators/spotlight/templates/assets/spotlight.scss +6 -0
  134. data/lib/generators/spotlight/templates/javascript/jquery-shim.js +1 -0
  135. data/lib/spotlight/engine.rb +7 -6
  136. data/lib/spotlight/version.rb +1 -1
  137. data/spec/support/features/capybara_wait_metadata_helper.rb +13 -0
  138. data/spec/support/features/test_features_helpers.rb +16 -30
  139. data/vendor/assets/javascripts/tiny-slider.js +3 -0
  140. metadata +37 -87
  141. data/app/assets/stylesheets/spotlight/#_accessibility.scss# +0 -12
  142. data/app/javascript/spotlight/admin/checkbox_submit.js +0 -75
  143. data/app/javascript/spotlight/admin/exhibit_tag_autocomplete.js +0 -39
  144. data/app/javascript/spotlight/user/report_a_problem.js +0 -30
  145. data/app/views/spotlight/browse/_tophat.html.erb +0 -1
  146. data/app/views/spotlight/catalog/_tophat_default.html.erb +0 -1
  147. data/app/views/spotlight/home_pages/_tophat.html.erb +0 -2
  148. data/app/views/spotlight/pages/_tophat.html.erb +0 -1
  149. data/lib/generators/spotlight/templates/spotlight.js +0 -1
  150. data/lib/generators/spotlight/templates/spotlight.scss +0 -5
  151. data/spec/support/features/capybara_default_max_wait_metadata_helper.rb +0 -20
  152. data/vendor/assets/javascripts/bootstrap-tagsinput.js +0 -530
  153. data/vendor/assets/javascripts/jquery.serializejson.js +0 -234
  154. data/vendor/assets/javascripts/nestable.js +0 -645
  155. data/vendor/assets/javascripts/sir-trevor.js +0 -23508
  156. data/vendor/assets/javascripts/typeahead.bundle.min.js +0 -7
  157. data/vendor/assets/stylesheets/bootstrap-tagsinput.css +0 -46
@@ -1,7 +1,6 @@
1
1
  import BrowseGroupCateogries from 'spotlight/user/browse_group_categories'
2
2
  import Carousel from 'spotlight/user/carousel'
3
3
  import ClearFormButton from 'spotlight/user/clear_form_button'
4
- import ReportProblem from 'spotlight/user/report_a_problem'
5
4
  import ZprLinks from 'spotlight/user/zpr_links'
6
5
 
7
6
  export default class {
@@ -9,7 +8,6 @@ export default class {
9
8
  new BrowseGroupCateogries().connect()
10
9
  new Carousel().connect()
11
10
  new ClearFormButton().connect()
12
- new ReportProblem().connect()
13
11
  new ZprLinks().connect()
14
12
  }
15
13
  }
@@ -1,3 +1,5 @@
1
+ import OpenSeadragon from 'openseadragon';
2
+
1
3
  export default class {
2
4
  connect() {
3
5
  $('.zpr-link').on('click', function() {
@@ -18,11 +18,10 @@ module SirTrevorRails
18
18
  send(:[], :format).present? ? send(:[], :format).to_sym : DEFAULT_FORMAT
19
19
  end
20
20
 
21
- def alt_text?
22
- self.class.alt_text?
23
- end
21
+ delegate :supports_alt_text?, to: :class
24
22
 
25
- def self.alt_text?
23
+ # By default we don't support alt text, but some subclasses do
24
+ def self.supports_alt_text?
26
25
  false
27
26
  end
28
27
 
@@ -33,7 +32,7 @@ module SirTrevorRails
33
32
  end
34
33
 
35
34
  def self.custom_block_type_alt_text_settings
36
- custom_block_types.index_with { |block_type| SirTrevorRails::Block.block_class(block_type).alt_text? }
35
+ custom_block_types.index_with { |block_type| SirTrevorRails::Block.block_class(block_type).supports_alt_text? }
37
36
  end
38
37
 
39
38
  def initialize(hash, parent)
@@ -13,7 +13,7 @@ module SirTrevorRails
13
13
  @solr_helper = solr_helper
14
14
  end
15
15
 
16
- def self.alt_text?
16
+ def self.supports_alt_text?
17
17
  true
18
18
  end
19
19
 
@@ -5,7 +5,7 @@ module SirTrevorRails
5
5
  ##
6
6
  # Embed documents (using a special blacklight view configuration) and text block
7
7
  class SolrDocumentsEmbedBlock < SirTrevorRails::Blocks::SolrDocumentsBlock
8
- def self.alt_text?
8
+ def self.supports_alt_text?
9
9
  false
10
10
  end
11
11
  end
@@ -12,7 +12,7 @@ module SirTrevorRails
12
12
  (item || {}).map { |_, file| file }.select { |file| file[:display].to_s == 'true' }
13
13
  end
14
14
 
15
- def self.alt_text?
15
+ def self.supports_alt_text?
16
16
  true
17
17
  end
18
18
 
@@ -70,7 +70,7 @@ module Spotlight
70
70
  end
71
71
 
72
72
  def exhibit_autocomplete_endpoint
73
- spotlight.autocomplete_exhibit_catalog_path(current_exhibit, q: '%QUERY', format: 'json')
73
+ spotlight.autocomplete_exhibit_catalog_path(current_exhibit, format: 'json')
74
74
  end
75
75
 
76
76
  def page_autocomplete_endpoint
@@ -365,7 +365,7 @@ module Spotlight
365
365
  (json[:feature_pages] || []).each do |page|
366
366
  p = exhibit.feature_pages.find_by(slug: page[:slug])
367
367
  page[:content] = p.read_attribute(:content)
368
- (page[:translated_pages]).each do |translated_page|
368
+ page[:translated_pages].each do |translated_page|
369
369
  translated_page[:content] = p.translated_page_for(translated_page[:locale]).read_attribute(:content)
370
370
  end
371
371
  end
@@ -373,7 +373,7 @@ module Spotlight
373
373
  (json[:about_pages] || []).each do |page|
374
374
  p = exhibit.about_pages.find_by(slug: page[:slug])
375
375
  page[:content] = p.read_attribute(:content)
376
- (page[:translated_pages]).each do |translated_page|
376
+ page[:translated_pages].each do |translated_page|
377
377
  translated_page[:content] = p.translated_page_for(translated_page[:locale]).read_attribute(:content)
378
378
  end
379
379
  end
@@ -14,12 +14,12 @@
14
14
  </p>
15
15
  <div class="form-group mb-3">
16
16
  <%= label_tag :tags, t(:'spotlight.bulk_actions.add_tags.label') %>
17
- <%= text_field_tag :tags, '', class: 'form-control', data: { autocomplete_tag: true, autocomplete_url: exhibit_tags_path(current_exhibit, format: 'json')} %>
17
+ <%= render Spotlight::TagSelectorComponent.new(field_name: :tags, all_tags: current_exhibit.owned_tags) %>
18
18
  </div>
19
19
  <%= render Blacklight::HiddenSearchStateComponent.new(params: search_state.params_for_search) %>
20
20
  </div>
21
21
  <div class="modal-footer d-flex flex-row-reverse justify-content-start">
22
- <%= f.submit t(:'spotlight.bulk_actions.add'), class: 'btn btn-primary', data: { confirm: t(:'spotlight.bulk_actions.confirm') } %>
22
+ <%= f.submit t(:'spotlight.bulk_actions.add'), class: 'btn btn-primary', data: { confirm: t(:'spotlight.bulk_actions.confirm'), turbo_confirm: t(:'spotlight.bulk_actions.confirm') } %>
23
23
  <button type="button" class="btn btn-link" data-dismiss="modal" data-bs-dismiss="modal"><%= t :cancel %></button>
24
24
  </div>
25
25
  </div>
@@ -26,7 +26,7 @@
26
26
  <%= render Blacklight::HiddenSearchStateComponent.new(params: search_state.params_for_search) %>
27
27
  </div>
28
28
  <div class="modal-footer d-flex flex-row-reverse justify-content-start">
29
- <%= f.submit t(:'spotlight.bulk_actions.change'), class: 'btn btn-primary', data: { confirm: t(:'spotlight.bulk_actions.confirm') } %>
29
+ <%= f.submit t(:'spotlight.bulk_actions.change'), class: 'btn btn-primary', data: { confirm: t(:'spotlight.bulk_actions.confirm'), turbo_confirm: t(:'spotlight.bulk_actions.confirm') } %>
30
30
  <button type="button" class="btn btn-link" data-dismiss="modal" data-bs-dismiss="modal"><%= t :cancel %></button>
31
31
  </div>
32
32
  </div>
@@ -23,12 +23,12 @@
23
23
 
24
24
  <div class="form-group mb-3 mt-4">
25
25
  <%= label_tag :tags, t(:'spotlight.bulk_actions.remove_tags.label') %>
26
- <%= text_field_tag :tags, '', class: 'form-control', data: { autocomplete_tag: true, autocomplete_url: exhibit_tags_path(current_exhibit, format: 'json')} %>
26
+ <%= render Spotlight::TagSelectorComponent.new(field_name: :tags, all_tags: current_exhibit.owned_tags) %>
27
27
  </div>
28
28
  <%= render Blacklight::HiddenSearchStateComponent.new(params: search_state.params_for_search) %>
29
29
  </div>
30
30
  <div class="modal-footer d-flex flex-row-reverse justify-content-start">
31
- <%= f.submit t(:'spotlight.bulk_actions.remove'), class: 'btn btn-primary', data: { confirm: t(:'spotlight.bulk_actions.confirm') } %>
31
+ <%= f.submit t(:'spotlight.bulk_actions.remove'), class: 'btn btn-primary', data: { confirm: t(:'spotlight.bulk_actions.confirm'), turbo_confirm: t(:'spotlight.bulk_actions.confirm') } %>
32
32
  <button type="button" class="btn btn-link" data-dismiss="modal" data-bs-dismiss="modal"><%= t :cancel %></button>
33
33
  </div>
34
34
  </div>
@@ -13,25 +13,36 @@
13
13
  <% else %>
14
14
  <%= stylesheet_link_tag "application" %>
15
15
  <% end %>
16
- <%= javascript_include_tag "application" %>
16
+ <%= javascript_tag "window.sirTrevorIcon = '#{asset_path('spotlight/blocks/sir-trevor-icons.svg')}'" %>
17
+
18
+ <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
19
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.serializeJSON/3.2.1/jquery.serializejson.min.js"></script>
20
+ <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
21
+ <%= javascript_tag 'L.Icon.Default.prototype.options.imagePath = "https://unpkg.com/leaflet@1.9.4/dist/images/"' %>
22
+ <%= javascript_include_tag 'leaflet-iiif', "data-turbo-track": "reload", defer: true %>
23
+ <%= javascript_include_tag 'Leaflet.Editable', "data-turbo-track": "reload", defer: true %>
24
+ <%= javascript_include_tag 'Path.Drag', "data-turbo-track": "reload", defer: true %>
25
+ <% if defined? Importmap %>
26
+ <%= javascript_importmap_tags %>
27
+ <% else %>
28
+ <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
29
+ <% end %>
17
30
  <%= csrf_meta_tags %>
18
31
  <%= content_for(:head) %>
19
- <%= description %>
20
- <%= twitter_card %>
21
- <%= opengraph %>
22
- <%= javascript_tag "Spotlight.sirTrevorIcon = '#{asset_path('spotlight/blocks/sir-trevor-icons.svg')}'" %>
23
- <%= javascript_tag '$.fx.off = true;' if Rails.env.test? %>
32
+ <% if @document %>
33
+ <% add_document_meta_content(@document) %>
34
+ <% elsif current_exhibit %>
35
+ <% description(current_exhibit.description) if current_exhibit %>
36
+ <% add_exhibit_meta_content %>
37
+ <% end %>
38
+ <%= yield(:meta) %>
39
+ <%= javascript_tag "window.addEventListener('load', () => $.fx.off = true)" if Rails.env.test? %>
24
40
  </head>
25
41
  <body class="<%= render_body_class %>">
26
42
  <%= render partial: 'shared/body_preamble' %>
27
- <div id="skip-link">
28
- <% if should_render_spotlight_search_bar? %>
29
- <%= link_to t('blacklight.skip_links.search_field'), '#search_field', class: 'btn btn-link bg-light sr-only sr-only-focusable visually-hidden-focusable' %>
30
- <% end %>
31
- <%= link_to t('blacklight.skip_links.main_content'), '#main-container', class: 'btn btn-link bg-light sr-only sr-only-focusable visually-hidden-focusable' %>
43
+ <%= render blacklight_config.skip_link_component.new(render_search_link: should_render_spotlight_search_bar?) do %>
32
44
  <%= content_for(:skip_links) %>
33
- </div>
34
-
45
+ <% end %>
35
46
  <%= render partial: 'shared/header_navbar' %>
36
47
  <%= render partial: 'shared/masthead' %>
37
48
  <%= content_for?(:header_content) ? yield(:header_content) : "" %>
@@ -1,12 +1,12 @@
1
1
  <% content_for(:content) do %>
2
- <% if content_for? :sidebar %>
3
- <section id="content" class="<%= main_content_classes %> <%= content_for(:content_position) || 'order-last' %>" aria-label="<%= t('blacklight.search.search_results') %>">
4
- <%= yield %>
5
- </section>
6
-
7
- <aside id="sidebar" class="<%= sidebar_classes %> <%= content_for(:sidebar_position) || 'order-first' %>" aria-label="<%= t('blacklight.search.documents.aria.limit_search') %>">
2
+ <% if content? :sidebar %>
3
+ <aside id="sidebar" class="<%= sidebar_classes %> <%= content_for(:sidebar_position) %>" aria-label="<%= t('blacklight.search.documents.aria.limit_search') %>">
8
4
  <%= content_for(:sidebar) %>
9
5
  </aside>
6
+
7
+ <section id="content" class="<%= main_content_classes %> <%= content_for(:content_position) %>" aria-label="<%= t('blacklight.search.search_results') %>">
8
+ <%= yield %>
9
+ </section>
10
10
  <% else %>
11
11
  <section id="content" class="col-md-12">
12
12
  <%= yield %>
@@ -1,45 +1,18 @@
1
1
  <% if show_contact_form? && (current_exhibit.nil? || !current_page?(spotlight.new_exhibit_contact_form_path(current_exhibit))) %>
2
- <div id="report-problem-form">
2
+ <div id="report-problem-form" class="collapse">
3
3
  <%= render 'spotlight/shared/report_a_problem' %>
4
4
  </div>
5
5
  <% end %>
6
6
 
7
- <%- masthead_navbar = capture do %>
8
- <% if content_for? :masthead_navbar %>
9
- <%= content_for :masthead_navbar %>
10
- <% elsif current_exhibit %>
11
- <%= render 'shared/exhibit_navbar' %>
12
- <% else %>
13
- <%= render 'shared/site_navbar' %>
14
- <% end %>
15
- <% end %>
16
-
17
7
  <header class="masthead <%= 'image-masthead' if current_masthead %> <%= 'resource-masthead' if resource_masthead? %>">
18
8
  <% if current_masthead %>
19
9
  <span class='background-container' style="background-image: url('<%= current_masthead.iiif_url %>')"></span>
20
10
  <span class='background-container-gradient'></span>
21
11
  <% end %>
22
12
 
23
- <%= masthead_navbar if resource_masthead? %>
24
-
25
- <div class="container site-title-container">
26
- <div class="site-title-wrapper">
27
- <% if content_for? :masthead %>
28
- <h1 class="site-title h2">
29
- <%= content_for :masthead %>
30
- </h1>
31
- <% else %>
32
- <h1 class="site-title h2">
33
- <%= masthead_heading_content %>
34
- </h1>
35
- <% if masthead_subheading_content %>
36
- <small class="d-none d-md-block py-2 fs-4"><%= masthead_subheading_content %></small>
37
- <% end %>
38
- <% end %>
39
- </div>
40
- </div>
41
-
42
- <%= masthead_navbar unless resource_masthead? %>
13
+ <%= render current_exhibit ? 'shared/exhibit_navbar' : 'shared/site_navbar' if resource_masthead? %>
14
+ <%= render Spotlight::Engine.config.spotlight.title_component.new(title: content_for(:masthead) || masthead_heading_content, subtitle: masthead_subheading_content) %>
15
+ <%= render current_exhibit ? 'shared/exhibit_navbar' : 'shared/site_navbar' unless resource_masthead? %>
43
16
  </header>
44
17
 
45
18
  <%= render Spotlight::BreadcrumbsComponent.new(breadcrumbs:) %>
@@ -14,6 +14,6 @@
14
14
  </ul>
15
15
 
16
16
  <ul class="nav sidenav nav-pills nav-stacked">
17
- <li class="nav-item"><%= link_to t(:'spotlight.exhibits.new.page_title'), spotlight.new_exhibit_path, class: 'btn btn-outline-secondary btn-nav', role: 'button' if can? :create, Spotlight::Exhibit %></li>
17
+ <li class="nav-item"><%= link_to t(:'spotlight.exhibits.new.page_title'), spotlight.new_exhibit_path, class: 'btn btn-primary btn-nav', role: 'button' if can? :create, Spotlight::Exhibit %></li>
18
18
  </ul>
19
19
  <% end %>
@@ -47,7 +47,9 @@
47
47
  <% end %>
48
48
  <% if current_exhibit and show_contact_form? %>
49
49
  <li class="nav-item">
50
- <%= link_to t('spotlight.header_links.contact'), spotlight.new_exhibit_contact_form_path(current_exhibit), data: {behavior: 'contact-link', target: 'report-problem-form' }, class: 'nav-link' %>
50
+ <%= link_to t('spotlight.header_links.contact'), spotlight.new_exhibit_contact_form_path(current_exhibit),
51
+ data: { bs_toggle: 'collapse', bs_target: '#report-problem-form' },
52
+ class: 'nav-link' %>
51
53
  </li>
52
54
  <% end %>
53
55
  </ul>
@@ -34,11 +34,11 @@
34
34
  <%= page.title %>
35
35
  <span class="alt-text-status">
36
36
  <% if page_dict[:complete] %>
37
- <svg xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" class="bi bi-check-circle-fill">
37
+ <svg xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" fill="var(--bs-success)" class="bi bi-check-circle-fill">
38
38
  <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>
39
39
  </svg>
40
40
  <% else %>
41
- <svg xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" class="bi bi-exclamation-triangle-fill">
41
+ <svg xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" fill="var(--bs-warning)" class="bi bi-exclamation-triangle-fill">
42
42
  <path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2"/>
43
43
  </svg>
44
44
  <% end %>
@@ -45,7 +45,7 @@
45
45
 
46
46
  <div class="form-actions">
47
47
  <div class="primary-actions">
48
- <%= link_to(t('.create'), 'javascript:;', class: 'btn btn-secondary', data: { behavior: 'new-user' }) %>
48
+ <%= link_to(t('.create'), 'javascript:;', class: 'btn btn-primary', data: { behavior: 'new-user' }) %>
49
49
  </div>
50
50
  </div>
51
51
  </div>
@@ -54,7 +54,7 @@
54
54
  <h3 class="instructions"><%= t :'.admins_curators' %></h3>
55
55
  <div id="admins_curators" class="card card-body bg-light">
56
56
  <div class='btn-toolbar float-right align-self-end'>
57
- <button class="btn btn-sm btn-secondary copy-email-addresses" data-clipboard-target="#admins_curators">
57
+ <button class="btn btn-sm btn-primary copy-email-addresses" data-clipboard-target="#admins_curators">
58
58
  <%= t('.copy') %>
59
59
  </button>
60
60
  </div>
@@ -89,7 +89,7 @@
89
89
  <% else %>
90
90
  <%= link_to(t('.update'), admin_user_path(user),
91
91
  data: { method: :patch, turbo_method: :patch },
92
- class: 'btn btn-sm btn-secondary') %>
92
+ class: 'btn btn-sm btn-primary') %>
93
93
  <% end %>
94
94
  </td>
95
95
  </tr>
@@ -71,7 +71,7 @@
71
71
  <div class="card-group dd main_navigation_admin col-sm-7" id="nested-navigation" data-behavior="nestable" data-max-depth="1">
72
72
  <ol class="dd-list">
73
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, enabled_method: :display } do; end %>
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
75
  <% end %>
76
76
  </ol>
77
77
  </div>
@@ -6,14 +6,14 @@
6
6
  <div class="col-sm-6">
7
7
  <div class="input-group">
8
8
  <%= text_field_tag :q, params[:q], placeholder: t(:'.placeholder'), class: "form-control", id: "browse_q" %>
9
- <button class="btn btn-reset btn-sm" type="reset">
10
- <span class="sr-only visually-hidden"><%= t(:'.reset') %></span>
11
- <%= blacklight_icon('highlight_off') %>
12
- </button>
13
- <button type="submit" class="btn btn-primary search-btn" id="browse-search">
14
- <span class="submit-search-text"><%= t(:'.submit') %></span>
15
- <%= blacklight_icon('search', aria_hidden: true) %>
16
- </button>
9
+ <button class="btn btn-reset btn-sm" type="reset">
10
+ <span class="sr-only visually-hidden"><%= t(:'.reset') %></span>
11
+ <%= blacklight_icon('highlight_off') %>
12
+ </button>
13
+ <button type="submit" class="btn btn-primary search-btn" id="browse-search">
14
+ <span class="submit-search-text sr-only visually-hidden"><%= t(:'.submit') %></span>
15
+ <%= blacklight_icon('search', aria_hidden: true) %>
16
+ </button>
17
17
  </div>
18
18
  </div>
19
19
  </div>
@@ -1,5 +1,5 @@
1
1
  <% set_html_page_title @search.title %>
2
- <% render partial: 'tophat' %>
2
+ <% add_browse_meta_content(@search) %>
3
3
 
4
4
  <%= exhibit_edit_link @search, class: 'edit-button float-right float-end btn btn-primary' if can? :edit, @search %>
5
5
  <% if resource_masthead? %>
@@ -1,6 +1,6 @@
1
1
  <p class="instructions"><%= t('.instructions_html') %></p>
2
2
 
3
- <%= bootstrap_form_with(url: download_template_exhibit_bulk_updates_path, local: true, target: '_blank') do |f| %>
3
+ <%= bootstrap_form_with(url: download_template_exhibit_bulk_updates_path, local: true, data: { turbo: false }) do |f| %>
4
4
  <div class="row">
5
5
  <div class="col col-sm-3">
6
6
  <%= f.form_group(:reference_fields, label: { text: t('.reference_fields.heading'), class: 'font-weight-bold fw-bold mb-3' }) do %>
@@ -17,6 +17,6 @@
17
17
  <% end %>
18
18
  <div class="row">
19
19
  <div class="col-12 col-md-9 offset-md-3">
20
- <p id="bulk-update-form-help" class="form-text text-muted ml-3"><%= t('.form_help') %></p>
20
+ <p id="bulk-update-form-help" class="form-text text-muted ms-3"><%= t('.form_help') %></p>
21
21
  </div>
22
22
  </div>
@@ -6,7 +6,7 @@
6
6
  <div class="float-right float-end">
7
7
  <%= link_to t('.reindex'), reindex_all_exhibit_resources_path(current_exhibit),
8
8
  data: { method: :post, turbo_method: :post },
9
- class: 'btn btn-secondary' %>
9
+ class: 'btn btn-outline-primary' %>
10
10
  <% if Spotlight::Engine.config.resource_partials.any? %>
11
11
  <%= link_to t('.new_resource'), new_exhibit_resource_path(current_exhibit), class: 'btn btn-primary' %>
12
12
  <% end %>
@@ -13,7 +13,8 @@
13
13
 
14
14
  <% if can? :tag, current_exhibit %>
15
15
  <div class="edit-tags">
16
- <%= f.text_field :exhibit_tag_list, value: f.object.sidecar(current_exhibit).tags_from(current_exhibit).to_s, data: { autocomplete_tag: true, autocomplete_url: exhibit_tags_path(current_exhibit, format: 'json')} %>
16
+ <%= render Spotlight::TagSelectorComponent.new(form: f, field_name: :exhibit_tag_list, selected_tags_value: f.object.sidecar(current_exhibit).tags_from(current_exhibit).to_s,
17
+ all_tags: current_exhibit.owned_tags) %>
17
18
  </div>
18
19
  <% end %>
19
20
  <div class="form-actions">
@@ -0,0 +1 @@
1
+ <%= render Spotlight::SelectImageComponent.new(@index_id, @block_item_id) %>
@@ -7,7 +7,7 @@
7
7
  <% end %>
8
8
 
9
9
  <%= f.fields_for :avatar, (@contact.avatar || @contact.build_avatar) do |af| %>
10
- <div data-cropper="<%= af.object.model_name.singular_route_key %>" data-form-prefix="<%= form_prefix(af) %>">
10
+ <div data-cropper="<%= af.object.model_name.singular_route_key %>" data-input-prefix="<%= input_prefix(af) %>">
11
11
  <%= field_set_tag(t(:'.avatar.header')) do %>
12
12
  <p class="instructions"><%= t(:'featured_images.form.crop_area.help_html', scope: [:spotlight], thing: 'contact photo') %></p>
13
13
 
@@ -1,3 +1,4 @@
1
+ <%= turbo_frame_tag dom_id(contact.object) do %>
1
2
  <div class="row contact">
2
3
  <%= contact.hidden_field :id %>
3
4
  <div class="col-md-8<%= ' has-error' if contact.object.errors[:email].present? %>">
@@ -6,17 +7,14 @@
6
7
  <div class="form-text text-muted mb-3"><%=contact.object.errors[:email].join(", ".html_safe) %></div>
7
8
  <% end %>
8
9
  <p>
9
- <span class="contact-email-delete-error text-danger bg-danger" style="display: none;"><%= t('.email_delete_error') %> <span class="error-msg"></span></span>
10
+ <span class="contact-email-delete-error text-danger" style="display: none;"><%= t('.email_delete_error') %> <span class="error-msg"></span></span>
10
11
  </p>
11
12
  </div>
12
13
  <div class="col-md-4">
13
14
  <% if contact.object.id %>
14
15
  <span class="contact-email-delete-wrapper">
15
- <%= link_to exhibit_contact_email_path(exhibit_id: exhibit.id, id: contact.object.id), class: 'contact-email-delete btn btn-sm btn-danger',
16
- data: { method: :delete, turbo_method: :delete,
17
- confirm: t('.email_delete_confirmation'),
18
- turbo_confirm: t('.email_delete_confirmation'),
19
- remote: true } do %>
16
+ <%= link_to exhibit_contact_email_path(exhibit_id: exhibit.id, id: contact.object.id), class: 'contact-email-delete btn btn-sm btn-danger',
17
+ data: { turbo_method: :delete, turbo_confirm: t('.email_delete_confirmation') } do %>
20
18
  <%= t('.email_delete_button') %>
21
19
  <% end %>
22
20
  </span>
@@ -24,3 +22,4 @@
24
22
  <%= render partial: 'confirmation_status', locals: {contact_email: contact.object} unless contact.object.new_record? %>
25
23
  </div>
26
24
  </div>
25
+ <% end %>
@@ -4,7 +4,7 @@
4
4
  <div class="row">
5
5
  <p class='col-9'><%= t(:".warning_html", export_link: link_to(t(:'spotlight.exhibits.export.download'), spotlight.edit_exhibit_path(current_exhibit, anchor: 'export'))) %></p>
6
6
  <div class='col-3'>
7
- <%= delete_link current_exhibit, class: 'btn btn-secondary' %>
7
+ <%= delete_link current_exhibit, class: 'btn btn-primary' %>
8
8
  </div>
9
9
  </div>
10
10
  </div>
@@ -30,7 +30,8 @@
30
30
  <tbody>
31
31
  <% current_exhibit.languages.each do |language| %>
32
32
  <%= f.fields_for :languages, language do |languages| %>
33
- <tr>
33
+ <tr id="<%= dom_id(language) %>">
34
+ <%= languages.hidden_field :id %>
34
35
  <td><%= t("locales.#{language.locale}") %></td>
35
36
  <td class='text-center'>
36
37
  <div class='checkbox'>
@@ -38,7 +39,7 @@
38
39
  <%= languages.check_box_without_bootstrap :public %>
39
40
  </div>
40
41
  </td>
41
- <td class='text-center'><%= link_to t('.remove'), exhibit_language_path(current_exhibit, language), method: :delete, data: { confirm: t('.modal.confirm') }, class: 'btn btn-sm btn-danger' %></td>
42
+ <td class='text-center'><%= link_to t('.remove'), spotlight.exhibit_language_path(current_exhibit, language), data: { turbo_method: :delete, turbo_confirm: t('.modal.confirm')}, class: 'btn btn-sm btn-danger' %></td>
42
43
  </tr>
43
44
  <% end %>
44
45
  <% end %>
@@ -1,4 +1,4 @@
1
- <div data-cropper="<%= f.object.model_name.singular_route_key %>" data-form-prefix="<%= form_prefix(f) %>">
1
+ <div data-cropper="<%= f.object.model_name.singular_route_key %>" data-input-prefix="<%= input_prefix(f) %>">
2
2
  <%= field_set_tag do %>
3
3
  <%= f.check_box(:display, layout: :vertical) %>
4
4
  <% end if f.object.is_a? Spotlight::Masthead %>
@@ -11,7 +11,11 @@
11
11
  <%= blacklight_icon('warning') %>
12
12
  <%= t(:'.non_iiif_alert_html') %>
13
13
  </div>
14
- <%= text_field_tag(:document_title, (document_presenter(f.object.document).heading if f.object.document), class: "form-control", data: { input_select_target: "##{form_prefix(f)}_source_exhibit", 'behavior': 'autocomplete', featured_image_typeahead: true, target_panel: "##{form_prefix(f)}-target-panel", :'id-field' => "##{form_prefix(f)}_document_global_id" }) %>
14
+ <auto-complete id="<%= form_prefix(f) %>-auto-complete" for="<%= form_prefix(f) %>-auto-complete-popup" fetch-on-empty>
15
+ <%= text_field_tag(:document_title, (document_presenter(f.object.document).heading if f.object.document), class: "form-control", data: { input_select_target: "##{form_prefix(f)}_source_exhibit", 'behavior': 'autocomplete', featured_image_typeahead: true, target_panel: "##{form_prefix(f)}-target-panel", :'id-field' => "##{form_prefix(f)}_document_global_id" }) %>
16
+ <ul id="<%= form_prefix(f) %>-auto-complete-popup"></ul>
17
+ <div id="<%= form_prefix(f) %>-auto-complete-feedback" class="sr-only visually-hidden"></div>
18
+ </auto-complete>
15
19
  <div id="<%= form_prefix(f) %>-target-panel" style="display:none">
16
20
  <div class="card-header">
17
21
  <div data-item-title="true"></div>
@@ -1,4 +1,4 @@
1
- <div data-cropper="<%= f.object.model_name.singular_route_key %>" data-form-prefix="<%= form_prefix(f) %>">
1
+ <div data-cropper="<%= f.object.model_name.singular_route_key %>" data-input-prefix="<%= input_prefix(f) %>">
2
2
  <%= field_set_tag do %>
3
3
  <%= f.check_box(:display, layout: :vertical) %>
4
4
  <% end if f.object.is_a? Spotlight::Masthead %>
@@ -14,7 +14,7 @@
14
14
  </div>
15
15
  <% if default_field_label %>
16
16
  <div class="restore-default">
17
- <%= button_tag t(:'.restore_default'), data: {:"restore-default" => true}, class: "btn btn-secondary btn-sm #{'d-none' if config.display_label == default_field_label}" %>
17
+ <%= button_tag t(:'.restore_default'), data: {:"restore-default" => true}, class: "btn btn-primary btn-sm #{'d-none' if config.display_label == default_field_label}" %>
18
18
  </div>
19
19
  <% end %>
20
20
  </div>
@@ -17,15 +17,15 @@
17
17
  <%= t :'.view.show' %>
18
18
  </div>
19
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
+ <%= 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
25
  </th>
26
26
  <% available_view_fields.keys.each do |type| %>
27
27
  <th class="text-center">
28
- <div>
28
+ <div>
29
29
  <%= t :".view.#{type}", default: t("blacklight.search.view.#{type}", default: type.to_s.humanize.titleize) %>
30
30
  </div>
31
31
  <div class="text-center">
@@ -1,5 +1,5 @@
1
1
  <% set_html_page_title @page.title if @page.should_display_title? %>
2
- <% render 'tophat' %>
2
+ <% add_page_meta_content(@page) %>
3
3
 
4
4
  <% content_for(:sidebar) do %>
5
5
  <%= render 'sidebar' %>
@@ -1,5 +1,5 @@
1
1
  <%= bootstrap_form_for([current_exhibit, @resource.becomes(Spotlight::Resources::CsvUpload)], layout: :horizontal, label_col: 'col-md-2', control_col: 'col-sm-6 col-md-6', html: { class: 'item-upload-form', multipart: true } ) do |f| %>
2
- <%= f.url_field :url, type: "file", help: t('.help_html', link: link_to(t('.template'), template_exhibit_resources_csv_uploads_path)), label: t('.file_label') %>
2
+ <%= f.url_field :url, type: "file", help: t('.help_html', link: link_to(t('.template'), template_exhibit_resources_csv_uploads_path, data: { turbo: false })), label: t('.file_label') %>
3
3
  <div class="form-actions">
4
4
  <div class="primary-actions">
5
5
  <%= cancel_link @resource, :back, class: 'btn btn-link', role: 'button' %>
@@ -13,7 +13,7 @@
13
13
  <div class="primary-actions">
14
14
  <%= hidden_field_tag :tab, 'upload', id: nil %>
15
15
  <%= cancel_link @resource, :back, class: 'btn btn-link', role: 'button' %>
16
- <%= f.submit t('.add_item_and_continue'), name: 'add-and-continue', class: 'btn btn-secondary' %>
16
+ <%= f.submit t('.add_item_and_continue'), name: 'add-and-continue', class: 'btn btn-outline-primary' %>
17
17
  <%= f.submit t('.add_item'), class: 'btn btn-primary' %>
18
18
  </div>
19
19
  </div>
@@ -55,7 +55,7 @@
55
55
 
56
56
  <div class="form-actions">
57
57
  <div class="primary-actions">
58
- <%= exhibit_create_link Spotlight::Role.new, '#', class: 'btn btn-secondary', data: {behavior: 'new-user'} %>
58
+ <%= exhibit_create_link Spotlight::Role.new, '#', class: 'btn btn-primary', data: {behavior: 'new-user'} %>
59
59
  </div>
60
60
  </div>
61
61
  <% end %>
@@ -1,4 +1,4 @@
1
- <%= bootstrap_form_for [@search.exhibit, @search], layout: :horizontal, label_col: 'col-md-2 col-sm-2', control_col: 'col-md-7 col-sm-7', data: {form_observer: 'true', autocomplete_exhibit_catalog_path: spotlight.autocomplete_exhibit_search_path(@search.exhibit, @search, q: "%QUERY", format: "json")}, html: {id: 'edit-search'} do |f| %>
1
+ <%= bootstrap_form_for [@search.exhibit, @search], layout: :horizontal, label_col: 'col-md-2 col-sm-2', control_col: 'col-md-7 col-sm-7', data: {form_observer: 'true', autocomplete_exhibit_catalog_path: spotlight.autocomplete_exhibit_search_path(@search.exhibit, @search, q: "%QUERY", format: "json"), turbo: 'false'}, html: {id: 'edit-search'} do |f| %>
2
2
  <% if @search.errors.any? %>
3
3
  <div id="error_explanation">
4
4
  <h2><%= pluralize(@search.errors.count, "error") %> prohibited this page from being saved:</h2>