blacklight-spotlight 3.0.0.rc4 → 3.0.0.rc5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/blacklight/close.svg +1 -0
  3. data/app/assets/images/blacklight/zoom_in.svg +1 -0
  4. data/app/assets/images/blacklight/zoom_out.svg +1 -0
  5. data/app/assets/javascripts/spotlight/admin/blocks/uploaded_items_block.js +8 -1
  6. data/app/assets/javascripts/spotlight/admin/catalog_edit.js +13 -47
  7. data/app/assets/javascripts/spotlight/admin/exhibit_tag_autocomplete.js +37 -0
  8. data/app/assets/javascripts/spotlight/admin/{reindex_monitor.js → progress_monitor.js} +25 -4
  9. data/app/assets/javascripts/spotlight/admin/sir-trevor/locales.js +1 -1
  10. data/app/assets/javascripts/spotlight/user/zpr_links.js.erb +29 -14
  11. data/app/assets/stylesheets/spotlight/_browse.scss +8 -0
  12. data/app/assets/stylesheets/spotlight/_catalog.scss +30 -4
  13. data/app/assets/stylesheets/spotlight/_exhibit_admin.scss +9 -0
  14. data/app/assets/stylesheets/spotlight/_modals.scss +3 -0
  15. data/app/assets/stylesheets/spotlight/_nestable.scss +8 -0
  16. data/app/assets/stylesheets/spotlight/_spotlight.scss +2 -0
  17. data/app/assets/stylesheets/spotlight/_view_larger.scss +22 -0
  18. data/app/assets/stylesheets/spotlight/typeahead.css +23 -23
  19. data/app/builders/spotlight/bootstrap_breadcrumbs_builder.rb +4 -2
  20. data/app/controllers/concerns/spotlight/catalog.rb +7 -1
  21. data/app/controllers/spotlight/browse_controller.rb +5 -0
  22. data/app/controllers/spotlight/bulk_actions_controller.rb +62 -0
  23. data/app/controllers/spotlight/bulk_updates_controller.rb +67 -0
  24. data/app/controllers/spotlight/catalog_controller.rb +5 -7
  25. data/app/controllers/spotlight/dashboards_controller.rb +2 -1
  26. data/app/controllers/spotlight/featured_images_controller.rb +1 -1
  27. data/app/controllers/spotlight/job_trackers_controller.rb +17 -0
  28. data/app/controllers/spotlight/tags_controller.rb +39 -5
  29. data/app/helpers/spotlight/application_helper.rb +1 -1
  30. data/app/helpers/spotlight/job_trackers_helper.rb +31 -0
  31. data/app/helpers/spotlight/pages_helper.rb +0 -7
  32. data/app/helpers/spotlight/roles_helper.rb +1 -1
  33. data/app/jobs/concerns/spotlight/gather_documents.rb +35 -0
  34. data/app/jobs/concerns/spotlight/job_tracking.rb +40 -23
  35. data/app/jobs/spotlight/add_tags_job.rb +31 -0
  36. data/app/jobs/spotlight/add_uploads_from_csv.rb +2 -4
  37. data/app/jobs/spotlight/change_visibility_job.rb +33 -0
  38. data/app/jobs/spotlight/process_bulk_updates_csv_job.rb +82 -0
  39. data/app/jobs/spotlight/reindex_exhibit_job.rb +5 -2
  40. data/app/jobs/spotlight/reindex_job.rb +35 -23
  41. data/app/jobs/spotlight/remove_tags_job.rb +31 -0
  42. data/app/jobs/spotlight/rename_sidecar_field_job.rb +1 -0
  43. data/app/jobs/spotlight/rename_tags_job.rb +33 -0
  44. data/app/models/concerns/spotlight/exhibit_analytics.rb +2 -6
  45. data/app/models/concerns/spotlight/exhibit_documents.rb +2 -2
  46. data/app/models/concerns/spotlight/resources/web.rb +1 -1
  47. data/app/models/concerns/spotlight/solr_document.rb +1 -1
  48. data/app/models/concerns/spotlight/solr_document/atomic_updates.rb +2 -2
  49. data/app/models/concerns/spotlight/user.rb +5 -1
  50. data/app/models/sir_trevor_rails/blocks/uploaded_items_block.rb +4 -0
  51. data/app/models/spotlight/ability.rb +6 -2
  52. data/app/models/spotlight/attachment.rb +1 -1
  53. data/app/models/spotlight/{reindex_progress.rb → background_job_progress.rb} +8 -7
  54. data/app/models/spotlight/blacklight_configuration.rb +17 -6
  55. data/app/models/spotlight/bulk_update.rb +8 -0
  56. data/app/models/spotlight/exhibit.rb +2 -1
  57. data/app/models/spotlight/feature_page.rb +0 -2
  58. data/app/models/spotlight/featured_image.rb +7 -1
  59. data/app/models/spotlight/field_metadata.rb +4 -8
  60. data/app/models/spotlight/job_tracker.rb +11 -2
  61. data/app/models/spotlight/page.rb +1 -3
  62. data/app/models/spotlight/resource.rb +4 -4
  63. data/app/models/spotlight/resources/iiif_harvester.rb +2 -2
  64. data/app/models/spotlight/resources/iiif_service.rb +8 -1
  65. data/app/models/spotlight/resources/upload.rb +2 -2
  66. data/app/models/spotlight/role.rb +1 -2
  67. data/app/presenters/spotlight/iiif_manifest_presenter.rb +1 -1
  68. data/app/services/spotlight/bulk_updates_csv_template_service.rb +93 -0
  69. data/app/services/spotlight/etl/executor.rb +1 -3
  70. data/app/services/spotlight/iiif_resource_resolver.rb +1 -1
  71. data/app/uploaders/spotlight/bulk_updates_uploader.rb +7 -0
  72. data/app/uploaders/spotlight/featured_image_uploader.rb +1 -1
  73. data/app/views/catalog/_add_tags.html.erb +28 -0
  74. data/app/views/catalog/_bulk_actions.html.erb +12 -0
  75. data/app/views/catalog/_change_visibility.html.erb +35 -0
  76. data/app/views/catalog/_curator_actions.html.erb +3 -0
  77. data/app/views/catalog/_remove_tags.html.erb +37 -0
  78. data/app/views/spotlight/bulk_updates/_download.html.erb +23 -0
  79. data/app/views/spotlight/bulk_updates/_overview.html.erb +1 -0
  80. data/app/views/spotlight/bulk_updates/_progress_panel.html.erb +19 -0
  81. data/app/views/spotlight/bulk_updates/_upload.html.erb +12 -0
  82. data/app/views/spotlight/bulk_updates/edit.html.erb +37 -0
  83. data/app/views/spotlight/catalog/_admin_header.html.erb +1 -1
  84. data/app/views/spotlight/catalog/_edit_default.html.erb +2 -2
  85. data/app/views/spotlight/catalog/_reindex_progress_panel.html.erb +1 -1
  86. data/app/views/spotlight/custom_fields/_form.html.erb +1 -1
  87. data/app/views/spotlight/custom_search_fields/_form.html.erb +1 -1
  88. data/app/views/spotlight/dashboards/_reindexing_activity.html.erb +1 -1
  89. data/app/views/spotlight/exhibits/_exhibit_card.html.erb +1 -1
  90. data/app/views/spotlight/job_trackers/show.html.erb +79 -0
  91. data/app/views/spotlight/pages/_form.html.erb +2 -2
  92. data/app/views/spotlight/resources/_form.html.erb +1 -1
  93. data/app/views/spotlight/resources/csv_upload/_form.html.erb +1 -1
  94. data/app/views/spotlight/resources/iiif/_form.html.erb +1 -1
  95. data/app/views/spotlight/resources/json_upload/_form.html.erb +2 -2
  96. data/app/views/spotlight/resources/upload/_form.html.erb +1 -1
  97. data/app/views/spotlight/shared/_curation_sidebar.html.erb +3 -0
  98. data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +3 -3
  99. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +3 -3
  100. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +2 -2
  101. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +2 -2
  102. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +2 -2
  103. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +4 -0
  104. data/app/views/spotlight/tags/_tag.html.erb +24 -0
  105. data/app/views/spotlight/tags/index.html.erb +12 -16
  106. data/app/views/spotlight/translations/show.yaml.yamlbuilder +6 -0
  107. data/config/i18n-tasks.yml +1 -0
  108. data/config/locales/spotlight.en.yml +169 -10
  109. data/config/routes.rb +28 -1
  110. data/db/migrate/20210126123041_create_events.rb +1 -1
  111. data/db/migrate/20210305070001_remove_class_from_sirtrevor_image_blocks.rb +20 -0
  112. data/db/migrate/20210305171150_create_bulk_updates.rb +9 -0
  113. data/lib/generators/spotlight/templates/config/initializers/riiif.rb +7 -5
  114. data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +1 -1
  115. data/lib/generators/spotlight/templates/solr/config/schema.xml +1 -1
  116. data/lib/migration/iiif.rb +3 -3
  117. data/lib/spotlight/engine.rb +14 -0
  118. data/lib/spotlight/version.rb +1 -1
  119. data/spec/controllers/spotlight/bulk_actions_controller_spec.rb +124 -0
  120. data/spec/controllers/spotlight/bulk_updates_controller_spec.rb +77 -0
  121. data/spec/controllers/spotlight/catalog_controller_spec.rb +12 -12
  122. data/spec/controllers/spotlight/featured_images_controller_spec.rb +3 -3
  123. data/spec/controllers/spotlight/job_trackers_controller_spec.rb +37 -0
  124. data/spec/controllers/spotlight/tags_controller_spec.rb +5 -1
  125. data/spec/examples.txt +1495 -1443
  126. data/spec/factories/bulk_updates.rb +15 -0
  127. data/spec/factories/exhibits.rb +4 -0
  128. data/spec/factories/job_trackers.rb +2 -0
  129. data/spec/factories/users.rb +27 -8
  130. data/spec/features/add_items_spec.rb +1 -1
  131. data/spec/features/bulk_actions_spec.rb +72 -0
  132. data/spec/features/catalog_spec.rb +1 -0
  133. data/spec/features/import_exhibit_spec.rb +5 -1
  134. data/spec/features/javascript/blocks/solr_documents_block_spec.rb +3 -3
  135. data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +27 -1
  136. data/spec/features/site_users_management_spec.rb +4 -4
  137. data/spec/fixtures/bulk-update-template.csv +57 -0
  138. data/spec/fixtures/updated-bulk-update-template-w-tags.csv +4 -0
  139. data/spec/fixtures/updated-bulk-update-template.csv +4 -0
  140. data/spec/helpers/spotlight/application_helper_spec.rb +0 -1
  141. data/spec/helpers/spotlight/pages_helper_spec.rb +0 -15
  142. data/spec/helpers/spotlight/roles_helper_spec.rb +1 -1
  143. data/spec/i18n_spec.rb +1 -0
  144. data/spec/jobs/spotlight/add_tags_job_spec.rb +34 -0
  145. data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +4 -1
  146. data/spec/jobs/spotlight/change_visibility_job_spec.rb +30 -0
  147. data/spec/jobs/spotlight/process_bulk_updates_csv_job_spec.rb +78 -0
  148. data/spec/jobs/spotlight/reindex_job_spec.rb +4 -1
  149. data/spec/jobs/spotlight/remove_tags_job_spec.rb +39 -0
  150. data/spec/lib/migration/iiif_spec.rb +1 -1
  151. data/spec/models/spotlight/ability_spec.rb +27 -0
  152. data/spec/models/spotlight/{reindex_progress_spec.rb → background_job_progress_spec.rb} +15 -2
  153. data/spec/models/spotlight/blacklight_configuration_spec.rb +8 -3
  154. data/spec/models/spotlight/exhibit_spec.rb +1 -1
  155. data/spec/models/spotlight/featured_image_spec.rb +1 -1
  156. data/spec/models/spotlight/resource_spec.rb +23 -0
  157. data/spec/models/spotlight/solr_document/atomic_updates_spec.rb +10 -0
  158. data/spec/services/spotlight/bulk_updates_csv_template_service_spec.rb +26 -0
  159. data/spec/test_app_templates/Gemfile.extra +1 -0
  160. data/spec/uploaders/spotlight/featured_image_uploader_spec.rb +2 -2
  161. data/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb +1 -1
  162. data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +2 -0
  163. data/spec/views/spotlight/job_trackers/show.html.erb_spec.rb +65 -0
  164. data/spec/views/spotlight/tags/index.html.erb_spec.rb +5 -2
  165. metadata +80 -17
  166. data/app/assets/images/blacklight/add_circle.svg +0 -1
  167. data/app/assets/images/blacklight/custom_fullscreen.svg +0 -1
  168. data/app/assets/images/blacklight/remove_circle.svg +0 -1
  169. data/app/assets/images/blacklight/resize_small.svg +0 -1
@@ -2,7 +2,7 @@
2
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') %>
3
3
  <div class="form-actions">
4
4
  <div class="primary-actions">
5
- <%= cancel_link @resource, :back, class: 'btn btn-secondary' %>
5
+ <%= cancel_link @resource, :back, class: 'btn-sizing' %>
6
6
  <%= f.submit t('.add_item'), class: 'btn btn-primary' %>
7
7
  </div>
8
8
  </div>
@@ -2,7 +2,7 @@
2
2
  <%= f.text_field :url, help: t('.url-field.help'), label: t('.manifest') %>
3
3
  <div class="form-actions">
4
4
  <div class="primary-actions">
5
- <%= cancel_link @resource, :back, class: 'btn btn-secondary' %>
5
+ <%= cancel_link @resource, :back, class: 'btn-sizing' %>
6
6
  <%= f.submit t('.add_item'), class: 'btn btn-primary' %>
7
7
  </div>
8
8
  </div>
@@ -3,7 +3,7 @@
3
3
  <%= f.url_field :json, type: "file", label: t('.file_label') %>
4
4
  <div class="form-actions">
5
5
  <div class="primary-actions">
6
- <%= cancel_link @resource, :back, class: 'btn btn-secondary' %>
6
+ <%= cancel_link @resource, :back, class: 'btn-sizing' %>
7
7
  <%= f.submit t('.add_item'), class: 'btn btn-primary' %>
8
8
  </div>
9
9
  </div>
@@ -12,4 +12,4 @@
12
12
  <div class="alert alert-info">
13
13
  Uploading raw documents is restricted to site administrators.
14
14
  </div>
15
- <% end %>
15
+ <% end %>
@@ -12,7 +12,7 @@
12
12
  <div class="form-actions">
13
13
  <div class="primary-actions">
14
14
  <%= hidden_field_tag :tab, 'upload' %>
15
- <%= cancel_link @resource, :back, class: 'btn btn-secondary' %>
15
+ <%= cancel_link @resource, :back, class: 'btn-sizing' %>
16
16
  <%= f.submit t('.add_item_and_continue'), name: 'add-and-continue', class: 'btn btn-secondary' %>
17
17
  <%= f.submit t('.add_item'), class: 'btn btn-primary' %>
18
18
  </div>
@@ -17,4 +17,7 @@
17
17
  <% if (can? :manage, current_exhibit.translations.first_or_initialize) && current_exhibit.languages.any? %>
18
18
  <%= nav_link t(:'spotlight.curation.sidebar.translations'), spotlight.edit_exhibit_translations_path(current_exhibit), 'data-no-turbolink' => true %>
19
19
  <% end %>
20
+ <% if can? :bulk_update, current_exhibit %>
21
+ <%= nav_link t(:'spotlight.curation.sidebar.bulk_updates'), spotlight.edit_exhibit_bulk_updates_path(current_exhibit), 'data-no-turbolink' => true %>
22
+ <% end %>
20
23
  </ul>
@@ -2,9 +2,9 @@
2
2
  <% browse_group_categories_block.groups.each do |group| %>
3
3
  <div class="browse-group-categories-block" data-browse-group-categories-count="<%= group.searches.count %>">
4
4
  <div class="d-flex flex-column flex-md-row py-2">
5
- <div class="d-flex justify-content-between align-items-end">
5
+ <div class="d-flex justify-content-between align-items-baseline">
6
6
  <h2 class="m-0"><%= group.title %></h2>
7
- <div class="pl-5">
7
+ <div class="pl-3">
8
8
  <%= link_to t(:'.view_all'), exhibit_browse_groups_path(current_exhibit, group) %>
9
9
  </div>
10
10
  </div>
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
  <div class="spotlight-flexbox browse-categories categories-<%= [group.searches.count, (@page.display_sidebar? ? 3 : 4)].min %>" data-browse-group-categories-carousel data-sidebar='<%= @page.display_sidebar? %>' data-browse-group-categories-count="<%= group.searches.count %>">
23
23
  <% group.searches.published.each_with_index do |search, index| %>
24
- <div class="box category-1 justify-content-center justify-content-md-start">
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
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 %>")'>
27
27
  <div class="category-caption">
@@ -9,9 +9,9 @@
9
9
  <div class="box" data-id="<%= document.id %>">
10
10
  <div class="contents">
11
11
  <% if block_options[:thumbnail_image_url].present? %>
12
- <%= link_to_document(document, image_tag(block_options[:thumbnail_image_url], class: 'img-thumbnail', alt: doc_presenter.heading), counter: -1) %>
12
+ <%= link_to_document(document, image_tag(block_options[:thumbnail_image_url], class: 'img-thumbnail', alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
13
13
  <% elsif block_options[:iiif_tilesource_base].present? %>
14
- <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!400,400/0/default.jpg', class: 'img-thumbnail', alt: doc_presenter.heading), counter: -1) %>
14
+ <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!400,400/0/default.jpg', class: 'img-thumbnail', alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
15
15
  <% elsif has_thumbnail? document %>
16
16
  <%= render_thumbnail_tag(document, { class: 'img-thumbnail', alt: doc_presenter.heading }, document_counter: -1) %>
17
17
  <% end %>
@@ -26,7 +26,7 @@
26
26
  </div>
27
27
  <% end %>
28
28
  <% if solr_documents_block.zpr_link? && block_options[:iiif_tilesource].present? %>
29
- <button class="btn btn-secondary zpr-link" data-iiif-tilesource="<%= block_options[:iiif_tilesource] %>">Show in ZPR viewer</button>
29
+ <button class="btn btn-secondary zpr-link" data-iiif-tilesource="<%= block_options[:iiif_tilesource] %>"><%= t('.zpr_link_html', title: doc_presenter.heading) %></button>
30
30
  <% end %>
31
31
  </div>
32
32
  </div>
@@ -9,9 +9,9 @@
9
9
  <% doc_presenter = index_presenter(document) %>
10
10
  <div class="carousel-item <%= 'active' if index == 0 %>" data-id="<%= document.id %>">
11
11
  <% if block_options[:full_image_url].present? %>
12
- <%= link_to_document(document, image_tag(block_options[:full_image_url], alt: doc_presenter.heading), counter: -1) %>
12
+ <%= link_to_document(document, image_tag(block_options[:full_image_url], alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
13
13
  <% elsif block_options[:iiif_tilesource_base].present? %>
14
- <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!800,800/0/default.jpg', alt: doc_presenter.heading), counter: -1) %>
14
+ <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!800,800/0/default.jpg', alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
15
15
  <% elsif has_thumbnail? document %>
16
16
  <%= render_thumbnail_tag(document, { alt: doc_presenter.heading }, document_counter: -1) %>
17
17
  <% end %>
@@ -12,9 +12,9 @@
12
12
  <% doc_presenter = index_presenter(document) %>
13
13
  <div class="carousel-item <%= 'active' if index == 0 %>" data-id="<%= document.id %>">
14
14
  <% if block_options[:full_image_url].present? %>
15
- <%= link_to_document(document, image_tag(block_options[:full_image_url], alt: doc_presenter.heading), counter: -1) %>
15
+ <%= link_to_document(document, image_tag(block_options[:full_image_url], alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
16
16
  <% elsif block_options[:iiif_tilesource_base].present? %>
17
- <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!800,800/0/default.jpg', alt: doc_presenter.heading), counter: -1) %>
17
+ <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!800,800/0/default.jpg', alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
18
18
  <% elsif has_thumbnail? document %>
19
19
  <%= render_thumbnail_tag(document, { alt: doc_presenter.heading }, document_counter: -1) %>
20
20
  <% end %>
@@ -6,9 +6,9 @@
6
6
  <% doc_presenter = index_presenter(document) %>
7
7
  <div class="box item-<%= index %>" data-id="<%= document.id %>">
8
8
  <% if block_options[:thumbnail_image_url].present? %>
9
- <%= link_to_document(document, image_tag(block_options[:thumbnail_image_url], class: 'img-thumbnail', alt: doc_presenter.heading), counter: -1) %>
9
+ <%= link_to_document(document, image_tag(block_options[:thumbnail_image_url], class: 'img-thumbnail', alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
10
10
  <% elsif block_options[:iiif_tilesource_base].present? %>
11
- <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!400,400/0/default.jpg', class: 'img-thumbnail', alt: doc_presenter.heading), counter: -1) %>
11
+ <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!400,400/0/default.jpg', class: 'img-thumbnail', alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
12
12
  <% elsif has_thumbnail? document %>
13
13
  <%= render_thumbnail_tag(document, { class: 'img-thumbnail', alt: doc_presenter.heading }, document_counter: -1) %>
14
14
  <% end %>
@@ -16,6 +16,10 @@
16
16
  <%= file[:caption] %>
17
17
  </div>
18
18
  <% end %>
19
+
20
+ <% if uploaded_items_block.zpr_link? %>
21
+ <%= button_tag t('.zpr_link_html', title: file[:caption]), class: 'btn btn-secondary zpr-link', data: { 'iiif-tilesource' => { type: 'image', url: file[:url] }.to_json } %>
22
+ <% end %>
19
23
  </div>
20
24
  </div>
21
25
  <% end %>
@@ -0,0 +1,24 @@
1
+ <% tag = f.object %>
2
+
3
+ <%= render layout: 'spotlight/shared/dd3_item', locals: { id: tag.id.to_s, field: f, dd3_content_classes: "tag" , enabled_method: :present?, label_method: :name, label: tag.name } do |_, section| %>
4
+ <% case section when nil %>
5
+ <div class="d-flex flex-grow-1">
6
+ <div class="flex-grow-1 mx-2 main">
7
+ <h4 class="card-title h6 mb-0" data-in-place-edit-target=".edit-in-place" data-in-place-edit-field-target="[data-edit-field-target='true']">
8
+ <a href="#edit-in-place" class="field-label edit-in-place"><%= tag.name %></a>
9
+ <%= f.hidden_field :name, value: tag.name , class: 'form-control form-control-sm title-field', data: {:"edit-field-target" => 'true'} %>
10
+ </h4>
11
+
12
+ <div class="card-text">
13
+ <div class=""><%= t 'spotlight.tags.index.taggings.count', count: tag.taggings.count %> &bull; <%= link_to t(:'helpers.action.view'), url_to_tag_facet(tag.name) %></div>
14
+ <%= f.hidden_field :current_name, value: tag.name %>
15
+
16
+ </div>
17
+ </div>
18
+ <div class="flex m-2">
19
+ <div class="card-text">
20
+ <%= delete_link(tag, exhibit_tag_path(current_exhibit, tag), class: 'btn btn-danger btn-sm') %>
21
+ </div>
22
+ </div>
23
+ <% end %>
24
+ <% end %>
@@ -7,21 +7,17 @@
7
7
  <% if @tags.empty? %>
8
8
  <p><%= t :'.no_tags' %></p>
9
9
  <% else %>
10
- <table class="table table-striped tags">
11
- <thead>
12
- <th><%= t '.name' %></th>
13
- <th><%= t '.taggings.count' %></th>
14
- <%# TODO last used? %>
15
- <th><%= t '.actions' %></th>
16
- </thead>
17
- <tbody>
18
- <% @tags.each do |tag| %>
19
- <tr>
20
- <td><%= link_to tag.name, url_to_tag_facet(tag.name) %></td>
21
- <td><%= tag.taggings.count %></td>
22
- <td><%= delete_link(tag, exhibit_tag_path(current_exhibit, tag), class: 'btn btn-danger btn-sm') %></td>
23
- </tr>
10
+ <%= bootstrap_form_for @exhibit, url: update_all_exhibit_tags_path(@exhibit), layout: :horizontal, control_col: 'col-sm-10' do |f| %>
11
+ <ul class="dd-list">
12
+ <% @tags.each_with_index do |tag, index| %>
13
+ <%= f.fields_for :owned_tags_attributes, tag, index: index do |p| %>
14
+ <%= render partial: 'tag', locals: { f: p } %>
15
+ <% end %>
16
+ </ul>
17
+ <% end %>
18
+
19
+ <div class="float-right">
20
+ <%= submit_tag t(:'helpers.action.update_all'), class: "btn btn-primary" %>
21
+ </div>
24
22
  <% end %>
25
- </tbody>
26
- </table>
27
23
  <% end %>
@@ -71,6 +71,12 @@ json.set!(locale) do
71
71
  end
72
72
  end
73
73
 
74
+ current_exhibit.groups.each do |group|
75
+ json.set!(group.slug) do
76
+ json.title group.translated_title(default: '')
77
+ end
78
+ end
79
+
74
80
  current_exhibit.searches.each do |search|
75
81
  json.set!(search.slug) do
76
82
  json.title search.translated_title(default: '')
@@ -83,6 +83,7 @@ ignore_unused:
83
83
  - helpers.action.destroy # no idea here
84
84
  - helpers.action.spotlight/search.destroy # I think it might be used by #action_default_value
85
85
  - helpers.submit.contact_form.create # /shrug
86
+ - spotlight.bulk_actions.{add_tags,change_visibility,remove_tags}.changed.* # app/controllers/spotlight/bulk_actions_controller.rb
86
87
 
87
88
  <% I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
88
89
  patterns: [
@@ -152,6 +152,10 @@ en:
152
152
  spotlight_default:
153
153
  updated: The %{model} was successfully updated.
154
154
  submit: Save changes
155
+ tags:
156
+ batch_updated:
157
+ one: Renaming %{count} tag
158
+ other: Renaming %{count} tags
155
159
  update: Save changes
156
160
  locales:
157
161
  ar: Arabic
@@ -165,12 +169,6 @@ en:
165
169
  pt-BR: Portuguese - Brazil
166
170
  sq: Albanian
167
171
  zh: Chinese
168
- reindexing_log:
169
- status:
170
- completed: Successful
171
- enqueued: Not yet started
172
- failed: Failed
173
- in_progress: In progress
174
172
  shared:
175
173
  site_sidebar:
176
174
  documentation: Curator documentation
@@ -237,6 +235,130 @@ en:
237
235
  zero_results:
238
236
  expand_html: You can <a href="%{clear_search_url}"> clear this search</a> or try <a href="%{expand_search_url}">searching all exhibit items for "%{browse_query}"</a>.
239
237
  result_number: Your search did not match any items in this browse category.
238
+ bulk_actions:
239
+ add: Add
240
+ add_tags:
241
+ changed:
242
+ one: Tags are being added for %{count} item.
243
+ other: Tags are being added for %{count} items.
244
+ description:
245
+ one: There is %{count} item in the current search result set. Tags entered below will be added to this item. This action won’t affect any tags already assigned to this item.
246
+ other: There are %{count} items in the current search result set. Tags entered below will be added to all %{count} items in the result set. This action won’t affect any tags already assigned to these items.
247
+ heading: Add tags
248
+ label: Enter tags to add
249
+ change: Change
250
+ change_visibility:
251
+ changed:
252
+ one: Visibility of %{count} item is being updated.
253
+ other: Visibility of %{count} items is being updated.
254
+ description:
255
+ one: There is %{count} item in the current search result set. A visibility change will be applied to this item.
256
+ other: There are %{count} items in the current search result set. A visibility change will be applied to all items in the result set.
257
+ heading: Change item visibility
258
+ label: Item visibility
259
+ private: Private
260
+ public: Public
261
+ confirm: All items in the result set will be updated. Are you sure?
262
+ label: Bulk actions
263
+ remove: Remove
264
+ remove_tags:
265
+ assigned: Currently assigned tags
266
+ changed:
267
+ one: Tags are being removed for %{count} item.
268
+ other: Tags are being removed for %{count} items.
269
+ description_html:
270
+ one: "<p>There is %{count} item in the current search result set. Tags shown below are assigned to this item.</p><p>When you remove a tag below it will be unassigned from this item.</p>"
271
+ other: "<p>There are %{count} items in the current search result set. Tags shown below are assigned to one or more of those items.</p><p>When you remove a tag below it will be unassigned from any item in the result set to which that tag is currently assigned.</p>"
272
+ heading: Remove tags
273
+ label: Enter tags to remove
274
+ bulk_updates:
275
+ download:
276
+ guidelines_html: |
277
+ <h2>Guidelines for CSV updates</h2>
278
+ <p class="instructions">
279
+ The downloadable CSV file for this exhibit contains one line for each item in the exhibit. Each line contains one or more comma-separated values. Although you can update the CSV file directly, we strongly recommended importing it into a spreadsheet application and making your updates there. The rest of these guidelines assume you are making updates in a spreadsheet.
280
+ </p>
281
+ <p class="instructions">
282
+ Note that the more lines there are in the completed CSV file that you upload, the longer the updates will take to process. If your exhibit contains more than a few thousand items, after importing the CSV file into a spreadsheet application, you should consider removing the rows of items you do not intend to update. This will also make it easier to focus on the items you do intend to update.
283
+ </p>
284
+ <h3>Column headers</h3>
285
+ <p class="instructions">
286
+ Do not edit the column headers. These are used to match property values to existing exhibit item fields.
287
+ </p>
288
+
289
+ <h3>Reference fields</h3>
290
+ <p class="instructions">
291
+ Do not edit the reference fields. These are intended to help you identify items whose updatable fields you might want to change. Updates to the reference fields will not be processed.
292
+ </p>
293
+
294
+ <p class="instructions">
295
+ If you are making a lot of updates, we recommended you use the protect or lock feature of your spreadsheet application to lock the reference field columns and ensure you don’t inadvertently edit them.
296
+ </p>
297
+
298
+ <h3>Updatable fields</h3>
299
+ <dl>
300
+ <dt>Visibility</dt>
301
+ <dd>Valid values are <em>public</em> (expressed as <samp>TRUE</samp>) and <em>private</em> (blank value).</dd>
302
+
303
+ <dt>Tags</dt>
304
+ <dd>
305
+ <p class="instructions">
306
+ If you chose to include tags in the CSV file, there will be a column in the spreadsheet for each existing tag in the exhibit, prefixed with <samp>Tag:</samp>, such as <samp>Tag: apples</samp>. (If you want to add to items a tag that does not yet exist, you must first add that tag to at least one item (by editing an item or using the Bulk actions feature on a search result set of items) before downloading the CSV file.)
307
+ </p>
308
+
309
+ <p class="instructions">
310
+ To assign a tag to an exhibit item, the value of the <samp>Tag:</samp> column for that item must be <samp>TRUE</samp>. A blank value in the <samp>Tag:</samp> column for an item means that tag is not assigned to that item.
311
+ </p>
312
+
313
+ <p class="instructions">
314
+ To remove a tag currently assigned to an item, remove the <samp>TRUE</samp> value from the appropriate <samp>Tag:</samp> column for that item.
315
+ </p>
316
+ </dd>
317
+ </dl>
318
+ instructions_html: A CSV file listing each item in this exhibit will be generated with the reference and updatable fields you specify below. <i>Reference fields</i> are intended to help you identify items that you intend to update. <i>Updatable fields</i> are the fields for which you can update values (see guidelines below).
319
+ item_id: Item ID
320
+ item_title: Item title
321
+ reference_fields:
322
+ heading: Reference fields
323
+ submit: Download CSV file
324
+ tags: Tags
325
+ updatable_fields:
326
+ heading: Updatable fields
327
+ visibility: Visibility
328
+ edit:
329
+ download:
330
+ heading: Download CSV
331
+ header: Bulk updates
332
+ overview:
333
+ heading: Overview
334
+ upload:
335
+ heading: Upload CSV
336
+ overview:
337
+ instructions_html: |
338
+ <p>You can update in bulk several properties of items in this exhibit:</p> <ul>
339
+ <li>Visibility</li>
340
+ <li>Tags</li>
341
+ </ul> <p>The steps to making bulk updates are:</p> <ol>
342
+ <li>Download a CSV (comma-separated values) file from the Download CSV tab above. The downloaded CSV file will contain a row for every item in this exhibit. Each row contains the unique ID of an exhibit item along with the values of the reference and updatable fields you specify.</li>
343
+ <li>Import the CSV file into a new spreadsheet, using an application such as a Google Sheets or Excel.</li>
344
+ <li>In the new spreadsheet, update the values for the updatable fields of exhibit items you want to change. When you’ve finished making updates, save the spreadsheet.</li>
345
+ <li>(Optional) Remove the rows for items that contain no updated values. This is not required but for exhibits with many items this can speed up the import process. If necessary, save the spreadsheet.</li>
346
+ <li>Download/export the updated spreadsheet to your computer as a .csv file.</li>
347
+ <li>Use the Upload CSV tab above to submit the updated file for processing.</li>
348
+ </ol>
349
+ progress_panel:
350
+ begin_html: Began CSV processing
351
+ completed_html: Completed CSV processing
352
+ error: An error occured while processing the CSV. Contact your exhibits administrator for more information.
353
+ heading: CSV processing status
354
+ update:
355
+ error: There was a problem uploading your CSV.
356
+ submitted: The CSV file was uploaded successfully.
357
+ upload:
358
+ file_label: Upload CSV file
359
+ form_help: The uploaded file must have a ".csv" extension
360
+ instructions: After you've saved updates to a CSV file, use the Upload CSV file action below to submit it for processing.
361
+ submit: Upload
240
362
  catalog:
241
363
  admin:
242
364
  header: Items
@@ -264,13 +386,14 @@ en:
264
386
  exhibit_visibility:
265
387
  label: Item visibility
266
388
  private: Private
389
+ public: Public
267
390
  fields:
268
391
  date_added: Date added
269
392
  title: Title
270
393
  visibility: Public
271
394
  reindex_progress_panel:
272
395
  begin_html: Began reindexing a total of <span data-behavior='total'></span> items.
273
- completed_html: Reindexed <span data-behavior='completed'></span> of <span data-behavior='total'></span> items.
396
+ current_html: Reindexed <span data-behavior='completed'></span> of <span data-behavior='total'></span> items.
274
397
  error: An error occured while reindexing. Contact your exhibits administrator for more information.
275
398
  heading: Reindexing status
276
399
  configuration:
@@ -278,6 +401,7 @@ en:
278
401
  sidebar:
279
402
  appearance: Appearance
280
403
  header: Configuration
404
+ job_trackers: Job status
281
405
  metadata: Metadata
282
406
  search_configuration: Search
283
407
  settings: General
@@ -319,6 +443,7 @@ en:
319
443
  about_pages: About pages
320
444
  analytics: Analytics
321
445
  browse: Browse
446
+ bulk_updates: Bulk updates
322
447
  dashboard: Dashboard
323
448
  feature_pages: Feature pages
324
449
  header: Curation
@@ -512,6 +637,37 @@ en:
512
637
  someone_invited_you: The Exhibits Administrator has invited you to help work on the "%{exhibit_name}" exhibit.
513
638
  subject: Invitation to manage \"%{exhibit_name}\"
514
639
  visit: Visit exhibit
640
+ job_trackers:
641
+ show:
642
+ headers:
643
+ details: Details
644
+ message: Message
645
+ messages:
646
+ created_by: job created by %{user}
647
+ errors:
648
+ one: "(%{count} error)"
649
+ other: "(%{count} errors)"
650
+ progress: processed %{progress} / %{total}
651
+ started: job started
652
+ status:
653
+ completed: job completed
654
+ enqueued: job enqueued
655
+ failed: job failed
656
+ in_progress: ''
657
+ missing: "(missing status)"
658
+ pending: job pending
659
+ summary:
660
+ completed: Completed %{last_updated} ago in %{duration}
661
+ enqueued: In progress for %{created_at}
662
+ failed: Failed %{last_updated} ago in %{duration}
663
+ in_progress: In progress for %{created_at}
664
+ status:
665
+ completed: Successful
666
+ enqueued: Not yet started
667
+ failed: Failed
668
+ in_progress: In progress
669
+ missing: Unknown
670
+ pending: Pending
515
671
  main_navigation:
516
672
  about: About
517
673
  browse: Browse
@@ -600,6 +756,7 @@ en:
600
756
  role:
601
757
  admin: Admin
602
758
  curator: Curator
759
+ viewer: Viewer
603
760
  roles:
604
761
  edit_fields:
605
762
  help: Enter a valid email address
@@ -770,6 +927,10 @@ en:
770
927
  items:
771
928
  one: "%{count} item"
772
929
  other: "%{count} items"
930
+ solr_documents_block:
931
+ zpr_link_html: View <span class="sr-only">%{title}</span> larger
932
+ uploaded_items_block:
933
+ zpr_link_html: View <span class="sr-only">%{title}</span> larger
773
934
  sites:
774
935
  edit:
775
936
  basic_settings:
@@ -789,12 +950,10 @@ en:
789
950
  home: Exhibits
790
951
  tags:
791
952
  index:
792
- actions: Actions
793
953
  header: Tags
794
- name: Tag name
795
954
  no_tags: No items in this exhibit have been tagged. You can add tags to an item on the item details page while in curation mode.
796
955
  taggings:
797
- count: Items tagged
956
+ count: 'Items tagged: %{count}'
798
957
  topbar:
799
958
  label: Utilities
800
959
  translations: