blacklight-spotlight 4.1.2 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/app/assets/javascripts/spotlight/spotlight.esm.js +146 -27
  4. data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
  5. data/app/assets/javascripts/spotlight/spotlight.js +146 -27
  6. data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
  7. data/app/assets/stylesheets/spotlight/_blacklight_configuration.scss +19 -1
  8. data/app/components/spotlight/breadcrumbs_component.html.erb +19 -0
  9. data/app/components/spotlight/breadcrumbs_component.rb +23 -0
  10. data/app/components/spotlight/exhibit_navbar_component.html.erb +25 -0
  11. data/app/components/spotlight/exhibit_navbar_component.rb +12 -0
  12. data/app/components/spotlight/tag_list_form_component.html.erb +14 -0
  13. data/app/components/spotlight/tag_list_form_component.rb +13 -0
  14. data/app/controllers/concerns/spotlight/controller.rb +9 -1
  15. data/app/controllers/concerns/spotlight/search_helper.rb +2 -2
  16. data/app/controllers/spotlight/about_pages_controller.rb +1 -1
  17. data/app/controllers/spotlight/admin_users_controller.rb +2 -2
  18. data/app/controllers/spotlight/appearances_controller.rb +4 -4
  19. data/app/controllers/spotlight/browse_controller.rb +2 -2
  20. data/app/controllers/spotlight/bulk_actions_controller.rb +1 -1
  21. data/app/controllers/spotlight/bulk_updates_controller.rb +7 -2
  22. data/app/controllers/spotlight/catalog_controller.rb +11 -10
  23. data/app/controllers/spotlight/contacts_controller.rb +5 -5
  24. data/app/controllers/spotlight/custom_fields_controller.rb +5 -5
  25. data/app/controllers/spotlight/custom_search_fields_controller.rb +5 -5
  26. data/app/controllers/spotlight/dashboards_controller.rb +4 -4
  27. data/app/controllers/spotlight/exhibits_controller.rb +6 -5
  28. data/app/controllers/spotlight/feature_pages_controller.rb +5 -5
  29. data/app/controllers/spotlight/featured_images_controller.rb +1 -1
  30. data/app/controllers/spotlight/groups_controller.rb +1 -1
  31. data/app/controllers/spotlight/home_pages_controller.rb +2 -2
  32. data/app/controllers/spotlight/job_trackers_controller.rb +3 -3
  33. data/app/controllers/spotlight/metadata_configurations_controller.rb +3 -3
  34. data/app/controllers/spotlight/pages_controller.rb +3 -3
  35. data/app/controllers/spotlight/resources/csv_upload_controller.rb +1 -1
  36. data/app/controllers/spotlight/resources_controller.rb +4 -4
  37. data/app/controllers/spotlight/roles_controller.rb +4 -4
  38. data/app/controllers/spotlight/search_configurations_controller.rb +3 -3
  39. data/app/controllers/spotlight/searches_controller.rb +5 -5
  40. data/app/controllers/spotlight/sites_controller.rb +4 -4
  41. data/app/controllers/spotlight/tags_controller.rb +3 -3
  42. data/app/controllers/spotlight/translations_controller.rb +5 -5
  43. data/app/helpers/spotlight/application_helper.rb +2 -2
  44. data/app/helpers/spotlight/crop_helper.rb +1 -1
  45. data/app/helpers/spotlight/pages_helper.rb +7 -0
  46. data/app/helpers/spotlight/title_helper.rb +2 -2
  47. data/app/javascript/spotlight/admin/blocks/browse_group_categories_block.js +1 -1
  48. data/app/javascript/spotlight/admin/blocks/resources_block.js +82 -1
  49. data/app/javascript/spotlight/admin/blocks/solr_documents_embed_block.js +1 -1
  50. data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +21 -0
  51. data/app/javascript/spotlight/admin/edit_in_place.js +27 -0
  52. data/app/javascript/spotlight/admin/index.js +0 -2
  53. data/app/javascript/spotlight/admin/sir-trevor/locales.js +11 -0
  54. data/app/jobs/concerns/spotlight/job_tracking.rb +1 -1
  55. data/app/jobs/spotlight/add_tags_job.rb +2 -2
  56. data/app/jobs/spotlight/add_uploads_from_csv.rb +1 -1
  57. data/app/jobs/spotlight/change_visibility_job.rb +2 -2
  58. data/app/jobs/spotlight/process_bulk_updates_csv_job.rb +2 -2
  59. data/app/jobs/spotlight/reindex_exhibit_job.rb +1 -1
  60. data/app/jobs/spotlight/reindex_job.rb +6 -6
  61. data/app/jobs/spotlight/remove_tags_job.rb +2 -2
  62. data/app/jobs/spotlight/rename_tags_job.rb +2 -2
  63. data/app/models/breadcrumb.rb +15 -0
  64. data/app/models/concerns/spotlight/exhibit_defaults.rb +1 -1
  65. data/app/models/concerns/spotlight/exhibit_documents.rb +2 -2
  66. data/app/models/concerns/spotlight/solr_document/finder.rb +4 -4
  67. data/app/models/concerns/spotlight/solr_document.rb +4 -4
  68. data/app/models/concerns/spotlight/translatables.rb +1 -1
  69. data/app/models/spotlight/analytics/ga.rb +3 -3
  70. data/app/models/spotlight/attachment.rb +1 -1
  71. data/app/models/spotlight/background_job_progress.rb +1 -1
  72. data/app/models/spotlight/contact_email.rb +1 -1
  73. data/app/models/spotlight/contact_form.rb +2 -2
  74. data/app/models/spotlight/custom_field.rb +2 -2
  75. data/app/models/spotlight/custom_search_field.rb +2 -2
  76. data/app/models/spotlight/job_tracker.rb +1 -1
  77. data/app/models/spotlight/page.rb +2 -2
  78. data/app/models/spotlight/resources/iiif_service.rb +4 -4
  79. data/app/models/spotlight/role.rb +1 -1
  80. data/app/models/spotlight/search.rb +2 -2
  81. data/app/services/spotlight/bulk_updates_csv_template_service.rb +2 -2
  82. data/app/services/spotlight/clone_translated_page_from_locale.rb +1 -1
  83. data/app/services/spotlight/etl/pipeline.rb +1 -1
  84. data/app/views/shared/_exhibit_navbar.html.erb +2 -24
  85. data/app/views/shared/_masthead.html.erb +1 -1
  86. data/app/views/spotlight/exhibits/_form.html.erb +1 -1
  87. data/app/views/spotlight/exhibits/_new_exhibit_form.html.erb +1 -1
  88. data/app/views/spotlight/metadata_configurations/_metadata_field.html.erb +16 -5
  89. data/app/views/spotlight/metadata_configurations/edit.html.erb +2 -2
  90. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +3 -3
  91. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +3 -3
  92. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +3 -3
  93. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +3 -3
  94. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +3 -2
  95. data/config/locales/spotlight.en.yml +4 -0
  96. data/lib/generators/spotlight/templates/catalog_controller.rb +1 -0
  97. data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +4 -0
  98. data/lib/migration/iiif.rb +3 -3
  99. data/lib/spotlight/engine.rb +6 -26
  100. data/lib/spotlight/version.rb +1 -1
  101. data/lib/tasks/spotlight_tasks.rake +3 -3
  102. data/spec/factories/exhibits.rb +1 -1
  103. data/spec/support/views/test_view_helpers.rb +0 -1
  104. metadata +11 -27
  105. data/app/builders/spotlight/bootstrap_breadcrumbs_builder.rb +0 -39
  106. data/app/javascript/spotlight/admin/appearance.js +0 -22
  107. data/app/views/shared/_breadcrumbs.html.erb +0 -7
@@ -18,7 +18,6 @@
18
18
  padding: 0.75rem 0.75rem 0.75rem 40px;
19
19
  margin: 0;
20
20
  margin-top: -1px;
21
-
22
21
  }
23
22
 
24
23
  .dd3-handle:before {
@@ -48,9 +47,27 @@
48
47
  }
49
48
  }
50
49
 
50
+ .metadata-configuration {
51
+ td, th {
52
+ padding: 0.75rem 0.25rem;
53
+ }
54
+ th {
55
+ font-size: $font-size-sm;
56
+ }
57
+ .metadata-label-edit {
58
+ max-width: fit-content;
59
+ }
60
+ .restore-default .btn {
61
+ text-wrap: nowrap;
62
+ margin-left: 0.5rem;
63
+ }
64
+ }
65
+
66
+ // the table id
51
67
  #nested-fields {
52
68
  margin-bottom: 1em;
53
69
 
70
+ // the tbody class
54
71
  .metadata_fields {
55
72
  .checkbox-cell {
56
73
  vertical-align: middle;
@@ -59,6 +76,7 @@
59
76
 
60
77
  .metadata-select {
61
78
  display: inline-block;
79
+ text-wrap: nowrap;
62
80
  min-width: 72px;
63
81
  }
64
82
  }
@@ -0,0 +1,19 @@
1
+ <div class="container breadcrumbs-container" role="navigation" aria-label="<%= t('spotlight.breadcrumb.label') %>">
2
+ <div class="row">
3
+ <div class="col-md-12">
4
+ <nav>
5
+ <ul class="breadcrumb list-unstyled d-flex">
6
+ <% breadcrumbs.each do |crumb| %>
7
+ <li class="breadcrumb-item <%= crumb == breadcrumbs.last ? 'active' : '' %>">
8
+ <% if crumb.link? && crumb != breadcrumbs.last %>
9
+ <%= link_to crumb.name, path(crumb.path) %>
10
+ <% else %>
11
+ <%= crumb.name %>
12
+ <% end %>
13
+ </li>
14
+ <% end %>
15
+ </ul>
16
+ </nav>
17
+ </div>
18
+ </div>
19
+ </div>
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ # Component to render breadcrumbs
5
+ class BreadcrumbsComponent < ViewComponent::Base
6
+ attr_reader :breadcrumbs
7
+
8
+ def initialize(breadcrumbs: [])
9
+ @breadcrumbs = breadcrumbs
10
+ super
11
+ end
12
+
13
+ def render?
14
+ !helpers.resource_masthead? && breadcrumbs.present?
15
+ end
16
+
17
+ def path(path)
18
+ return path unless path.instance_of?(::Spotlight::Exhibit)
19
+
20
+ helpers.exhibit_path(path)
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,25 @@
1
+ <div id="exhibit-navbar" class="exhibit-navbar navbar navbar-light navbar-expand-md" role="navigation" aria-label="<%= t('spotlight.exhibitnavbar.label') %>">
2
+ <div class="container flex-column flex-md-row">
3
+ <% if helpers.resource_masthead? %>
4
+ <%= link_to(helpers.current_exhibit.title, helpers.spotlight.exhibit_path(helpers.current_exhibit), class: 'navbar-brand') %>
5
+ <% end %>
6
+
7
+ <ul class="navbar-nav <%= helpers.resource_masthead? ? 'justify-content-md-end' : 'mr-auto me-auto' %>">
8
+ <li class="nav-item <%= "active" if helpers.current_page?([helpers.spotlight, helpers.current_exhibit]) %>"><%= link_to t(:'spotlight.curation.nav.home'), [helpers.spotlight, helpers.current_exhibit], class: 'nav-link' %></li>
9
+ <% helpers.current_exhibit.main_navigations.displayable.each do |navigation| %>
10
+ <%= render partial: "shared/#{navigation.nav_type}_navbar", locals: { navigation: navigation } %>
11
+ <% end %>
12
+ </ul>
13
+ <% if helpers.should_render_spotlight_search_bar? %>
14
+ <div class="navbar-right navbar-nav exhibit-search-form mt-3 mt-md-0">
15
+ <%= prepend_to_search_bar %>
16
+ <%= render search_component.new(
17
+ url: helpers.search_action_url,
18
+ advanced_search_url: helpers.search_action_url(action: 'advanced_search'),
19
+ params: helpers.search_state.params_for_search.except(:qt),
20
+ autocomplete_path: suggest_index_catalog_path
21
+ ) %>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+ </div>
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ # Allows component addition to exhibit navbar
5
+ class ExhibitNavbarComponent < ViewComponent::Base
6
+ renders_one :prepend_to_search_bar
7
+
8
+ def search_component
9
+ helpers.blacklight_config&.view_config(helpers.document_index_view_type)&.search_bar_component || Blacklight::SearchBarComponent
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ <% if Spotlight::Engine.config.site_tags %>
2
+ <div class="form-group row">
3
+ <label class="col-form-label col-md-2" for="tag_list">Tag list</label>
4
+ <div class="col-md-10">
5
+ <div class="overflow-scroll rounded border px-3 py-2 h-25" style="overflow: scroll; height: 25vh!important;">
6
+ <% Spotlight::Engine.config.site_tags.each do |tag| %>
7
+ <%= form.check_box :tag_list, { multiple: true, label: tag }, tag , nil %>
8
+ <% end %>
9
+ </div>
10
+ </div>
11
+ </div>
12
+ <% else %>
13
+ <%= form.text_field :tag_list, value: form.object.tag_list.to_s %>
14
+ <% end %>
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ # Create tag list for exhibit general/create form
5
+ class TagListFormComponent < ViewComponent::Base
6
+ attr_reader :form
7
+
8
+ def initialize(form:)
9
+ @form = form
10
+ super
11
+ end
12
+ end
13
+ end
@@ -11,7 +11,7 @@ module Spotlight
11
11
  include Spotlight::Config
12
12
 
13
13
  included do
14
- helper_method :current_site, :current_exhibit, :current_masthead, :exhibit_masthead?, :resource_masthead?
14
+ helper_method :current_site, :current_exhibit, :current_masthead, :exhibit_masthead?, :resource_masthead?, :breadcrumbs
15
15
  before_action :set_exhibit_locale_scope, :set_locale
16
16
  end
17
17
 
@@ -23,6 +23,14 @@ module Spotlight
23
23
  @current_site ||= Spotlight::Site.instance
24
24
  end
25
25
 
26
+ def breadcrumbs
27
+ @breadcrumbs ||= []
28
+ end
29
+
30
+ def add_breadcrumb(name, path = nil, _current = nil)
31
+ breadcrumbs << Breadcrumb.new(name, path)
32
+ end
33
+
26
34
  def current_exhibit
27
35
  @exhibit || (Spotlight::Exhibit.find(params[:exhibit_id]) if params[:exhibit_id].present?)
28
36
  end
@@ -6,14 +6,14 @@ module Spotlight
6
6
  def search_service(user_params = respond_to?(:search_state, true) ? search_state.to_h : {})
7
7
  klass = respond_to?(:search_service_class) ? search_service_class : Blacklight::SearchService
8
8
 
9
- klass.new(config: blacklight_config, user_params: user_params, **search_service_context)
9
+ klass.new(config: blacklight_config, user_params:, **search_service_context)
10
10
  end
11
11
 
12
12
  # @return [Hash] a hash of context information to pass through to the search service
13
13
  def search_service_context
14
14
  return {} unless respond_to?(:current_ability)
15
15
 
16
- { current_ability: current_ability }
16
+ { current_ability: }
17
17
  end
18
18
  end
19
19
  end
@@ -46,7 +46,7 @@ module Spotlight
46
46
 
47
47
  def attach_section_breadcrumbs
48
48
  if action_name == 'edit'
49
- add_breadcrumb t(:'spotlight.pages.index.about_pages.header'), exhibit_about_pages_path(@exhibit)
49
+ add_breadcrumb(t(:'spotlight.pages.index.about_pages.header'), exhibit_about_pages_path(@exhibit))
50
50
  else
51
51
  add_breadcrumb(@exhibit.main_navigations.about.label_or_default, [spotlight, @exhibit, @exhibit.main_about_page])
52
52
  end
@@ -11,8 +11,8 @@ module Spotlight
11
11
  load_and_authorize_resource :site, class: 'Spotlight::Site'
12
12
 
13
13
  def index
14
- add_breadcrumb t(:'spotlight.sites.home'), root_url
15
- add_breadcrumb t(:'spotlight.admin_users.index.page_title')
14
+ add_breadcrumb(t(:'spotlight.sites.home'), root_url)
15
+ add_breadcrumb(t(:'spotlight.admin_users.index.page_title'))
16
16
  end
17
17
 
18
18
  def create
@@ -8,15 +8,15 @@ module Spotlight
8
8
  load_and_authorize_resource id_param: :exhibit_id, instance_name: 'exhibit', class: 'Spotlight::Exhibit', parent: false
9
9
 
10
10
  def edit
11
- add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit
12
- add_breadcrumb t(:'spotlight.configuration.sidebar.header'), exhibit_dashboard_path(@exhibit)
13
- add_breadcrumb t(:'spotlight.configuration.sidebar.appearance'), edit_exhibit_appearance_path(@exhibit)
11
+ add_breadcrumb(t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit)
12
+ add_breadcrumb(t(:'spotlight.configuration.sidebar.header'), exhibit_dashboard_path(@exhibit))
13
+ add_breadcrumb(t(:'spotlight.configuration.sidebar.appearance'), edit_exhibit_appearance_path(@exhibit))
14
14
  end
15
15
 
16
16
  def update
17
17
  if @exhibit.update(exhibit_params)
18
18
  notice = t(:'helpers.submit.spotlight_default.updated', model: @exhibit.class.model_name.human.downcase)
19
- redirect_to edit_exhibit_appearance_path(@exhibit), notice: notice
19
+ redirect_to edit_exhibit_appearance_path(@exhibit), notice:
20
20
  else
21
21
  render 'edit'
22
22
  end
@@ -67,13 +67,13 @@ module Spotlight
67
67
  end
68
68
 
69
69
  def attach_breadcrumbs
70
- add_breadcrumb t(:'spotlight.curation.nav.home', title: @exhibit.title), @exhibit
70
+ add_breadcrumb(t(:'spotlight.curation.nav.home', title: @exhibit.title), @exhibit)
71
71
  add_breadcrumb(@exhibit.main_navigations.browse.label_or_default, exhibit_browse_index_path(@exhibit))
72
72
  add_breadcrumb(@group.title, exhibit_browse_groups_path(@exhibit, @group)) if @group.present?
73
73
  end
74
74
 
75
75
  def attach_search_breadcrumb
76
- add_breadcrumb @search.full_title, (@group.present? ? exhibit_browse_group_path(@exhibit, @group, @search) : exhibit_browse_path(@exhibit, @search))
76
+ add_breadcrumb(@search.full_title, (@group.present? ? exhibit_browse_group_path(@exhibit, @group, @search) : exhibit_browse_path(@exhibit, @search)))
77
77
  end
78
78
 
79
79
  def _prefixes
@@ -23,7 +23,7 @@ module Spotlight
23
23
 
24
24
  def handle_bulk_action_with_job(job, i18n_key: action_name, **params)
25
25
  job.perform_later(
26
- solr_params: solr_params,
26
+ solr_params:,
27
27
  exhibit: current_exhibit,
28
28
  user: current_user,
29
29
  **params
@@ -8,8 +8,13 @@ module Spotlight
8
8
  class BulkUpdatesController < Spotlight::ApplicationController
9
9
  before_action :authenticate_user!
10
10
  before_action :check_authorization
11
+ load_and_authorize_resource :exhibit, class: 'Spotlight::Exhibit'
11
12
 
12
- def edit; end
13
+ def edit
14
+ add_breadcrumb(t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit)
15
+ add_breadcrumb(t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(@exhibit))
16
+ add_breadcrumb(t(:'spotlight.pages.index.bulk_updates.header'), edit_exhibit_bulk_updates_path(@exhibit))
17
+ end
13
18
 
14
19
  def download_template
15
20
  # Set Last-Modified as a work-around for https://github.com/rack/rack/issues/1619
@@ -41,7 +46,7 @@ module Spotlight
41
46
  def csv_template
42
47
  boolean = ActiveModel::Type::Boolean.new
43
48
  Spotlight::BulkUpdatesCsvTemplateService.new(exhibit: current_exhibit).template(
44
- view_context: view_context,
49
+ view_context:,
45
50
  title: boolean.cast(reference_field_params[:item_title]),
46
51
  tags: boolean.cast(updatable_field_params[:tags]),
47
52
  visibility: boolean.cast(updatable_field_params[:visibility])
@@ -8,6 +8,7 @@ module Spotlight
8
8
  # rubocop:disable Metrics/ClassLength
9
9
  class CatalogController < ::CatalogController
10
10
  include Spotlight::Concerns::ApplicationController
11
+
11
12
  load_and_authorize_resource :exhibit, class: Spotlight::Exhibit, prepend: true
12
13
  include Blacklight::Catalog
13
14
  include Spotlight::Catalog
@@ -85,8 +86,8 @@ module Spotlight
85
86
  end
86
87
 
87
88
  def admin
88
- add_breadcrumb t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(@exhibit)
89
- add_breadcrumb t(:'spotlight.curation.sidebar.items'), admin_exhibit_catalog_path(@exhibit)
89
+ add_breadcrumb(t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(@exhibit))
90
+ add_breadcrumb(t(:'spotlight.curation.sidebar.items'), admin_exhibit_catalog_path(@exhibit))
90
91
  (@response,) = search_service.search_results
91
92
  @filters = params[:f] || []
92
93
 
@@ -148,10 +149,10 @@ module Spotlight
148
149
 
149
150
  def attach_breadcrumbs
150
151
  if view_context.current_page?({ action: :admin })
151
- add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), exhibit_root_path(@exhibit)
152
+ add_breadcrumb(t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), exhibit_root_path(@exhibit))
152
153
  else
153
154
  # When not on the admin page, get the translated value for the "Home" breadcrumb
154
- add_breadcrumb t(:'spotlight.curation.nav.home', title: @exhibit.title), exhibit_root_path(@exhibit)
155
+ add_breadcrumb(t(:'spotlight.curation.nav.home', title: @exhibit.title), exhibit_root_path(@exhibit))
155
156
  end
156
157
  end
157
158
 
@@ -227,21 +228,21 @@ module Spotlight
227
228
  def add_breadcrumb_with_search_params
228
229
  return unless has_search_parameters?
229
230
 
230
- add_breadcrumb t(:'spotlight.catalog.breadcrumb.index'), spotlight.search_exhibit_catalog_path(params.to_unsafe_h), current: action_name == 'index'
231
+ add_breadcrumb(t(:'spotlight.catalog.breadcrumb.index'), spotlight.search_exhibit_catalog_path(params.to_unsafe_h), current: action_name == 'index')
231
232
  end
232
233
 
233
234
  # rubocop:disable Metrics/AbcSize
234
235
  def add_document_breadcrumbs(document)
235
236
  if current_browse_category
236
- add_breadcrumb current_browse_category.exhibit.main_navigations.browse.label_or_default, exhibit_browse_index_path(current_browse_category.exhibit)
237
- add_breadcrumb current_browse_category.title, exhibit_browse_path(current_browse_category.exhibit, current_browse_category)
237
+ add_breadcrumb(current_browse_category.exhibit.main_navigations.browse.label_or_default, exhibit_browse_index_path(current_browse_category.exhibit))
238
+ add_breadcrumb(current_browse_category.title, exhibit_browse_path(current_browse_category.exhibit, current_browse_category))
238
239
  elsif current_page_context&.title&.present? && !current_page_context.is_a?(Spotlight::HomePage)
239
- add_breadcrumb current_page_context.title, [current_page_context.exhibit, current_page_context]
240
+ add_breadcrumb(current_page_context.title, [current_page_context.exhibit, current_page_context])
240
241
  elsif current_search_session && !current_page_context&.is_a?(Spotlight::HomePage)
241
- add_breadcrumb t(:'spotlight.catalog.breadcrumb.index'), search_action_url(current_search_session.query_params)
242
+ add_breadcrumb(t(:'spotlight.catalog.breadcrumb.index'), search_action_url(current_search_session.query_params))
242
243
  end
243
244
 
244
- add_breadcrumb view_context.document_presenter(document).heading, polymorphic_path([current_exhibit, document])
245
+ add_breadcrumb(view_context.document_presenter(document).heading, polymorphic_path([current_exhibit, document]))
245
246
  end
246
247
  # rubocop:enable Metrics/AbcSize
247
248
 
@@ -11,11 +11,11 @@ module Spotlight
11
11
  before_action :attach_breadcrumbs
12
12
 
13
13
  def new
14
- add_breadcrumb t(:'helpers.action.spotlight/contact.create'), new_exhibit_contact_path(@exhibit)
14
+ add_breadcrumb(t(:'helpers.action.spotlight/contact.create'), new_exhibit_contact_path(@exhibit))
15
15
  end
16
16
 
17
17
  def edit
18
- add_breadcrumb @contact.name, edit_exhibit_contact_path(@contact.exhibit, @contact)
18
+ add_breadcrumb(@contact.name, edit_exhibit_contact_path(@contact.exhibit, @contact))
19
19
  end
20
20
 
21
21
  def create
@@ -42,9 +42,9 @@ module Spotlight
42
42
  protected
43
43
 
44
44
  def attach_breadcrumbs
45
- add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit
46
- add_breadcrumb t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(@exhibit)
47
- add_breadcrumb t(:'spotlight.pages.index.about_pages.header'), exhibit_about_pages_path(@exhibit)
45
+ add_breadcrumb(t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit)
46
+ add_breadcrumb(t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(@exhibit))
47
+ add_breadcrumb(t(:'spotlight.pages.index.about_pages.header'), exhibit_about_pages_path(@exhibit))
48
48
  end
49
49
 
50
50
  def contact_params
@@ -12,11 +12,11 @@ module Spotlight
12
12
 
13
13
  def new
14
14
  @custom_field.field_type ||= 'text'
15
- add_breadcrumb t(:'helpers.action.spotlight/custom_field.create'), new_exhibit_custom_field_path(@exhibit)
15
+ add_breadcrumb(t(:'helpers.action.spotlight/custom_field.create'), new_exhibit_custom_field_path(@exhibit))
16
16
  end
17
17
 
18
18
  def edit
19
- add_breadcrumb @custom_field.label, edit_exhibit_custom_field_path(@custom_field.exhibit, @custom_field)
19
+ add_breadcrumb(@custom_field.label, edit_exhibit_custom_field_path(@custom_field.exhibit, @custom_field))
20
20
  end
21
21
 
22
22
  def create
@@ -50,9 +50,9 @@ module Spotlight
50
50
  protected
51
51
 
52
52
  def attach_breadcrumbs
53
- add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit
54
- add_breadcrumb t(:'spotlight.configuration.sidebar.header'), exhibit_dashboard_path(@exhibit)
55
- add_breadcrumb t(:'spotlight.metadata_configurations.edit.header'), edit_exhibit_metadata_configuration_path(@exhibit)
53
+ add_breadcrumb(t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit)
54
+ add_breadcrumb(t(:'spotlight.configuration.sidebar.header'), exhibit_dashboard_path(@exhibit))
55
+ add_breadcrumb(t(:'spotlight.metadata_configurations.edit.header'), edit_exhibit_metadata_configuration_path(@exhibit))
56
56
  end
57
57
 
58
58
  def custom_field_params
@@ -11,12 +11,12 @@ module Spotlight
11
11
 
12
12
  # GET /custom_search_fields/new
13
13
  def new
14
- add_breadcrumb t(:'helpers.action.spotlight/custom_search_field.create'), new_exhibit_custom_search_field_path(@exhibit)
14
+ add_breadcrumb(t(:'helpers.action.spotlight/custom_search_field.create'), new_exhibit_custom_search_field_path(@exhibit))
15
15
  end
16
16
 
17
17
  # GET /custom_search_fields/1/edit
18
18
  def edit
19
- add_breadcrumb @custom_search_field.label, edit_exhibit_custom_search_field_path(@custom_search_field.exhibit, @custom_search_field)
19
+ add_breadcrumb(@custom_search_field.label, edit_exhibit_custom_search_field_path(@custom_search_field.exhibit, @custom_search_field))
20
20
  end
21
21
 
22
22
  # POST /custom_search_fields
@@ -52,9 +52,9 @@ module Spotlight
52
52
  private
53
53
 
54
54
  def attach_breadcrumbs
55
- add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit
56
- add_breadcrumb t(:'spotlight.configuration.sidebar.header'), exhibit_dashboard_path(@exhibit)
57
- add_breadcrumb t(:'spotlight.configuration.sidebar.search_configuration'), edit_exhibit_search_configuration_path(@exhibit)
55
+ add_breadcrumb(t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit)
56
+ add_breadcrumb(t(:'spotlight.configuration.sidebar.header'), exhibit_dashboard_path(@exhibit))
57
+ add_breadcrumb(t(:'spotlight.configuration.sidebar.search_configuration'), edit_exhibit_search_configuration_path(@exhibit))
58
58
  end
59
59
 
60
60
  # Only allow trusted parameters through.
@@ -46,13 +46,13 @@ module Spotlight
46
46
  protected
47
47
 
48
48
  def attach_analytics_breadcrumbs
49
- add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit
50
- add_breadcrumb t(:'spotlight.curation.sidebar.analytics'), analytics_exhibit_dashboard_path(@exhibit)
49
+ add_breadcrumb(t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit)
50
+ add_breadcrumb(t(:'spotlight.curation.sidebar.analytics'), analytics_exhibit_dashboard_path(@exhibit))
51
51
  end
52
52
 
53
53
  def attach_dashboard_breadcrumbs
54
- add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit
55
- add_breadcrumb t(:'spotlight.curation.sidebar.dashboard'), exhibit_dashboard_path(@exhibit)
54
+ add_breadcrumb(t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit)
55
+ add_breadcrumb(t(:'spotlight.curation.sidebar.dashboard'), exhibit_dashboard_path(@exhibit))
56
56
  end
57
57
 
58
58
  def load_recent_solr_documents(count)
@@ -34,8 +34,8 @@ module Spotlight
34
34
 
35
35
  def new
36
36
  build_initial_exhibit_contact_emails
37
- add_breadcrumb t(:'spotlight.sites.home'), root_url
38
- add_breadcrumb t(:'spotlight.exhibits.new.page_title')
37
+ add_breadcrumb(t(:'spotlight.sites.home'), root_url)
38
+ add_breadcrumb(t(:'spotlight.exhibits.new.page_title'))
39
39
  end
40
40
 
41
41
  def process_import
@@ -47,9 +47,9 @@ module Spotlight
47
47
  end
48
48
 
49
49
  def edit
50
- add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit
51
- add_breadcrumb t(:'spotlight.configuration.sidebar.header'), exhibit_dashboard_path(@exhibit)
52
- add_breadcrumb t(:'spotlight.configuration.sidebar.settings'), edit_exhibit_path(@exhibit)
50
+ add_breadcrumb(t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit)
51
+ add_breadcrumb(t(:'spotlight.configuration.sidebar.header'), exhibit_dashboard_path(@exhibit))
52
+ add_breadcrumb(t(:'spotlight.configuration.sidebar.settings'), edit_exhibit_path(@exhibit))
53
53
  build_initial_exhibit_contact_emails
54
54
  end
55
55
 
@@ -94,6 +94,7 @@ module Spotlight
94
94
  :description,
95
95
  :published,
96
96
  :tag_list,
97
+ tag_list: [],
97
98
  contact_emails_attributes: %i[id email],
98
99
  languages_attributes: %i[id public]
99
100
  )
@@ -26,15 +26,15 @@ module Spotlight
26
26
  end
27
27
 
28
28
  def attach_page_breadcrumbs
29
- add_breadcrumb t(:'spotlight.curation.sidebar.feature_pages'), exhibit_feature_pages_path(@exhibit) if action_name == 'edit'
29
+ add_breadcrumb(t(:'spotlight.curation.sidebar.feature_pages'), exhibit_feature_pages_path(@exhibit)) if action_name == 'edit'
30
30
 
31
- add_breadcrumb @page.parent_page.title, [spotlight, @page.exhibit, @page.parent_page] unless @page.top_level_page?
32
- add_breadcrumb @page.title, action_name == 'edit' ? [:edit, @page.exhibit, @page] : [spotlight, @page.exhibit, @page]
31
+ add_breadcrumb(@page.parent_page.title, [spotlight, @page.exhibit, @page.parent_page]) unless @page.top_level_page?
32
+ add_breadcrumb(@page.title, action_name == 'edit' ? [:edit, @page.exhibit, @page] : [spotlight, @page.exhibit, @page])
33
33
  end
34
34
 
35
35
  def attach_index_breadcrumbs
36
- add_breadcrumb t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(@exhibit)
37
- add_breadcrumb t(:'spotlight.curation.sidebar.feature_pages'), exhibit_feature_pages_path(@exhibit)
36
+ add_breadcrumb(t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(@exhibit))
37
+ add_breadcrumb(t(:'spotlight.curation.sidebar.feature_pages'), exhibit_feature_pages_path(@exhibit))
38
38
  end
39
39
 
40
40
  def update_all_page_params
@@ -7,7 +7,7 @@ module Spotlight
7
7
 
8
8
  def create
9
9
  if @featured_image.save && @featured_image.file_present?
10
- render json: { tilesource: tilesource, id: @featured_image.id }
10
+ render json: { tilesource:, id: @featured_image.id }
11
11
  else
12
12
  render json: { error: 'unable to create image' }, status: :bad_request
13
13
  end
@@ -50,7 +50,7 @@ module Spotlight
50
50
  else
51
51
  t(:'helpers.submit.group.batch_error', model: human_name)
52
52
  end
53
- redirect_to spotlight.exhibit_searches_path(anchor: 'browse-groups'), notice: notice
53
+ redirect_to spotlight.exhibit_searches_path(anchor: 'browse-groups'), notice:
54
54
  end
55
55
 
56
56
  protected
@@ -27,8 +27,8 @@ module Spotlight
27
27
  end
28
28
 
29
29
  def edit
30
- add_breadcrumb t(:'spotlight.curation.sidebar.feature_pages'), exhibit_feature_pages_path(@exhibit)
31
- add_breadcrumb @page.title, [:edit, @exhibit, @page]
30
+ add_breadcrumb(t(:'spotlight.curation.sidebar.feature_pages'), exhibit_feature_pages_path(@exhibit))
31
+ add_breadcrumb(@page.title, [:edit, @exhibit, @page])
32
32
  super
33
33
  end
34
34
 
@@ -9,9 +9,9 @@ module Spotlight
9
9
 
10
10
  # GET /:exhibit_id/job_trackers/1
11
11
  def show
12
- add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit
13
- add_breadcrumb t(:'spotlight.curation.sidebar.dashboard'), exhibit_dashboard_path(@exhibit)
14
- add_breadcrumb t(:'spotlight.configuration.sidebar.job_trackers'), [@job_tracker.on, @job_tracker]
12
+ add_breadcrumb(t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit)
13
+ add_breadcrumb(t(:'spotlight.curation.sidebar.dashboard'), exhibit_dashboard_path(@exhibit))
14
+ add_breadcrumb(t(:'spotlight.configuration.sidebar.job_trackers'), [@job_tracker.on, @job_tracker])
15
15
  end
16
16
  end
17
17
  end
@@ -18,9 +18,9 @@ module Spotlight
18
18
  end
19
19
 
20
20
  def edit
21
- add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit
22
- add_breadcrumb t(:'spotlight.configuration.sidebar.header'), exhibit_dashboard_path(@exhibit)
23
- add_breadcrumb t(:'spotlight.configuration.sidebar.metadata'), edit_exhibit_metadata_configuration_path(@exhibit)
21
+ add_breadcrumb(t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit)
22
+ add_breadcrumb(t(:'spotlight.configuration.sidebar.header'), exhibit_dashboard_path(@exhibit))
23
+ add_breadcrumb(t(:'spotlight.configuration.sidebar.metadata'), edit_exhibit_metadata_configuration_path(@exhibit))
24
24
  end
25
25
 
26
26
  def update
@@ -93,7 +93,7 @@ module Spotlight
93
93
  else
94
94
  t(:'helpers.submit.page.batch_error', model: human_name)
95
95
  end
96
- redirect_back fallback_location: spotlight.exhibit_dashboard_path(@exhibit), notice: notice
96
+ redirect_back fallback_location: spotlight.exhibit_dashboard_path(@exhibit), notice:
97
97
  end
98
98
 
99
99
  def clone
@@ -162,7 +162,7 @@ module Spotlight
162
162
 
163
163
  def attach_breadcrumbs
164
164
  if view_context.current_page? '/'
165
- add_breadcrumb t(:'spotlight.curation.nav.home', title: current_exhibit.title), main_app.root_path
165
+ add_breadcrumb(t(:'spotlight.curation.nav.home', title: current_exhibit.title), main_app.root_path)
166
166
  elsif @page
167
167
  # Use curator-accessible i18n key for user-facing breadcrumb
168
168
  breadcrumb_to_exhibit_root(:'spotlight.curation.nav.home')
@@ -187,7 +187,7 @@ module Spotlight
187
187
  end
188
188
 
189
189
  def breadcrumb_to_exhibit_root(key)
190
- add_breadcrumb t(key, title: current_exhibit.title), spotlight.exhibit_root_path(current_exhibit)
190
+ add_breadcrumb(t(key, title: current_exhibit.title), spotlight.exhibit_root_path(current_exhibit))
191
191
  end
192
192
 
193
193
  # Only allow trusted parameters through.
@@ -36,7 +36,7 @@ module Spotlight
36
36
  end
37
37
 
38
38
  def data_param_keys
39
- Spotlight::Resources::Upload.fields(current_exhibit).map(&:field_name) + current_exhibit.custom_fields.map(&:field)
39
+ Spotlight::Resources::Upload.fields(current_exhibit).map(&:field_name) + current_exhibit.custom_fields.map(&:slug)
40
40
  end
41
41
 
42
42
  # Gets an IO-like object for the CSV parser to use.
@@ -15,10 +15,10 @@ module Spotlight
15
15
  helper_method :resource_class
16
16
 
17
17
  def new
18
- add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), exhibit_root_path(@exhibit)
19
- add_breadcrumb t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(@exhibit)
20
- add_breadcrumb t(:'spotlight.curation.sidebar.items'), admin_exhibit_catalog_path(@exhibit)
21
- add_breadcrumb t(:'spotlight.resources.new.header'), new_exhibit_resource_path(@exhibit)
18
+ add_breadcrumb(t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), exhibit_root_path(@exhibit))
19
+ add_breadcrumb(t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(@exhibit))
20
+ add_breadcrumb(t(:'spotlight.curation.sidebar.items'), admin_exhibit_catalog_path(@exhibit))
21
+ add_breadcrumb(t(:'spotlight.resources.new.header'), new_exhibit_resource_path(@exhibit))
22
22
 
23
23
  render
24
24
  end