blacklight-spotlight 3.0.0.alpha.9 → 3.0.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (262) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/app/assets/images/blacklight/arrow-alt-circle-left.svg +1 -0
  4. data/app/assets/images/blacklight/arrow-alt-circle-right.svg +1 -0
  5. data/app/assets/javascripts/spotlight/admin/{add_new_page_button.js → add_new_button.js} +7 -0
  6. data/app/assets/javascripts/spotlight/admin/block_mixins/autocompleteable.js +4 -4
  7. data/app/assets/javascripts/spotlight/admin/blocks/browse_block.js +55 -1
  8. data/app/assets/javascripts/spotlight/admin/blocks/browse_group_categories_block.js +88 -0
  9. data/app/assets/javascripts/spotlight/admin/blocks/pages_block.js +1 -1
  10. data/app/assets/javascripts/spotlight/admin/blocks/solr_documents_base_block.js +1 -1
  11. data/app/assets/javascripts/spotlight/admin/blocks/uploaded_items_block.js +7 -2
  12. data/app/assets/javascripts/spotlight/admin/crop.es6 +11 -0
  13. data/app/assets/javascripts/spotlight/admin/croppable.js +1 -1
  14. data/app/assets/javascripts/spotlight/admin/index.js +0 -2
  15. data/app/assets/javascripts/spotlight/admin/reindex_monitor.js +1 -0
  16. data/app/assets/javascripts/spotlight/admin/search_typeahead.js +2 -2
  17. data/app/assets/javascripts/spotlight/admin/sir-trevor/block_controls.js +21 -12
  18. data/app/assets/javascripts/spotlight/admin/sir-trevor/locales.js +11 -3
  19. data/app/assets/javascripts/spotlight/user/browse_group_categories.js +59 -0
  20. data/app/assets/javascripts/spotlight/user/index.js +1 -0
  21. data/app/assets/stylesheets/spotlight/_accessibility.scss +1 -1
  22. data/app/assets/stylesheets/spotlight/_breadcrumbs.scss +8 -0
  23. data/app/assets/stylesheets/spotlight/_browse.scss +16 -0
  24. data/app/assets/stylesheets/spotlight/_catalog.scss +6 -6
  25. data/app/assets/stylesheets/spotlight/_curation.scss +6 -0
  26. data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +214 -83
  27. data/app/assets/stylesheets/spotlight/_header.scss +1 -1
  28. data/app/assets/stylesheets/spotlight/_item_text_block.scss +6 -0
  29. data/app/assets/stylesheets/spotlight/_pages.scss +9 -4
  30. data/app/assets/stylesheets/spotlight/_report_a_problem.scss +5 -2
  31. data/app/assets/stylesheets/spotlight/_spotlight.scss +2 -0
  32. data/app/assets/stylesheets/spotlight/_translations.scss +7 -0
  33. data/app/assets/stylesheets/spotlight/browse_group_categories_block.scss +92 -0
  34. data/app/builders/spotlight/bootstrap_breadcrumbs_builder.rb +1 -2
  35. data/app/controllers/concerns/spotlight/search_helper.rb +2 -8
  36. data/app/controllers/spotlight/appearances_controller.rb +0 -12
  37. data/app/controllers/spotlight/browse_controller.rb +7 -3
  38. data/app/controllers/spotlight/catalog_controller.rb +5 -2
  39. data/app/controllers/spotlight/concerns/application_controller.rb +13 -2
  40. data/app/controllers/spotlight/dashboards_controller.rb +1 -1
  41. data/app/controllers/spotlight/exhibits_controller.rb +2 -3
  42. data/app/controllers/spotlight/featured_images_controller.rb +1 -1
  43. data/app/controllers/spotlight/groups_controller.rb +80 -0
  44. data/app/controllers/spotlight/pages_controller.rb +6 -9
  45. data/app/controllers/spotlight/resources/csv_upload_controller.rb +1 -1
  46. data/app/controllers/spotlight/searches_controller.rb +7 -19
  47. data/app/controllers/spotlight/translations_controller.rb +46 -0
  48. data/app/helpers/spotlight/application_helper.rb +20 -1
  49. data/app/helpers/spotlight/crop_helper.rb +4 -1
  50. data/app/helpers/spotlight/crud_link_helpers.rb +1 -1
  51. data/app/helpers/spotlight/main_app_helpers.rb +1 -1
  52. data/app/helpers/spotlight/pages_helper.rb +1 -1
  53. data/app/jobs/concerns/spotlight/job_tracking.rb +47 -0
  54. data/app/jobs/concerns/spotlight/limit_concurrency.rb +33 -0
  55. data/app/jobs/spotlight/add_uploads_from_csv.rb +34 -6
  56. data/app/jobs/spotlight/application_job.rb +8 -0
  57. data/app/jobs/spotlight/cleanup_job_trackers_job.rb +13 -0
  58. data/app/jobs/spotlight/default_thumbnail_job.rb +1 -3
  59. data/app/jobs/spotlight/reindex_exhibit_job.rb +36 -0
  60. data/app/jobs/spotlight/reindex_job.rb +49 -41
  61. data/app/jobs/spotlight/rename_sidecar_field_job.rb +2 -2
  62. data/app/jobs/spotlight/update_job_trackers_job.rb +20 -0
  63. data/app/mailers/spotlight/indexing_complete_mailer.rb +3 -2
  64. data/app/models/concerns/spotlight/exhibit_defaults.rb +1 -1
  65. data/app/models/concerns/spotlight/translatables.rb +17 -1
  66. data/app/models/concerns/spotlight/user.rb +2 -1
  67. data/app/models/sir_trevor_rails/blocks/browse_group_categories_block.rb +25 -0
  68. data/app/models/spotlight/ability.rb +2 -0
  69. data/app/models/spotlight/about_page.rb +3 -1
  70. data/app/models/spotlight/blacklight_configuration.rb +2 -1
  71. data/app/models/spotlight/contact.rb +1 -1
  72. data/app/models/spotlight/custom_field.rb +3 -3
  73. data/app/models/spotlight/event.rb +13 -0
  74. data/app/models/spotlight/exhibit.rb +18 -14
  75. data/app/models/spotlight/feature_page.rb +3 -1
  76. data/app/models/spotlight/featured_image.rb +29 -12
  77. data/app/models/spotlight/group.rb +22 -0
  78. data/app/models/spotlight/group_member.rb +11 -0
  79. data/app/models/spotlight/home_page.rb +3 -1
  80. data/app/models/spotlight/job_tracker.rb +105 -0
  81. data/app/models/spotlight/main_navigation.rb +2 -2
  82. data/app/models/spotlight/masthead.rb +1 -1
  83. data/app/models/spotlight/page.rb +5 -1
  84. data/app/models/spotlight/page_configurations.rb +6 -0
  85. data/app/models/spotlight/page_content.rb +2 -0
  86. data/app/models/spotlight/reindex_progress.rb +44 -27
  87. data/app/models/spotlight/resource.rb +24 -58
  88. data/app/models/spotlight/resources/csv_upload.rb +2 -1
  89. data/app/models/spotlight/resources/iiif_harvester.rb +10 -1
  90. data/app/models/spotlight/resources/iiif_manifest.rb +11 -7
  91. data/app/models/spotlight/resources/iiif_service.rb +1 -1
  92. data/app/models/spotlight/resources/json_upload.rb +12 -0
  93. data/app/models/spotlight/resources/upload.rb +25 -2
  94. data/app/models/spotlight/search.rb +10 -1
  95. data/app/models/spotlight/solr_document_sidecar.rb +9 -6
  96. data/app/models/spotlight/temporary_image.rb +8 -0
  97. data/app/services/spotlight/etl.rb +7 -0
  98. data/app/services/spotlight/etl/context.rb +52 -0
  99. data/app/services/spotlight/etl/executor.rb +194 -0
  100. data/app/services/spotlight/etl/loaders.rb +12 -0
  101. data/app/services/spotlight/etl/pipeline.rb +81 -0
  102. data/app/services/spotlight/etl/solr_loader.rb +96 -0
  103. data/app/services/spotlight/etl/sources.rb +25 -0
  104. data/app/services/spotlight/etl/step.rb +82 -0
  105. data/app/services/spotlight/etl/transforms.rb +64 -0
  106. data/app/services/spotlight/exhibit_import_export_service.rb +482 -0
  107. data/app/services/spotlight/validity_checker.rb +5 -5
  108. data/app/values/custom_field_name.rb +1 -0
  109. data/app/views/catalog/_save_search.html.erb +1 -1
  110. data/app/views/spotlight/about_pages/_empty.html.erb +5 -5
  111. data/app/views/spotlight/browse/_search.html.erb +5 -3
  112. data/app/views/spotlight/browse/_search_title.html.erb +2 -1
  113. data/app/views/spotlight/browse/index.html.erb +13 -0
  114. data/app/views/spotlight/catalog/_document.html.erb +2 -4
  115. data/app/views/spotlight/catalog/index.iiif_json.jbuilder +22 -0
  116. data/app/views/spotlight/contacts/_form.html.erb +1 -1
  117. data/app/views/spotlight/dashboards/_reindexing_activity.html.erb +6 -6
  118. data/app/views/spotlight/feature_pages/_empty.html.erb +5 -5
  119. data/app/views/spotlight/featured_images/_form.html.erb +1 -1
  120. data/app/views/spotlight/featured_images/_upload_form.html.erb +1 -1
  121. data/app/views/spotlight/home_pages/_empty.html.erb +3 -3
  122. data/app/views/spotlight/indexing_complete_mailer/documents_indexed.html.erb +9 -0
  123. data/app/views/spotlight/pages/_form.html.erb +2 -2
  124. data/app/views/spotlight/searches/_form.html.erb +13 -0
  125. data/app/views/spotlight/searches/_group.html.erb +27 -0
  126. data/app/views/spotlight/searches/_search.html.erb +1 -0
  127. data/app/views/spotlight/searches/index.html.erb +58 -17
  128. data/app/views/spotlight/shared/_honeypot_field.html.erb +4 -0
  129. data/app/views/spotlight/shared/_locale_picker.html.erb +1 -1
  130. data/app/views/spotlight/shared/_report_a_problem.html.erb +7 -10
  131. data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -0
  132. data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +45 -0
  133. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +7 -1
  134. data/app/views/spotlight/translations/_browse_categories.html.erb +29 -3
  135. data/app/views/spotlight/translations/_general.html.erb +7 -7
  136. data/app/views/spotlight/translations/_groups.html.erb +34 -0
  137. data/app/views/spotlight/translations/_import.html.erb +24 -0
  138. data/app/views/spotlight/translations/_metadata.html.erb +1 -1
  139. data/app/views/spotlight/translations/_page.html.erb +5 -5
  140. data/app/views/spotlight/translations/_pages.html.erb +4 -4
  141. data/app/views/spotlight/translations/_pages_table.html.erb +5 -5
  142. data/app/views/spotlight/translations/_search_fields.html.erb +3 -3
  143. data/app/views/spotlight/translations/edit.html.erb +14 -6
  144. data/app/views/spotlight/translations/show.yaml.yamlbuilder +81 -0
  145. data/config/i18n-tasks.yml +7 -0
  146. data/config/locales/spotlight.ar.yml +57 -24
  147. data/config/locales/spotlight.en.yml +184 -128
  148. data/config/routes.rb +16 -1
  149. data/db/migrate/20200403161512_add_subtitle_to_searches.rb +7 -0
  150. data/db/migrate/20210113092223_create_spotlight_groups.rb +23 -0
  151. data/db/migrate/20210122082032_create_job_trackers.rb +22 -0
  152. data/db/migrate/20210126123041_create_events.rb +15 -0
  153. data/lib/generators/spotlight/install_generator.rb +23 -2
  154. data/lib/generators/spotlight/scaffold_resource_generator.rb +5 -13
  155. data/lib/generators/spotlight/templates/config/initializers/sir_trevor_rails.rb +10 -0
  156. data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +3 -1
  157. data/lib/spotlight/engine.rb +35 -4
  158. data/lib/spotlight/upload_field_config.rb +1 -0
  159. data/lib/spotlight/version.rb +1 -1
  160. data/spec/controllers/spotlight/about_pages_controller_spec.rb +3 -3
  161. data/spec/controllers/spotlight/browse_controller_spec.rb +24 -1
  162. data/spec/controllers/spotlight/catalog_controller_spec.rb +4 -2
  163. data/spec/controllers/spotlight/contacts_controller_spec.rb +2 -2
  164. data/spec/controllers/spotlight/feature_pages_controller_spec.rb +11 -0
  165. data/spec/controllers/spotlight/groups_controller_spec.rb +103 -0
  166. data/spec/controllers/spotlight/home_pages_controller_spec.rb +2 -2
  167. data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +4 -4
  168. data/spec/controllers/spotlight/searches_controller_spec.rb +10 -3
  169. data/spec/controllers/spotlight/translations_controller_spec.rb +53 -2
  170. data/spec/controllers/spotlight/view_configurations_controller_spec.rb +1 -1
  171. data/spec/examples.txt +1448 -125
  172. data/spec/factories/featured_images.rb +4 -0
  173. data/spec/factories/group.rb +17 -0
  174. data/spec/factories/job_trackers.rb +9 -0
  175. data/spec/factories/searches.rb +11 -1
  176. data/spec/features/add_contacts_spec.rb +1 -1
  177. data/spec/features/add_items_spec.rb +9 -4
  178. data/spec/features/browse_category_admin_spec.rb +39 -7
  179. data/spec/features/browse_category_navigation_spec.rb +44 -0
  180. data/spec/features/browse_category_spec.rb +2 -2
  181. data/spec/features/catalog_spec.rb +2 -2
  182. data/spec/features/create_exhibit_spec.rb +5 -4
  183. data/spec/features/dashboard_spec.rb +7 -7
  184. data/spec/features/edit_search_fields_spec.rb +2 -2
  185. data/spec/features/exhibits/administration_spec.rb +3 -3
  186. data/spec/features/exhibits/edit_metadata_fields_spec.rb +1 -1
  187. data/spec/features/exhibits/language_create_edit_spec.rb +3 -3
  188. data/spec/features/exhibits/translation_editing_spec.rb +57 -8
  189. data/spec/features/home_page_spec.rb +13 -4
  190. data/spec/features/item_admin_spec.rb +4 -4
  191. data/spec/features/javascript/about_page_admin_spec.rb +1 -1
  192. data/spec/features/javascript/block_controls_spec.rb +3 -1
  193. data/spec/features/javascript/blocks/browse_group_categories_block_spec.rb +64 -0
  194. data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +4 -1
  195. data/spec/features/javascript/browse_group_admin_spec.rb +45 -0
  196. data/spec/features/javascript/edit_in_place_spec.rb +3 -3
  197. data/spec/features/javascript/feature_page_admin_spec.rb +1 -1
  198. data/spec/features/javascript/reindex_monitor_spec.rb +1 -1
  199. data/spec/features/javascript/search_config_admin_spec.rb +1 -1
  200. data/spec/features/report_a_problem_spec.rb +6 -5
  201. data/spec/features/site_users_management_spec.rb +4 -4
  202. data/spec/helpers/spotlight/crud_link_helpers_spec.rb +3 -3
  203. data/spec/helpers/spotlight/pages_helper_spec.rb +10 -2
  204. data/spec/i18n_spec.rb +0 -2
  205. data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +13 -1
  206. data/spec/jobs/spotlight/reindex_exhibit_job_spec.rb +43 -0
  207. data/spec/jobs/spotlight/reindex_job_spec.rb +30 -59
  208. data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +11 -1
  209. data/spec/models/sir_trevor_rails/blocks/browse_group_categories_block_spec.rb +41 -0
  210. data/spec/models/solr_document_spec.rb +2 -3
  211. data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +1 -0
  212. data/spec/models/spotlight/exhibit_spec.rb +21 -59
  213. data/spec/models/spotlight/featured_image_spec.rb +27 -0
  214. data/spec/models/spotlight/group_spec.rb +19 -0
  215. data/spec/models/spotlight/main_navigation_spec.rb +1 -1
  216. data/spec/models/spotlight/page_spec.rb +6 -1
  217. data/spec/models/spotlight/reindex_progress_spec.rb +89 -87
  218. data/spec/models/spotlight/resource_spec.rb +69 -90
  219. data/spec/models/spotlight/resources/iiif_harvester_spec.rb +9 -10
  220. data/spec/models/spotlight/resources/upload_spec.rb +43 -79
  221. data/spec/models/spotlight/role_spec.rb +3 -3
  222. data/spec/models/spotlight/search_spec.rb +30 -3
  223. data/spec/models/spotlight/solr_document_sidecar_spec.rb +1 -0
  224. data/spec/services/spotlight/etl/context_spec.rb +66 -0
  225. data/spec/services/spotlight/etl/executor_spec.rb +149 -0
  226. data/spec/services/spotlight/etl/pipeline_spec.rb +22 -0
  227. data/spec/services/spotlight/etl/solr_loader_spec.rb +76 -0
  228. data/spec/services/spotlight/etl/step_spec.rb +70 -0
  229. data/spec/{serializers/spotlight/exhibit_export_serializer_spec.rb → services/spotlight/exhibit_import_export_service_spec.rb} +168 -23
  230. data/spec/services/spotlight/iiif_resource_resolver_spec.rb +1 -1
  231. data/spec/spec_helper.rb +3 -6
  232. data/spec/support/features/test_features_helpers.rb +15 -0
  233. data/spec/test_app_templates/Gemfile.extra +1 -3
  234. data/spec/test_app_templates/catalog_controller.rb +6 -3
  235. data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
  236. data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +1 -1
  237. data/spec/views/spotlight/browse/index.html.erb_spec.rb +2 -0
  238. data/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb +1 -1
  239. data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +28 -25
  240. data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +3 -3
  241. data/spec/views/spotlight/pages/show.html.erb_spec.rb +1 -0
  242. data/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb +1 -1
  243. data/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb +7 -8
  244. data/spec/views/spotlight/translations/_import.html.erb_spec.rb +24 -0
  245. data/vendor/assets/javascripts/leaflet-iiif.js +46 -21
  246. data/vendor/assets/javascripts/tiny-slider.js +3218 -0
  247. data/vendor/assets/stylesheets/tiny-slider.css +1 -0
  248. metadata +444 -289
  249. data/app/models/concerns/spotlight/resources/open_graph.rb +0 -36
  250. data/app/models/spotlight/reindexing_log_entry.rb +0 -42
  251. data/app/serializers/spotlight/exhibit_export_serializer.rb +0 -205
  252. data/app/serializers/spotlight/featured_image_representer.rb +0 -29
  253. data/app/serializers/spotlight/main_navigation_representer.rb +0 -13
  254. data/app/serializers/spotlight/page_representer.rb +0 -33
  255. data/app/services/spotlight/resources/iiif_builder.rb +0 -19
  256. data/app/services/spotlight/solr_document_builder.rb +0 -76
  257. data/app/services/spotlight/upload_solr_document_builder.rb +0 -57
  258. data/spec/factories/reindexing_log_entries.rb +0 -54
  259. data/spec/models/spotlight/reindexing_log_entry_spec.rb +0 -129
  260. data/spec/models/spotlight/resources/open_graph_spec.rb +0 -65
  261. data/spec/services/spotlight/solr_document_builder_spec.rb +0 -66
  262. data/vendor/assets/javascripts/handlebars-v1.3.0.js +0 -2746
@@ -0,0 +1,59 @@
1
+ (function( $ ){
2
+
3
+ $.fn.browseGroupCategories = function( options ) {
4
+ // Create some defaults, extending them with any options that were provided
5
+ var settings = $.extend( { }, options);
6
+ var $container, slider;
7
+
8
+ function init() {
9
+ var data = $container.data();
10
+ var sidebar = $container.data().sidebar;
11
+ var items = data.browseGroupCategoriesCount;
12
+ var dir = $('html').attr('dir');
13
+ var controls = $container.parent().find('.browse-group-categories-controls')[0];
14
+
15
+ slider = tns({
16
+ container: $container[0],
17
+ controlsContainer: controls,
18
+ loop: false,
19
+ nav: false,
20
+ items: 1,
21
+ slideBy: 'page',
22
+ textDirection: dir,
23
+ responsive: {
24
+ 576: {
25
+ items: itemCount(items, sidebar)
26
+ }
27
+ }
28
+ });
29
+ }
30
+
31
+ // Destroy the slider instance, as tns will change the dom elements, causing some issues with turbolinks
32
+ function setupDestroy() {
33
+ document.addEventListener('turbolinks:before-cache', function() {
34
+ if (slider && slider.destroy) {
35
+ slider.destroy();
36
+ }
37
+ });
38
+ }
39
+
40
+ function itemCount(items, sidebar) {
41
+ if (items < 3) {
42
+ return items;
43
+ }
44
+ return sidebar ? 3 : 4;
45
+ }
46
+
47
+ return this.each(function() {
48
+ $container = $(this);
49
+ init();
50
+ setupDestroy();
51
+ });
52
+ }
53
+ })( jQuery );
54
+
55
+ Spotlight.onLoad(function() {
56
+ $('[data-browse-group-categories-carousel]').each(function(i, el) {
57
+ $(el).browseGroupCategories();
58
+ });
59
+ });
@@ -4,4 +4,5 @@
4
4
  //= require bootstrap/tooltip
5
5
  //= require bootstrap/popover
6
6
  //= require bootstrap/carousel
7
+ //= require tiny-slider
7
8
  //= require_tree .
@@ -2,7 +2,7 @@
2
2
 
3
3
  // Increase visibility of Firefox focus indicator
4
4
  @-moz-document url-prefix() {
5
- &:focus {
5
+ :focus {
6
6
  outline: $input-focus-border-color auto 5px;
7
7
  }
8
8
  }
@@ -0,0 +1,8 @@
1
+ .breadcrumb-item {
2
+ .truncated-value {
3
+ overflow: hidden;
4
+ text-overflow: ellipsis;
5
+ white-space: nowrap;
6
+ width: 30ex;
7
+ }
8
+ }
@@ -26,6 +26,18 @@ $image-overlay-max-height: 300px;
26
26
  }
27
27
  }
28
28
 
29
+ .blacklight-browse-show {
30
+ .subtitle {
31
+ padding-right: $spacer;
32
+
33
+ &::before {
34
+ content: " \000B7 ";
35
+ color: $text-muted;
36
+ padding-right: $spacer / 2;
37
+ }
38
+ }
39
+ }
40
+
29
41
  .browse-landing {
30
42
  text-align: center;
31
43
  // Placeholder for vertically alignment - might already be available from use in another feature
@@ -70,6 +82,10 @@ $image-overlay-max-height: 300px;
70
82
  font-size: $h3-font-size;
71
83
  @extend %vertical-align;
72
84
 
85
+ .category-subtitle {
86
+ display: block;
87
+ }
88
+
73
89
  small {
74
90
  display: block;
75
91
  color: $white;
@@ -122,14 +122,14 @@ form.edit_solr_document {
122
122
  margin-right: $spacer * 0.1;
123
123
  }
124
124
 
125
- #document {
126
- dd.blacklight-exhibit_tags {
127
- color: $body-bg;
128
- line-height: 2em;
129
- }
130
-
125
+ #document,
126
+ .document {
131
127
  .blacklight-exhibit_tags a {
132
128
  @extend .badge;
133
129
  @extend .badge-secondary;
130
+
131
+ &:not(:last-child) {
132
+ @extend .mr-2;
133
+ }
134
134
  }
135
135
  }
@@ -216,3 +216,9 @@ table.tags {
216
216
  text-align: center;
217
217
  }
218
218
  }
219
+
220
+ .card-title .subtitle::before {
221
+ content: " \000B7 ";
222
+ color: $text-muted;
223
+ padding-right: 3px;
224
+ }
@@ -1,138 +1,269 @@
1
1
  $featured-browse-category-border-color: $border-color;
2
2
  $featured-browse-category-caption-color: $white;
3
- $container-tablet: 720px;
4
- $container-desktop: 960px;
5
- $container-large-desktop: 1140px;
6
- // Large desktop
7
- $featured-browse-category-margin-large-desktop: 15px;
8
- $no-sidebar-large-desktop-large-image-width: floor(($container-large-desktop)/ 3) - $featured-browse-category-margin-large-desktop;
9
- $no-sidebar-large-desktop-medium-image-width: floor(($container-large-desktop)/ 5) - $featured-browse-category-margin-large-desktop;
10
-
11
- $with-sidebar-large-desktop-width: floor($container-large-desktop - ($container-large-desktop)/ 4); // sidebar space to remove
12
- $with-sidebar-large-desktop-large-image-width: floor(($with-sidebar-large-desktop-width)/ 2) - ($featured-browse-category-margin-large-desktop * 2);
13
- $with-sidebar-large-desktop-medium-image-width: 265px;
14
-
15
- // Desktop
16
- $featured-browse-category-margin-desktop: 20px;
17
- $no-sidebar-desktop-large-image-width: floor(($container-desktop)/ 3) - $featured-browse-category-margin-desktop;
18
-
19
- $with-sidebar-desktop-width: floor($container-desktop - ($container-desktop)/ 4); // sidebar space to remove
20
- $with-sidebar-desktop-large-image-width: floor(($with-sidebar-desktop-width)/ 2) - ($featured-browse-category-margin-desktop * 2);
21
- $with-sidebar-desktop-medium-image-width: floor(($with-sidebar-desktop-width)/ 3) - ($featured-browse-category-margin-desktop);
22
-
23
- // Tablet
24
- $featured-browse-category-margin-tablet: 20px;
25
- $no-sidebar-tablet-large-image-width: floor(($container-tablet)/ 3) - $featured-browse-category-margin-tablet;
26
- $with-sidebar-tablet-large-image-width: floor(($container-tablet)/ 2) - ($featured-browse-category-margin-tablet * 2);
27
-
28
- // Extra small
29
- $no-sidebar-xs-image-width: 190px;
30
- $with-sidebar-xs-image-width: $no-sidebar-xs-image-width;
31
-
32
- // Height adjustments
33
- $aspect-ratio-factor-large-image: 0.75; // 4:3 width:height
34
- $aspect-ratio-factor-medium-image: 1; // 1:1 width: height
3
+
4
+ // These are the widths of the main content area at each viewport width
5
+ $container-sm: 510px; // (Bootstrap 4 "sm")
6
+ $container-md: 690px; // (Bootstrap 4 "md")
7
+ $container-lg: 930px; // (Bootstrap 4 "lg")
8
+ $container-xl: 1100px; // (Bootstrap 4 "xl")
9
+ $container-xl-sidebar: 825px; // ("xl" main content area when sidebar present)
10
+
11
+ // The aspect ratio factor determines the height of the tile.
12
+ // Can use different values because images are background images
13
+ // and will fit the container without distortion.
14
+ $aspect-ratio-factor-4x3: 0.75; // 4:3 width:height
15
+ $aspect-ratio-factor-1x1: 1; // 1:1 width: height
16
+
17
+ // Horizontal space between tiles
18
+ $tile-margin: 16px;
19
+
20
+ // Limits size of tile in cases where calculations create unreasonably large tile
21
+ $maximum-tile-width: 290px;
22
+
23
+ // `xs` viewport width; always display one full-width tile, wrapping others
24
+ $xs-one-tile-width: $maximum-tile-width;
25
+
26
+ // `sm` viewport width
27
+ $sm-one-tile-width: $xs-one-tile-width;
28
+ $sm-two-tile-width: ($container-sm / 2) - $tile-margin;
29
+ $sm-three-tile-width: ($container-sm / 3) - $tile-margin;
30
+
31
+ // `md` viewport width
32
+ $md-one-tile-width: $xs-one-tile-width;
33
+ $md-two-tile-width: ($container-md/ 2) - $tile-margin;
34
+ $md-three-tile-width: ($container-md / 3) - $tile-margin;
35
+
36
+ // `lg` viewport width
37
+ $lg-one-tile-width: $xs-one-tile-width;
38
+ $lg-two-tile-width: ($container-lg/ 2) - $tile-margin;
39
+ $lg-three-tile-width: ($container-lg / 3) - $tile-margin;
40
+ $lg-four-tile-width: ($container-lg / 4) - $tile-margin;
41
+ $lg-five-tile-width: ($container-lg / 5) - $tile-margin;
42
+
43
+ // `xl` viewport width
44
+ $xl-one-tile-width: $xs-one-tile-width;
45
+ $xl-two-tile-width: ($container-xl/ 2) - $tile-margin;
46
+ $xl-three-tile-width: ($container-xl / 3) - $tile-margin;
47
+ $xl-four-tile-width: ($container-xl / 4) - $tile-margin;
48
+ $xl-five-tile-width: ($container-xl / 5) - $tile-margin;
49
+
50
+ // `xl` with sidebar viewport width
51
+ $xl-sidebar-three-tile-width: ($container-xl-sidebar / 3) - $tile-margin;
52
+ $xl-sidebar-four-tile-width: ($container-xl-sidebar / 4) - $tile-margin;
53
+ $xl-sidebar-five-tile-width: ($container-xl-sidebar / 5) - $tile-margin;
35
54
 
36
55
  .browse-category {
37
56
  background-size: cover;
38
57
  background-position: center;
58
+ background-repeat: no-repeat;
39
59
  border: 2px solid $featured-browse-category-border-color;
40
60
  border-radius: $border-radius-lg;
41
61
  position: relative;
42
- float: left;
43
- background-repeat: no-repeat;
62
+
44
63
  .category-caption {
64
+ bottom: 16px; // assumes default font-size of 16px, using browser default of 1 rem == 16px
45
65
  color: $featured-browse-category-caption-color;
46
66
  position: absolute;
47
- bottom: 16px; // assumes default font-size of 16px, using browser default of 1 rem == 16px
48
67
  text-align: center;
49
- text-shadow: 0 1px 0 #000000;
68
+ text-shadow: 0 1px 0 $black;
50
69
  width: 100%;
51
70
  }
71
+
52
72
  .category-title {
53
- font-size: $font-size-lg;
73
+ font-size: $h4-font-size;
54
74
  line-height: 1.2;
55
75
  margin: 0;
56
76
  padding: $spacer / 4;
77
+
78
+ @media (min-width: breakpoint-min("sm")) {
79
+ font-size: 1.125rem;
80
+ }
81
+
82
+ @media (min-width: breakpoint-min("md")) {
83
+ font-size: $h5-font-size;
84
+ }
85
+
86
+ @media (min-width: breakpoint-min("lg")) {
87
+ font-size: $h4-font-size;
88
+ }
57
89
  }
90
+
91
+ .category-subtitle {
92
+ display: block;
93
+ }
94
+
58
95
  .item-count {
59
96
  font-size: $font-size-base;
60
97
  text-transform: uppercase;
98
+
99
+ @media (min-width: breakpoint-min("sm")) and (max-width: breakpoint-min("lg")) {
100
+ font-size: $font-size-sm;
101
+ }
102
+ }
103
+ }
104
+
105
+ .spotlight-flexbox.browse-categories {
106
+ justify-content: space-around;
107
+
108
+ .box {
109
+ flex: none;
110
+ margin-bottom: 1rem;
111
+ min-width: 150px;
112
+ padding: 0;
61
113
  }
62
114
  }
63
115
 
64
- [data-sidebar="false"] {
65
- &.categories-1, &.categories-2, &.categories-3 {
116
+ // Most tile sizing works regardless of sidebar or not, because
117
+ // only "lg" and "xl" have a sidebar, and "lg" with a sidebar
118
+ // is the same width as "md" without a sidebar.
119
+ [data-sidebar="false"],
120
+ [data-sidebar="true"] {
121
+ &.categories-1, &.categories-2, &.categories-3,
122
+ &.categories-4, &.categories-5 {
123
+ .browse-category {
124
+ max-width: $maximum-tile-width;
125
+ max-height: $maximum-tile-width * $aspect-ratio-factor-4x3;
126
+ width: $xs-one-tile-width;
127
+ height: $xs-one-tile-width * $aspect-ratio-factor-4x3;
128
+ }
129
+ }
130
+ &.categories-2 {
66
131
  .browse-category {
67
- width: $no-sidebar-xs-image-width;
68
- height: $no-sidebar-xs-image-width * $aspect-ratio-factor-large-image;
69
- @media (min-width: breakpoint-min("sm")) and (max-width: breakpoint-max("md")) {
70
- width: $no-sidebar-tablet-large-image-width;
71
- height: $no-sidebar-tablet-large-image-width * $aspect-ratio-factor-large-image;
132
+ @media (min-width: breakpoint-min("sm")) {
133
+ width: $sm-two-tile-width;
134
+ height: $sm-two-tile-width * $aspect-ratio-factor-4x3;
72
135
  }
73
- @media (min-width: breakpoint-min("md")) and (min-width: breakpoint-min("lg")) {
74
- width: $no-sidebar-desktop-large-image-width;
75
- height: $no-sidebar-desktop-large-image-width * $aspect-ratio-factor-large-image;
136
+
137
+ @media (min-width: breakpoint-min("md")) {
138
+ width: $md-two-tile-width;
139
+ height: $md-two-tile-width * $aspect-ratio-factor-4x3;
76
140
  }
141
+ }
142
+ }
143
+ &.categories-3 {
144
+ .browse-category {
145
+ @media (min-width: breakpoint-min("sm")) {
146
+ width: $sm-three-tile-width;
147
+ height: $sm-three-tile-width * $aspect-ratio-factor-4x3;
148
+ }
149
+
150
+ @media (min-width: breakpoint-min("md")) {
151
+ width: $md-three-tile-width;
152
+ height: $md-three-tile-width * $aspect-ratio-factor-4x3;
153
+ }
154
+
155
+ @media (min-width: breakpoint-min("lg")) {
156
+ width: $lg-three-tile-width;
157
+ height: $lg-three-tile-width * $aspect-ratio-factor-4x3;
158
+ }
159
+ }
160
+ }
161
+ &.categories-4 {
162
+ .browse-category {
163
+ @media (min-width: breakpoint-min("sm")) {
164
+ width: $sm-two-tile-width;
165
+ height: $sm-two-tile-width * $aspect-ratio-factor-4x3;
166
+ }
167
+
168
+ @media (min-width: breakpoint-min("md")) {
169
+ width: $md-two-tile-width;
170
+ height: $md-two-tile-width * $aspect-ratio-factor-4x3;
171
+ }
172
+
173
+ @media (min-width: breakpoint-min("lg")) {
174
+ width: $lg-four-tile-width;
175
+ height: $lg-four-tile-width * $aspect-ratio-factor-4x3;
176
+ }
177
+
77
178
  @media (min-width: breakpoint-min("xl")) {
78
- width: $no-sidebar-large-desktop-large-image-width;
79
- height: $no-sidebar-large-desktop-large-image-width * $aspect-ratio-factor-large-image;
179
+ width: $xl-four-tile-width;
180
+ height: $xl-four-tile-width * $aspect-ratio-factor-4x3;
80
181
  }
81
182
  }
82
183
  }
83
- &.categories-4, &.categories-5 {
184
+ &.categories-5 {
84
185
  .browse-category {
85
- width: $no-sidebar-large-desktop-medium-image-width;
86
- height: $no-sidebar-large-desktop-medium-image-width * $aspect-ratio-factor-medium-image;
87
- @media (max-width: breakpoint-max("sm")) {
88
- width: $no-sidebar-xs-image-width;
89
- height: $no-sidebar-xs-image-width * $aspect-ratio-factor-medium-image;
186
+ @media (min-width: breakpoint-min("sm")) {
187
+ width: $sm-three-tile-width;
188
+ height: $sm-three-tile-width * $aspect-ratio-factor-4x3;
189
+ }
190
+
191
+ @media (min-width: breakpoint-min("md")) {
192
+ width: $md-three-tile-width;
193
+ height: $md-three-tile-width * $aspect-ratio-factor-4x3;
194
+ }
195
+
196
+ @media (min-width: breakpoint-min("lg")) {
197
+ width: $lg-five-tile-width;
198
+ height: $lg-five-tile-width * $aspect-ratio-factor-4x3;
199
+ }
200
+
201
+ @media (min-width: breakpoint-min("xl")) {
202
+ width: $xl-five-tile-width;
203
+ height: $xl-five-tile-width * $aspect-ratio-factor-4x3;
90
204
  }
91
205
  }
92
- .category-4 {
93
- @extend .d-sm-none;
206
+ }
207
+ }
208
+
209
+ [data-sidebar="true"] {
210
+ // Font size smaller at "lg" breakpoint only when there is a sidebar
211
+ .browse-category {
212
+ .category-title {
213
+ @media (min-width: breakpoint-min("lg")) and (max-width: breakpoint-min("xl")) {
214
+ font-size: $h5-font-size;
215
+ }
94
216
  }
95
- .category-5 {
96
- @extend .d-md-none;
97
- @extend .d-sm-none;
217
+
218
+ .item-count {
219
+ @media (min-width: breakpoint-min("lg")) and (max-width: breakpoint-min("xl")) {
220
+ font-size: $font-size-sm;
221
+ }
98
222
  }
99
223
  }
100
224
  }
101
225
 
226
+ // Special cases where the sizing above doesn't work when there is a sidebar.
227
+ // Note that "lg" with a sidebar has the same available width as "md"
228
+ // without a sidebar.
102
229
  [data-sidebar="true"] {
103
- &.categories-1, &.categories-2 {
230
+ &.categories-3 {
104
231
  .browse-category {
105
- width: $with-sidebar-xs-image-width;
106
- height: $with-sidebar-xs-image-width * $aspect-ratio-factor-large-image;
107
- @media (min-width: breakpoint-min("sm")) and (max-width: breakpoint-max("md")) {
108
- width: $with-sidebar-tablet-large-image-width;
109
- height: $with-sidebar-tablet-large-image-width * $aspect-ratio-factor-large-image;
110
- }
111
- @media (min-width: breakpoint-min("md")) and (max-width: breakpoint-max("xl")) {
112
- width: $with-sidebar-desktop-large-image-width;
113
- height: $with-sidebar-desktop-large-image-width * $aspect-ratio-factor-large-image;
232
+ @media (min-width: breakpoint-min("lg")) {
233
+ width: $md-three-tile-width;
234
+ height: $md-three-tile-width * $aspect-ratio-factor-4x3;
114
235
  }
236
+
115
237
  @media (min-width: breakpoint-min("xl")) {
116
- width: $with-sidebar-large-desktop-large-image-width;
117
- height: $with-sidebar-large-desktop-large-image-width * $aspect-ratio-factor-large-image;
238
+ width: $xl-sidebar-three-tile-width;
239
+ height: $xl-sidebar-three-tile-width * $aspect-ratio-factor-4x3;
118
240
  }
119
241
  }
120
242
  }
121
- &.categories-3, &.categories-4, &.categories-5 {
122
- .browse-category {
123
- width: $with-sidebar-desktop-medium-image-width;
124
- height: $with-sidebar-desktop-medium-image-width * $aspect-ratio-factor-medium-image;
125
- @media (max-width: breakpoint-max("sm")) {
126
- width: $with-sidebar-xs-image-width;
127
- height: $with-sidebar-xs-image-width * $aspect-ratio-factor-medium-image;
243
+ &.categories-4 {
244
+ .browse-category {
245
+ @media (min-width: breakpoint-min("lg")) {
246
+ width: $md-two-tile-width;
247
+ height: $md-two-tile-width * $aspect-ratio-factor-4x3;
128
248
  }
249
+
129
250
  @media (min-width: breakpoint-min("xl")) {
130
- width: $with-sidebar-large-desktop-medium-image-width;
131
- height: $with-sidebar-large-desktop-medium-image-width * $aspect-ratio-factor-medium-image;
251
+ width: $xl-sidebar-four-tile-width;
252
+ height: $xl-sidebar-four-tile-width * $aspect-ratio-factor-4x3;
132
253
  }
133
254
  }
134
255
  }
135
- .category-4, .category-5 {
136
- display: none;
256
+ &.categories-5 {
257
+ .browse-category {
258
+ @media (min-width: breakpoint-min("lg")) {
259
+ width: $md-three-tile-width;
260
+ height: $md-three-tile-width * $aspect-ratio-factor-4x3;
261
+ }
262
+
263
+ @media (min-width: breakpoint-min("xl")) {
264
+ width: $xl-sidebar-five-tile-width;
265
+ height: $xl-sidebar-five-tile-width * $aspect-ratio-factor-4x3;
266
+ }
267
+ }
137
268
  }
138
269
  }