blacklight-spotlight 5.3.2 → 6.0.0.rc2

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 (211) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +41 -4
  3. data/Rakefile +1 -2
  4. data/app/assets/javascripts/spotlight/spotlight.esm.js +2168 -4560
  5. data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
  6. data/app/assets/javascripts/spotlight/spotlight.js +2167 -4559
  7. data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
  8. data/app/assets/stylesheets/spotlight/_blacklight_overrides.scss +4 -0
  9. data/app/assets/stylesheets/spotlight/_browse.scss +0 -4
  10. data/app/assets/stylesheets/spotlight/{_collapse_toggle.scss → _collapse_toggle.css} +2 -2
  11. data/app/assets/stylesheets/spotlight/_exhibit_admin.scss +8 -0
  12. data/app/assets/stylesheets/spotlight/_exhibits_index.scss +2 -1
  13. data/app/assets/stylesheets/spotlight/_footer.scss +2 -2
  14. data/app/assets/stylesheets/spotlight/_header.scss +8 -8
  15. data/app/assets/stylesheets/spotlight/_pages.scss +1 -1
  16. data/app/assets/stylesheets/spotlight/_slideshow_block.scss +15 -0
  17. data/app/assets/stylesheets/spotlight/_spotlight.scss +1 -1
  18. data/app/assets/stylesheets/spotlight/_translations.scss +3 -3
  19. data/app/assets/stylesheets/spotlight/_uploaded_items_block.css +7 -0
  20. data/app/assets/stylesheets/spotlight/_variables.css +15 -0
  21. data/app/assets/stylesheets/spotlight/browse_group_categories_block.scss +0 -76
  22. data/app/components/blacklight/icons/pause_component.rb +15 -0
  23. data/app/components/blacklight/icons/play_arrow_component.rb +15 -0
  24. data/app/components/spotlight/analytics/dashboard_component.html.erb +1 -1
  25. data/app/components/spotlight/custom_field_form_group_component.rb +40 -0
  26. data/app/components/spotlight/document_admin_table_component.html.erb +2 -2
  27. data/app/components/spotlight/edit_sidecar_component.html.erb +18 -0
  28. data/app/components/spotlight/edit_sidecar_component.rb +41 -0
  29. data/app/components/spotlight/masthead_component.html.erb +18 -0
  30. data/app/components/spotlight/masthead_component.rb +46 -0
  31. data/app/components/spotlight/save_search_component.html.erb +1 -1
  32. data/app/components/spotlight/sidecar_form_field_component.html.erb +18 -0
  33. data/app/components/spotlight/sidecar_form_field_component.rb +71 -0
  34. data/app/components/spotlight/solr_document_legacy_embed_component.html.erb +0 -4
  35. data/app/components/spotlight/solr_document_legacy_embed_component.rb +2 -2
  36. data/app/components/spotlight/tag_selector_component.html.erb +1 -1
  37. data/app/components/spotlight/tag_selector_component.rb +3 -2
  38. data/app/components/spotlight/upload_field_form_group_component.rb +33 -0
  39. data/app/controllers/concerns/spotlight/controller.rb +15 -14
  40. data/app/controllers/concerns/spotlight/search_helper.rb +2 -5
  41. data/app/controllers/spotlight/browse_controller.rb +1 -6
  42. data/app/controllers/spotlight/catalog_controller.rb +2 -3
  43. data/app/controllers/spotlight/concerns/application_controller.rb +4 -6
  44. data/app/controllers/spotlight/exhibits_controller.rb +22 -10
  45. data/app/controllers/spotlight/lock_controller.rb +1 -1
  46. data/app/controllers/spotlight/pages_controller.rb +11 -11
  47. data/app/controllers/spotlight/resources/upload_controller.rb +1 -1
  48. data/app/controllers/spotlight/resources_controller.rb +1 -1
  49. data/app/controllers/spotlight/solr_controller.rb +5 -1
  50. data/app/helpers/spotlight/application_helper.rb +14 -26
  51. data/app/helpers/spotlight/crud_link_helpers.rb +0 -12
  52. data/app/helpers/spotlight/main_app_helpers.rb +2 -2
  53. data/app/javascript/spotlight/admin/add_another.js +37 -25
  54. data/app/javascript/spotlight/admin/add_image_selector.js +43 -26
  55. data/app/javascript/spotlight/admin/add_new_button.js +51 -36
  56. data/app/javascript/spotlight/admin/blacklight_configuration.js +76 -54
  57. data/app/javascript/spotlight/admin/block_mixins/autocompleteable.js +102 -101
  58. data/app/javascript/spotlight/admin/block_mixins/formable.js +91 -75
  59. data/app/javascript/spotlight/admin/block_mixins/plustextable.js +46 -48
  60. data/app/javascript/spotlight/admin/blocks/block.js +27 -28
  61. data/app/javascript/spotlight/admin/blocks/browse_block.js +14 -10
  62. data/app/javascript/spotlight/admin/blocks/browse_group_categories_block.js +14 -10
  63. data/app/javascript/spotlight/admin/blocks/pages_block.js +5 -4
  64. data/app/javascript/spotlight/admin/blocks/resources_block.js +61 -41
  65. data/app/javascript/spotlight/admin/blocks/search_result_block.js +24 -7
  66. data/app/javascript/spotlight/admin/blocks/solr_documents_base_block.js +103 -50
  67. data/app/javascript/spotlight/admin/blocks/solr_documents_carousel_block.js +50 -26
  68. data/app/javascript/spotlight/admin/blocks/solr_documents_features_block.js +47 -23
  69. data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +35 -19
  70. data/app/javascript/spotlight/admin/crop.js +146 -66
  71. data/app/javascript/spotlight/admin/croppable.js +5 -4
  72. data/app/javascript/spotlight/admin/croppable_modal.js +67 -32
  73. data/app/javascript/spotlight/admin/edit_in_place.js +69 -54
  74. data/app/javascript/spotlight/admin/exhibits.js +92 -45
  75. data/app/javascript/spotlight/admin/form_observer.js +92 -78
  76. data/app/javascript/spotlight/admin/multi_image_selector.js +201 -153
  77. data/app/javascript/spotlight/admin/pages.js +13 -7
  78. data/app/javascript/spotlight/admin/progress_monitor.js +65 -50
  79. data/app/javascript/spotlight/admin/readonly_checkbox.js +7 -3
  80. data/app/javascript/spotlight/admin/search_typeahead.js +20 -11
  81. data/app/javascript/spotlight/admin/select_related_input.js +23 -23
  82. data/app/javascript/spotlight/admin/serialize_json.js +120 -0
  83. data/app/javascript/spotlight/admin/sir-trevor/block_controls.js +24 -11
  84. data/app/javascript/spotlight/admin/sir-trevor/block_limits.js +9 -6
  85. data/app/javascript/spotlight/admin/sir-trevor/locales.js +2 -2
  86. data/app/javascript/spotlight/admin/spotlight_nestable.js +2 -5
  87. data/app/javascript/spotlight/admin/translation_progress.js +18 -13
  88. data/app/javascript/spotlight/admin/users.js +151 -64
  89. data/app/javascript/spotlight/user/carousel.js +104 -32
  90. data/app/javascript/spotlight/user/clear_form_button.js +24 -14
  91. data/app/javascript/spotlight/user/index.js +0 -2
  92. data/app/javascript/spotlight/user/zpr_links.js +99 -40
  93. data/app/jobs/concerns/spotlight/gather_documents.rb +1 -1
  94. data/app/jobs/spotlight/add_uploads_from_csv.rb +31 -8
  95. data/app/jobs/spotlight/cleanup_job_trackers_job.rb +5 -3
  96. data/app/models/concerns/spotlight/access_controls_enforcement_search_builder.rb +13 -2
  97. data/app/models/concerns/spotlight/browse_category_search_builder.rb +3 -3
  98. data/app/models/concerns/spotlight/exhibit_documents.rb +2 -2
  99. data/app/models/concerns/spotlight/sitemap.rb +2 -2
  100. data/app/models/concerns/spotlight/solr_document/finder.rb +2 -2
  101. data/app/models/concerns/spotlight/solr_document.rb +1 -47
  102. data/app/models/sir_trevor_rails/blocks/browse_block.rb +0 -4
  103. data/app/models/sir_trevor_rails/blocks/solr_documents_block.rb +2 -1
  104. data/app/models/spotlight/blacklight_configuration.rb +5 -3
  105. data/app/models/spotlight/contact_email.rb +2 -2
  106. data/app/models/spotlight/custom_field.rb +17 -0
  107. data/app/models/spotlight/exhibit.rb +28 -0
  108. data/app/models/spotlight/featured_image.rb +1 -1
  109. data/app/models/spotlight/field_metadata.rb +10 -5
  110. data/app/models/spotlight/job_tracker.rb +0 -18
  111. data/app/models/spotlight/main_navigation.rb +2 -2
  112. data/app/models/spotlight/page.rb +3 -3
  113. data/app/models/spotlight/resources/iiif_harvester.rb +7 -4
  114. data/app/models/spotlight/resources/iiif_manifest.rb +0 -4
  115. data/app/models/spotlight/resources/iiif_manifest_metadata.rb +1 -3
  116. data/app/models/spotlight/resources/iiif_service.rb +21 -6
  117. data/app/models/spotlight/resources/upload.rb +6 -0
  118. data/app/models/spotlight/search.rb +5 -9
  119. data/app/models/spotlight/solr_document_sidecar.rb +18 -0
  120. data/app/services/spotlight/bulk_updates_csv_template_service.rb +1 -1
  121. data/app/services/spotlight/etl/pipeline.rb +2 -2
  122. data/app/services/spotlight/etl/step.rb +2 -2
  123. data/app/views/catalog/_remove_tags.html.erb +2 -2
  124. data/app/views/layouts/spotlight/base.html.erb +3 -6
  125. data/app/views/layouts/spotlight/spotlight.html.erb +2 -2
  126. data/app/views/shared/_analytics.html.erb +4 -3
  127. data/app/views/shared/_masthead.html.erb +2 -18
  128. data/app/views/spotlight/about_pages/_empty.html.erb +1 -1
  129. data/app/views/spotlight/about_pages/_sidebar.html.erb +10 -8
  130. data/app/views/spotlight/browse/_search.html.erb +2 -2
  131. data/app/views/spotlight/browse/_search_box.html.erb +6 -14
  132. data/app/views/spotlight/browse/index.html.erb +1 -1
  133. data/app/views/spotlight/browse/show.html.erb +1 -1
  134. data/app/views/spotlight/catalog/_document_admin_table.html.erb +1 -1
  135. data/app/views/spotlight/catalog/_edit_default.html.erb +1 -1
  136. data/app/views/spotlight/catalog/edit.html.erb +1 -1
  137. data/app/views/spotlight/dashboards/_page.html.erb +1 -1
  138. data/app/views/spotlight/exhibits/_exhibit_card.html.erb +3 -1
  139. data/app/views/spotlight/exhibits/_export.html.erb +17 -1
  140. data/app/views/spotlight/exhibits/_form.html.erb +20 -4
  141. data/app/views/spotlight/exhibits/_missing_exhibits.html.erb +3 -3
  142. data/app/views/spotlight/exhibits/index.html.erb +21 -8
  143. data/app/views/spotlight/feature_pages/_empty.html.erb +1 -1
  144. data/app/views/spotlight/feature_pages/_sidebar.html.erb +17 -15
  145. data/app/views/spotlight/home_pages/_empty.html.erb +7 -7
  146. data/app/views/spotlight/pages/show.html.erb +1 -0
  147. data/app/views/spotlight/resources/upload/_form.html.erb +2 -2
  148. data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +5 -16
  149. data/app/views/spotlight/sir_trevor/blocks/_embedded_document.html.erb +3 -5
  150. data/app/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb +1 -1
  151. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +11 -2
  152. data/app/views/spotlight/sites/_exhibit.html.erb +1 -1
  153. data/config/i18n-tasks.yml +1 -1
  154. data/config/locales/spotlight.ar.yml +1 -2
  155. data/config/locales/spotlight.de.yml +1 -2
  156. data/config/locales/spotlight.en.yml +39 -10
  157. data/config/locales/spotlight.es.yml +1 -2
  158. data/config/locales/spotlight.fr.yml +1 -2
  159. data/config/locales/spotlight.it.yml +1 -2
  160. data/config/locales/spotlight.ja.yml +39 -0
  161. data/config/locales/spotlight.zh.yml +1 -2
  162. data/db/migrate/20261007133748_add_discovery_enabled_to_spotlight_exhibits.rb +5 -0
  163. data/lib/generators/spotlight/assets/importmap_generator.rb +2 -10
  164. data/lib/generators/spotlight/assets/propshaft_generator.rb +5 -4
  165. data/lib/generators/spotlight/install_generator.rb +2 -4
  166. data/lib/generators/spotlight/templates/catalog_controller.rb +0 -1
  167. data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +26 -4
  168. data/lib/generators/spotlight/templates/solr/conf/schema.xml +4 -3
  169. data/lib/generators/spotlight/templates/solr/conf/solrconfig.xml +3 -8
  170. data/lib/migration/page_language.rb +0 -2
  171. data/lib/spotlight/engine.rb +28 -9
  172. data/lib/spotlight/search_state.rb +7 -11
  173. data/lib/spotlight/upload_field_config.rb +19 -1
  174. data/lib/spotlight/version.rb +1 -1
  175. data/lib/spotlight.rb +1 -1
  176. data/spec/support/features/capybara_wait_metadata_helper.rb +3 -1
  177. data/spec/support/features/test_features_helpers.rb +24 -1
  178. data/spec/support/iiif_manifest_fixtures.rb +33 -0
  179. data/spec/support/stub_dns_resolution.rb +12 -0
  180. metadata +50 -80
  181. data/app/assets/stylesheets/spotlight/_uploaded_items_block.scss +0 -7
  182. data/app/assets/stylesheets/spotlight/_variables.scss +0 -13
  183. data/app/components/blacklight/icons/arrow_alt_circle_left_component.rb +0 -15
  184. data/app/components/blacklight/icons/arrow_alt_circle_right_component.rb +0 -15
  185. data/app/components/blacklight/icons/info_component.rb +0 -15
  186. data/app/components/blacklight/icons/zoom_in_component.rb +0 -15
  187. data/app/components/blacklight/icons/zoom_out_component.rb +0 -15
  188. data/app/components/spotlight/icon_component.rb +0 -13
  189. data/app/javascript/spotlight/user/browse_group_categories.js +0 -54
  190. data/app/mailers/spotlight/invitation_mailer.rb +0 -21
  191. data/app/models/concerns/spotlight/resources/web.rb +0 -38
  192. data/app/services/spotlight/iiif_resource_resolver.rb +0 -78
  193. data/app/views/catalog/_image_default.html.erb +0 -6
  194. data/app/views/shared/_exhibit_navbar.html.erb +0 -2
  195. data/app/views/shared/_header_navbar.html.erb +0 -6
  196. data/app/views/spotlight/catalog/_admin_index_header_default.html.erb +0 -23
  197. data/app/views/spotlight/catalog/_admin_thumbnail_default.html.erb +0 -7
  198. data/app/views/spotlight/catalog/_curation_mode_toggle_default.html.erb +0 -1
  199. data/app/views/spotlight/catalog/_document_row.html.erb +0 -2
  200. data/app/views/spotlight/catalog/_edit_sidecar.html.erb +0 -24
  201. data/app/views/spotlight/catalog/_index_compact_default.html.erb +0 -21
  202. data/app/views/spotlight/custom_fields/form_group/_text.html.erb +0 -23
  203. data/app/views/spotlight/custom_fields/form_group/_vocab.html.erb +0 -23
  204. data/app/views/spotlight/invitation_mailer/exhibit_invitation_notification.html.erb +0 -12
  205. data/lib/generators/spotlight/templates/javascript/jquery-shim.js +0 -1
  206. data/vendor/assets/javascripts/tiny-slider.js +0 -3221
  207. data/vendor/assets/stylesheets/tiny-slider.css +0 -1
  208. /data/app/assets/stylesheets/spotlight/{_breadcrumbs.scss → _breadcrumbs.css} +0 -0
  209. /data/app/assets/stylesheets/spotlight/{_croppable.scss → _croppable.css} +0 -0
  210. /data/app/assets/stylesheets/spotlight/{_modals.scss → _modals.css} +0 -0
  211. /data/app/assets/stylesheets/spotlight/{_utilities.scss → _utilities.css} +0 -0
@@ -11,3 +11,7 @@
11
11
  font-size: $font-size-sm;
12
12
  }
13
13
  }
14
+
15
+ .btn .blacklight-icons {
16
+ fill: var(--bs-btn-color);
17
+ }
@@ -155,8 +155,4 @@ $image-overlay-max-height: 300px;
155
155
  z-index: 30;
156
156
  }
157
157
  }
158
-
159
- .browse-search-expand {
160
- text-align: center;
161
- }
162
158
  }
@@ -1,5 +1,5 @@
1
- // Rotate collapse-chevron element (has a ❯ in it)
2
- // with the previous siblings collapsed status
1
+ /* Rotate collapse-chevron element (has a ❯ in it)
2
+ with the previous siblings collapsed status */
3
3
  .btn.collapse-toggle {
4
4
  & + .collapse-chevron {
5
5
  display: inline-block;
@@ -90,3 +90,11 @@
90
90
  .leaflet-top, .leaflet-bottom {
91
91
  z-index: 950;
92
92
  }
93
+
94
+ .export-config-enabled {
95
+ fill: green;
96
+ }
97
+
98
+ .export-config-disabled {
99
+ fill: red;
100
+ }
@@ -4,7 +4,8 @@ $exhibit-card-overlay-padding: $card-img-overlay-padding * 0.5 !default;
4
4
  overflow-y: hidden;
5
5
  padding-bottom: 3rem;
6
6
 
7
- .unpublished {
7
+ .unpublished,
8
+ .previewable {
8
9
  @extend .mx-auto;
9
10
  display: block;
10
11
  font-size: $font-size-sm;
@@ -1,12 +1,12 @@
1
1
  .site-footer {
2
2
  background-color: $gray-700;
3
3
  color: $gray-600;
4
- margin-top: $footer-top-margin;
4
+ margin-top: var(--footer-top-margin);
5
5
  padding: 10px;
6
6
 
7
7
  // Styles below keep footer at bottom of viewport
8
8
  position: absolute;
9
9
  bottom: 0;
10
- height: $footer-height;
10
+ height: var(--footer-height);
11
11
  width: 100%;
12
12
  }
@@ -12,7 +12,7 @@
12
12
  }
13
13
 
14
14
  .masthead {
15
- background-color: $masthead-bg;
15
+ background-color: var(--masthead-bg);
16
16
  border-bottom: 1px solid $border-color;
17
17
  margin-bottom: $spacer * 1.5;
18
18
  padding: 0;
@@ -42,7 +42,7 @@
42
42
  }
43
43
 
44
44
  .navbar {
45
- border-bottom: 1px solid $navbar-transparent-border;
45
+ border-bottom: 1px solid var(--navbar-transparent-border);
46
46
  border-top: 0;
47
47
  margin-bottom: 0;
48
48
  }
@@ -60,7 +60,7 @@
60
60
  @extend .px-4;
61
61
  @extend .py-2;
62
62
 
63
- max-height: $masthead-height - $navbar-brand-height;
63
+ max-height: calc(var(--masthead-height) - (1.25rem * var(--bs-body-line-height)));
64
64
  }
65
65
 
66
66
  .image-masthead {
@@ -68,7 +68,7 @@
68
68
 
69
69
  .exhibit-navbar {
70
70
  @extend .navbar-dark;
71
- background-color: $navbar-transparent-page-bg;
71
+ background-color: var(--navbar-transparent-page-bg);
72
72
 
73
73
  .navbar-nav {
74
74
  text-transform: uppercase;
@@ -100,14 +100,14 @@
100
100
 
101
101
  // Add small amount of blur to help text stand out
102
102
  //filter: url(masthead/blur.svg#blur); // for older versions of FF
103
- -webkit-filter: blur($masthead-image-blur);
104
- filter: blur($masthead-image-blur);
103
+ -webkit-filter: blur(var(--masthead-image-blur));
104
+ filter: blur(var(--masthead-image-blur));
105
105
 
106
106
  height: 100%;
107
107
 
108
108
  // Shift image slightly to hide blurred edge of image
109
- margin-left: -$masthead-image-blur;
110
- margin-top: -$masthead-image-blur;
109
+ margin-left: calc(-1 * var(--masthead-image-blur));
110
+ margin-top: calc(-1 * var(--masthead-image-blur));
111
111
  overflow: hidden;
112
112
  }
113
113
 
@@ -198,7 +198,7 @@
198
198
  .empty-page-block {
199
199
  @extend .alert;
200
200
  @extend .alert-info;
201
- margin-top: $spacer;
201
+
202
202
  h2 {
203
203
  margin-top: 0;
204
204
  }
@@ -1,5 +1,20 @@
1
1
  .carousel-block {
2
2
 
3
+ .carousel-pause-play {
4
+ position: absolute;
5
+ top: $spacer * .5;
6
+ right: $spacer * .5;
7
+ z-index: 3; // above .carousel-control-prev/next and .carousel-indicators
8
+ display: inline-flex;
9
+ align-items: center;
10
+ padding: $spacer * .25;
11
+ opacity: .8;
12
+
13
+ &:hover, &:focus {
14
+ opacity: 1;
15
+ }
16
+ }
17
+
3
18
  .carousel-inner > .carousel-item > a > img {
4
19
  // center and fill the image
5
20
  margin-left: auto;
@@ -43,5 +43,5 @@ html {
43
43
  min-height: 100%;
44
44
  }
45
45
  body {
46
- margin-bottom: $footer-height + $footer-top-margin;
46
+ margin-bottom: calc(var(--footer-height) + var(--footer-top-margin));
47
47
  }
@@ -1,6 +1,6 @@
1
1
  .translation-edit-form {
2
2
  .translation-complete {
3
- svg { fill: $translation-available-color }
3
+ svg { fill: var(--translation-available-color) }
4
4
  }
5
5
 
6
6
  .browse-category-title {
@@ -51,11 +51,11 @@
51
51
  }
52
52
 
53
53
  .panel-translation {
54
- background-color: $translation-panel-bg;
54
+ background-color: var(--translation-panel-bg);
55
55
  padding-bottom: 0;
56
56
 
57
57
  .form-text {
58
- color: $translation-help-color;
58
+ color: var(--translation-help-color);
59
59
  padding-left: 12px;
60
60
  }
61
61
  }
@@ -0,0 +1,7 @@
1
+ [data-type='uploaded_items'] {
2
+ /* SirTrevor's Uploadable mixin adds a
3
+ styled div that we need to remove */
4
+ .st-block__inputs {
5
+ display: none;
6
+ }
7
+ }
@@ -0,0 +1,15 @@
1
+ :root {
2
+ --footer-top-margin: 3rem;
3
+ --footer-height: 7.5rem;
4
+
5
+ --masthead-bg: var(--bs-body-bg);
6
+ --masthead-height: 11.25rem;
7
+ --masthead-image-blur: 1px;
8
+ --navbar-transparent-border: var(--bs-gray-500);
9
+ --navbar-transparent-page-bg: rgba(0, 0, 0, 0.5);
10
+
11
+ /* Translations */
12
+ --translation-available-color: #80bf77;
13
+ --translation-panel-bg: #f5f5f5;
14
+ --translation-help-color: #555;
15
+ }
@@ -1,80 +1,4 @@
1
- @import "../../../../vendor/assets/stylesheets/tiny-slider";
2
-
3
1
  .browse-group-categories-block {
4
2
  padding-bottom: $spacer * .75;
5
3
  padding-top: $spacer * .75;
6
-
7
- .browse-categories .browse-category {
8
- .category-caption {
9
- z-index: 100;
10
- }
11
- }
12
-
13
- .spotlight-flexbox.browse-categories .box {
14
- display: flex;
15
- }
16
-
17
- .browse-group-categories-controls {
18
- list-style: none;
19
- li {
20
- display: inline-block;
21
- cursor: pointer;
22
- }
23
-
24
- .blacklight-icons-arrow-alt-circle-left, .blacklight-icons-arrow-alt-circle-right {
25
- display: inline-block;
26
- fill: $gray-600;
27
- height: 44px;
28
- width: 44px;
29
-
30
- &:hover,&:focus {
31
- fill: $gray-700;
32
- }
33
- }
34
-
35
- li[aria-disabled="true"] {
36
- cursor: auto;
37
- }
38
-
39
- [aria-disabled="true"] {
40
- .blacklight-icons-arrow-alt-circle-left, .blacklight-icons-arrow-alt-circle-right {
41
- fill: $gray-400;
42
-
43
- &:hover,&:focus {
44
- fill: $gray-400;
45
- }
46
- }
47
- }
48
- }
49
-
50
- // Coming from tiny-slider, make sure these disappear when navigating via turbolinks
51
- .tns-controls {
52
- display: none;
53
- }
54
-
55
- @media screen and (min-width: breakpoint-min("md")) {
56
- .browse-group-categories-controls {
57
- .blacklight-icons-arrow-alt-circle-left, .blacklight-icons-arrow-alt-circle-right {
58
- height: 32px;
59
- width: 32px;
60
- }
61
- }
62
-
63
- &[data-browse-group-categories-count="2"],&[data-browse-group-categories-count="3"] {
64
- .browse-group-categories-controls {
65
- display: none !important;
66
- }
67
- }
68
- }
69
- }
70
-
71
- [dir="rtl"] {
72
- .browse-group-categories-block .blacklight-icons-arrow-alt-circle-left, .blacklight-icons-arrow-alt-circle-right{
73
- transform: rotate(180deg);
74
- }
75
- // Hack to override overflow issue not fixed in RTL upstream in tiny-slider
76
- .tns-visually-hidden {
77
- left: 0;
78
- right: -10000em;
79
- }
80
4
  }
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Blacklight
4
+ module Icons
5
+ # Icon for Pause
6
+ class PauseComponent < Blacklight::Icons::IconComponent
7
+ self.svg = <<~SVG
8
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24" fill="currentColor">
9
+ <path d="M0 0h24v24H0z" fill="none"/>
10
+ <path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/>
11
+ </svg>
12
+ SVG
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Blacklight
4
+ module Icons
5
+ # Icon for PlayArrow
6
+ class PlayArrowComponent < Blacklight::Icons::IconComponent
7
+ self.svg = <<~SVG
8
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24" fill="currentColor">
9
+ <path d="M0 0h24v24H0z" fill="none"/>
10
+ <path d="M8 5v14l11-7z"/>
11
+ </svg>
12
+ SVG
13
+ end
14
+ end
15
+ end
@@ -24,7 +24,7 @@
24
24
  <%= render Spotlight::Analytics::AggregationComponent.new(data: search_analytics.totals, exclude_fields: [:eventCount] ) %>
25
25
 
26
26
  <% unless page_analytics.rows.empty? %>
27
- <h3 class="h5 mt-4"><%= I18n.t("spotlight.dashboards.analytics.pages.header") %></h4>
27
+ <h3 class="h5 mt-4"><%= I18n.t("spotlight.dashboards.analytics.pages.header") %></h3>
28
28
  <table class="table table-striped popular-pages">
29
29
  <thead>
30
30
  <tr>
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ # Renders an exhibit custom field on the catalog edit and upload forms through its configured component
5
+ class CustomFieldFormGroupComponent < ViewComponent::Base
6
+ attr_reader :form, :field, :value, :inline
7
+
8
+ def initialize(form:, field:, value: nil, inline: false)
9
+ @form = form
10
+ @field = field
11
+ @value = value
12
+ @inline = inline
13
+ super()
14
+ end
15
+
16
+ def call
17
+ return render_deprecated_partial if deprecated_partial?
18
+
19
+ render field.component.new(form:, id: field.slug, label: field.label, value:, field_type: field.form_field_type,
20
+ multiple: field.is_multiple?, readonly: field.readonly_field?, inline:)
21
+ end
22
+
23
+ private
24
+
25
+ # Applications could previously customize custom field inputs by overriding these partials
26
+ def deprecated_partial
27
+ "spotlight/custom_fields/form_group/#{field.field_type}"
28
+ end
29
+
30
+ def deprecated_partial?
31
+ helpers.lookup_context.exists?(deprecated_partial, [], true)
32
+ end
33
+
34
+ def render_deprecated_partial
35
+ Spotlight.deprecator.warn "Rendering deprecated partial #{deprecated_partial}. " \
36
+ 'Configure a component in Spotlight::Engine.config.custom_field_types instead'
37
+ render(partial: deprecated_partial, locals: { inline:, f: form, field:, value: })
38
+ end
39
+ end
40
+ end
@@ -15,9 +15,9 @@
15
15
  <td>
16
16
  <%# header bar for doc items in index view -%>
17
17
  <div class="documentHeader row" data-label-toggle="<%= @document.id %>">
18
- <h5 class="index_title col-md-12">
18
+ <h3 class="index_title col-md-12 h5">
19
19
  <%= helpers.link_to_document(presenter.document, itemprop: 'name') %>
20
- </h5>
20
+ </h3>
21
21
  </div>
22
22
 
23
23
  <div class="page-links">
@@ -0,0 +1,18 @@
1
+ <%= form.fields_for :sidecar, sidecar do |c| %>
2
+ <%= c.fields_for :data do |d| %>
3
+ <% if document.uploaded_resource? %>
4
+ <%= d.fields_for :configured_fields do |e| %>
5
+ <% upload_fields.each do |config| %>
6
+ <%= render Spotlight::UploadFieldFormGroupComponent.new(form: e, config:, value: upload_field_value(config)) %>
7
+ <% end %>
8
+ <% end %>
9
+ <% end %>
10
+
11
+ <% custom_fields.each do |field| %>
12
+ <%= render Spotlight::CustomFieldFormGroupComponent.new(form: d, field:, value: custom_field_value(field)) %>
13
+ <% unless field.configured_to_display? %>
14
+ <p class="bg-warning form-text"><%= blank_field_warning %></p>
15
+ <% end %>
16
+ <% end %>
17
+ <% end %>
18
+ <% end %>
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ # Renders the sidecar (exhibit-specific metadata) fields on the catalog edit form
5
+ class EditSidecarComponent < ViewComponent::Base
6
+ attr_reader :form, :document, :exhibit
7
+
8
+ def initialize(form:, document:, exhibit:)
9
+ @form = form
10
+ @document = document
11
+ @exhibit = exhibit
12
+ super()
13
+ end
14
+
15
+ def upload_fields
16
+ Spotlight::Resources::Upload.fields(exhibit)
17
+ end
18
+
19
+ def sidecar
20
+ @sidecar ||= document.sidecar(exhibit)
21
+ end
22
+
23
+ # Using `includes(:exhibit)` to ensure all fields are using the same exhibit object to take advantage of memoization
24
+ def custom_fields
25
+ exhibit.custom_fields.includes(:exhibit)
26
+ end
27
+
28
+ def upload_field_value(config)
29
+ (sidecar.data['configured_fields'] || {})[config.field_name.to_s]
30
+ end
31
+
32
+ def custom_field_value(field)
33
+ sidecar.data[field.slug.to_s] || sidecar.data[field.field.to_s]
34
+ end
35
+
36
+ def blank_field_warning
37
+ t('spotlight.catalog.edit_sidecar.blank_field_warning_html',
38
+ link: link_to(t('spotlight.configuration.sidebar.metadata'), helpers.spotlight.edit_exhibit_metadata_configuration_path(exhibit)))
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,18 @@
1
+ <% if show_contact_form? %>
2
+ <div id="report-problem-form" class="collapse">
3
+ <%= render 'spotlight/shared/report_a_problem' %>
4
+ </div>
5
+ <% end %>
6
+
7
+ <header class="masthead <%= 'image-masthead' if current_masthead %> <%= 'resource-masthead' if resource_masthead? %>">
8
+ <% if current_masthead %>
9
+ <span class="background-container" style="background-image: url('<%= current_masthead.iiif_url %>')"></span>
10
+ <span class="background-container-gradient"></span>
11
+ <% end %>
12
+
13
+ <%= masthead_navbar if resource_masthead? %>
14
+ <%= title_and_subtitle %>
15
+ <%= masthead_navbar unless resource_masthead? %>
16
+ </header>
17
+
18
+ <%= render Spotlight::BreadcrumbsComponent.new(breadcrumbs:) %>
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ # Draws the masthead
5
+ class MastheadComponent < ViewComponent::Base
6
+ def initialize(current_exhibit:, current_masthead:, resource_masthead:)
7
+ @current_exhibit = current_exhibit
8
+ @current_masthead = current_masthead
9
+ @resource_masthead = resource_masthead
10
+ super()
11
+ end
12
+
13
+ attr_reader :current_exhibit, :current_masthead
14
+
15
+ delegate :breadcrumbs, :masthead_heading_content, :masthead_subheading_content, to: :helpers
16
+
17
+ def resource_masthead?
18
+ @resource_masthead
19
+ end
20
+
21
+ def show_contact_form?
22
+ helpers.show_contact_form? &&
23
+ (current_exhibit.nil? || !helpers.current_page?(helpers.spotlight.new_exhibit_contact_form_path(current_exhibit)))
24
+ end
25
+
26
+ def masthead_navbar
27
+ if current_exhibit
28
+ render helpers.blacklight_config.exhibit_navbar_component.new
29
+ else
30
+ render 'shared/site_navbar'
31
+ end
32
+ end
33
+
34
+ def title
35
+ content_for(:masthead) || masthead_heading_content
36
+ end
37
+
38
+ def title_and_subtitle
39
+ render title_component.new(title:, subtitle: masthead_subheading_content)
40
+ end
41
+
42
+ def title_component
43
+ Spotlight::Engine.config.spotlight.title_component
44
+ end
45
+ end
46
+ end
@@ -1,7 +1,7 @@
1
1
  <%= button %>
2
2
  <div class="modal fade" id="save-modal" tabindex="-1" role="dialog" aria-labelledby="save-modal-label" aria-hidden="true">
3
3
  <div class="modal-dialog">
4
- <%= bootstrap_form_for form_path, html: { novalidate: true } do |f| %>
4
+ <%= helpers.bootstrap_form_for form_path, html: { novalidate: true } do |f| %>
5
5
  <div class="modal-content">
6
6
  <div class="modal-header">
7
7
  <h4 class="modal-title" id="save-modal-label"><%= t(:'spotlight.saved_search.label') %></h4>
@@ -0,0 +1,18 @@
1
+ <%= tag.div class: wrapper_class do %>
2
+ <% value_list.each_with_index do |v, index| %>
3
+ <%= form.label field_id, label, namespace: "f#{index}", class: label_class(hidden: index.positive?) %>
4
+ <%= tag.div class: value_wrapper_class(first: index.zero?) do %>
5
+ <%= render_input(value: v, namespace: "f#{index}") %>
6
+ <% end %>
7
+ <% end %>
8
+
9
+ <% if multiple && !readonly %>
10
+ <%= content_tag :template, id: template_id do %>
11
+ <%= form.label field_id, label, class: label_class(hidden: true) %>
12
+ <%= tag.div class: value_wrapper_class(first: false) do %>
13
+ <%= render_input %>
14
+ <% end %>
15
+ <% end %>
16
+ <%= content_tag :button, t('helpers.action.add_another'), class: 'btn btn-info btn-sm col-auto h-100', data: { action: 'add-another', template_id: template_id } %>
17
+ <% end %>
18
+ <% end %>
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ # Allow for mulivalued field entry on catalog edit and upload forms
5
+ class SidecarFormFieldComponent < ViewComponent::Base
6
+ attr_reader :form, :field_id, :label, :value_list, :multiple, :readonly, :inline
7
+
8
+ # rubocop:disable Metrics/ParameterLists
9
+ def initialize(form:, id:, label:, value: nil, field_type: 'text_field', multiple: false, readonly: false, inline: false)
10
+ super()
11
+ @form = form
12
+ @field_id = id
13
+ @label = label
14
+ @value_list = Array(value || '')
15
+ @field_type = field_type.to_s
16
+ @multiple = multiple
17
+ @readonly = readonly
18
+ @inline = inline
19
+ end
20
+ # rubocop:enable Metrics/ParameterLists
21
+
22
+ def render_input(value: nil, namespace: nil)
23
+ options = { value: value, class: "form-control field-#{field_id}" }
24
+
25
+ # Add multiple to options only if multiple is true
26
+ options[:multiple] = true if multiple
27
+ # Add readonly to options only if readonly is true
28
+ options[:readonly] = true if readonly
29
+ # Add namespace to options only if namespace is present
30
+ options[:namespace] = namespace if namespace.present?
31
+
32
+ form.send("#{@field_type}_without_bootstrap", field_id, **options)
33
+ end
34
+
35
+ def template_id
36
+ "spotlight-field-template-#{field_id}"
37
+ end
38
+
39
+ # add_another.js finds the field's existing values through the .form-group wrapper
40
+ def wrapper_class
41
+ inline ? 'form-group mb-3 row gy-2' : 'form-group mb-3'
42
+ end
43
+
44
+ def label_class(hidden: false)
45
+ classes = inline ? ['col-form-label', label_col] : ['form-label']
46
+ classes << 'visually-hidden' if hidden
47
+ classes.join(' ')
48
+ end
49
+
50
+ # In a horizontal form only the first input sits beside the label, so later inputs are offset to line up under it
51
+ def value_wrapper_class(first:)
52
+ if inline
53
+ first ? control_col : "#{offset_col} #{control_col}"
54
+ elsif multiple
55
+ 'mb-2'
56
+ end
57
+ end
58
+
59
+ def label_col
60
+ form&.label_col
61
+ end
62
+
63
+ def control_col
64
+ form&.control_col
65
+ end
66
+
67
+ def offset_col
68
+ label_col.sub('col', 'offset')
69
+ end
70
+ end
71
+ end
@@ -1,9 +1,5 @@
1
1
  <% if body.present? %>
2
2
  <%= body %>
3
- <% elsif partials? %>
4
- <% partials.each do |partial| %>
5
- <%= partial %>
6
- <% end %>
7
3
  <% elsif embed? %>
8
4
  <%= embed %>
9
5
  <% elsif thumbnail? %>
@@ -5,8 +5,8 @@ module Spotlight
5
5
  class SolrDocumentLegacyEmbedComponent < Blacklight::DocumentComponent
6
6
  attr_reader :block_context
7
7
 
8
- def initialize(*args, block: nil, **kwargs)
9
- super(*args, **kwargs)
8
+ def initialize(*, block: nil, **)
9
+ super(*, **)
10
10
 
11
11
  @block_context = block
12
12
  end
@@ -1,6 +1,6 @@
1
1
  <div data-controller="tag-selector" class="tag-selector" data-tag-selector-translations-value="<%= translation_data.to_json %>" data-tag-selector-tags-value="<%= selected_tags %>">
2
2
  <% if form.nil? %>
3
- <%= text_field_tag field_name, selected_tags_value, class: 'tag-selector-input', placeholder: t('.no_js_placeholder'), data: { tag_selector_target: "tagsField" } %>
3
+ <%= text_field_tag field_name, selected_tags_value, id: id, class: 'tag-selector-input', placeholder: t('.no_js_placeholder'), data: { tag_selector_target: "tagsField" } %>
4
4
  <% else %>
5
5
  <%= form.text_field field_name, value: selected_tags_value, class: 'tag-selector-input', placeholder: t('.no_js_placeholder'), data: { tag_selector_target: "tagsField" } %>
6
6
  <% end %>
@@ -5,9 +5,10 @@ module Spotlight
5
5
  # This uses a plain text input that acts-as-taggable-on expects.
6
6
  class TagSelectorComponent < ViewComponent::Base
7
7
  # selected_tags_value is a comma delimited string of tags
8
- def initialize(field_name:, all_tags:, selected_tags_value: nil, form: nil)
8
+ def initialize(field_name:, all_tags:, selected_tags_value: nil, form: nil, id: nil)
9
9
  @form = form
10
10
  @field_name = field_name
11
+ @id = id || field_name
11
12
  @selected_tags_value = selected_tags_value || ''
12
13
  @all_tags = all_tags&.sort_by { |tag| (tag.respond_to?(:name) ? tag.name : tag).downcase }
13
14
 
@@ -36,6 +37,6 @@ module Spotlight
36
37
  selected_tags.include?(tag.respond_to?(:name) ? tag.name : tag)
37
38
  end
38
39
 
39
- attr_reader :form, :field_name, :selected_tags_value, :all_tags
40
+ attr_reader :form, :field_name, :selected_tags_value, :all_tags, :id
40
41
  end
41
42
  end