blacklight-spotlight 3.0.0.alpha.8 → 3.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) 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/search_typeahead.js +2 -2
  16. data/app/assets/javascripts/spotlight/admin/sir-trevor/block_controls.js +21 -12
  17. data/app/assets/javascripts/spotlight/admin/sir-trevor/locales.js +11 -3
  18. data/app/assets/javascripts/spotlight/user/browse_group_categories.js +59 -0
  19. data/app/assets/javascripts/spotlight/user/index.js +1 -0
  20. data/app/assets/stylesheets/spotlight/_accessibility.scss +1 -1
  21. data/app/assets/stylesheets/spotlight/_breadcrumbs.scss +8 -0
  22. data/app/assets/stylesheets/spotlight/_browse.scss +16 -0
  23. data/app/assets/stylesheets/spotlight/_catalog.scss +6 -6
  24. data/app/assets/stylesheets/spotlight/_curation.scss +6 -0
  25. data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +214 -83
  26. data/app/assets/stylesheets/spotlight/_header.scss +1 -1
  27. data/app/assets/stylesheets/spotlight/_item_text_block.scss +6 -0
  28. data/app/assets/stylesheets/spotlight/_pages.scss +10 -5
  29. data/app/assets/stylesheets/spotlight/_report_a_problem.scss +5 -2
  30. data/app/assets/stylesheets/spotlight/_spotlight.scss +2 -0
  31. data/app/assets/stylesheets/spotlight/_translations.scss +7 -0
  32. data/app/assets/stylesheets/spotlight/browse_group_categories_block.scss +69 -0
  33. data/app/builders/spotlight/bootstrap_breadcrumbs_builder.rb +1 -2
  34. data/app/controllers/concerns/spotlight/search_helper.rb +2 -8
  35. data/app/controllers/spotlight/appearances_controller.rb +0 -12
  36. data/app/controllers/spotlight/browse_controller.rb +7 -3
  37. data/app/controllers/spotlight/catalog_controller.rb +1 -1
  38. data/app/controllers/spotlight/concerns/application_controller.rb +13 -2
  39. data/app/controllers/spotlight/exhibits_controller.rb +2 -3
  40. data/app/controllers/spotlight/featured_images_controller.rb +1 -1
  41. data/app/controllers/spotlight/groups_controller.rb +80 -0
  42. data/app/controllers/spotlight/pages_controller.rb +6 -9
  43. data/app/controllers/spotlight/resources/csv_upload_controller.rb +1 -1
  44. data/app/controllers/spotlight/searches_controller.rb +7 -19
  45. data/app/controllers/spotlight/translations_controller.rb +46 -0
  46. data/app/helpers/spotlight/application_helper.rb +1 -1
  47. data/app/helpers/spotlight/crop_helper.rb +4 -1
  48. data/app/helpers/spotlight/crud_link_helpers.rb +1 -1
  49. data/app/helpers/spotlight/main_app_helpers.rb +1 -1
  50. data/app/jobs/spotlight/add_uploads_from_csv.rb +30 -5
  51. data/app/mailers/spotlight/indexing_complete_mailer.rb +3 -2
  52. data/app/models/concerns/spotlight/exhibit_defaults.rb +1 -1
  53. data/app/models/concerns/spotlight/translatables.rb +17 -1
  54. data/app/models/sir_trevor_rails/blocks/browse_group_categories_block.rb +25 -0
  55. data/app/models/spotlight/ability.rb +2 -0
  56. data/app/models/spotlight/about_page.rb +3 -1
  57. data/app/models/spotlight/blacklight_configuration.rb +2 -1
  58. data/app/models/spotlight/contact.rb +1 -1
  59. data/app/models/spotlight/custom_field.rb +3 -3
  60. data/app/models/spotlight/exhibit.rb +18 -4
  61. data/app/models/spotlight/feature_page.rb +3 -1
  62. data/app/models/spotlight/featured_image.rb +29 -12
  63. data/app/models/spotlight/group.rb +22 -0
  64. data/app/models/spotlight/group_member.rb +11 -0
  65. data/app/models/spotlight/home_page.rb +3 -1
  66. data/app/models/spotlight/main_navigation.rb +2 -2
  67. data/app/models/spotlight/masthead.rb +1 -1
  68. data/app/models/spotlight/page.rb +5 -1
  69. data/app/models/spotlight/page_configurations.rb +6 -0
  70. data/app/models/spotlight/page_content.rb +2 -0
  71. data/app/models/spotlight/resources/csv_upload.rb +2 -1
  72. data/app/models/spotlight/resources/iiif_manifest.rb +8 -6
  73. data/app/models/spotlight/resources/upload.rb +1 -1
  74. data/app/models/spotlight/search.rb +10 -1
  75. data/app/models/spotlight/solr_document_sidecar.rb +7 -5
  76. data/app/models/spotlight/temporary_image.rb +8 -0
  77. data/app/services/spotlight/exhibit_import_export_service.rb +482 -0
  78. data/app/services/spotlight/solr_document_builder.rb +1 -0
  79. data/app/values/custom_field_name.rb +1 -0
  80. data/app/views/catalog/_save_search.html.erb +1 -1
  81. data/app/views/spotlight/about_pages/_empty.html.erb +5 -5
  82. data/app/views/spotlight/browse/_search.html.erb +5 -3
  83. data/app/views/spotlight/browse/_search_title.html.erb +2 -1
  84. data/app/views/spotlight/browse/index.html.erb +13 -0
  85. data/app/views/spotlight/catalog/_document.html.erb +2 -4
  86. data/app/views/spotlight/catalog/index.iiif_json.jbuilder +22 -0
  87. data/app/views/spotlight/contacts/_form.html.erb +1 -1
  88. data/app/views/spotlight/feature_pages/_empty.html.erb +5 -5
  89. data/app/views/spotlight/featured_images/_form.html.erb +1 -1
  90. data/app/views/spotlight/featured_images/_upload_form.html.erb +1 -1
  91. data/app/views/spotlight/home_pages/_empty.html.erb +3 -3
  92. data/app/views/spotlight/indexing_complete_mailer/documents_indexed.html.erb +9 -0
  93. data/app/views/spotlight/pages/_form.html.erb +2 -2
  94. data/app/views/spotlight/searches/_form.html.erb +13 -0
  95. data/app/views/spotlight/searches/_group.html.erb +27 -0
  96. data/app/views/spotlight/searches/_search.html.erb +1 -0
  97. data/app/views/spotlight/searches/index.html.erb +58 -17
  98. data/app/views/spotlight/shared/_honeypot_field.html.erb +4 -0
  99. data/app/views/spotlight/shared/_report_a_problem.html.erb +7 -10
  100. data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -0
  101. data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +44 -0
  102. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +7 -1
  103. data/app/views/spotlight/translations/_browse_categories.html.erb +29 -3
  104. data/app/views/spotlight/translations/_general.html.erb +7 -7
  105. data/app/views/spotlight/translations/_groups.html.erb +34 -0
  106. data/app/views/spotlight/translations/_import.html.erb +24 -0
  107. data/app/views/spotlight/translations/_metadata.html.erb +1 -1
  108. data/app/views/spotlight/translations/_page.html.erb +5 -5
  109. data/app/views/spotlight/translations/_pages.html.erb +4 -4
  110. data/app/views/spotlight/translations/_pages_table.html.erb +5 -5
  111. data/app/views/spotlight/translations/_search_fields.html.erb +3 -3
  112. data/app/views/spotlight/translations/edit.html.erb +14 -6
  113. data/app/views/spotlight/translations/show.yaml.yamlbuilder +81 -0
  114. data/config/i18n-tasks.yml +7 -0
  115. data/config/locales/spotlight.ar.yml +47 -24
  116. data/config/locales/spotlight.en.yml +182 -127
  117. data/config/routes.rb +16 -1
  118. data/db/migrate/20200403161512_add_subtitle_to_searches.rb +7 -0
  119. data/db/migrate/20210113092223_create_spotlight_groups.rb +23 -0
  120. data/lib/generators/spotlight/install_generator.rb +23 -2
  121. data/lib/generators/spotlight/templates/config/initializers/sir_trevor_rails.rb +10 -0
  122. data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +3 -1
  123. data/lib/spotlight/engine.rb +27 -3
  124. data/lib/spotlight/upload_field_config.rb +1 -0
  125. data/lib/spotlight/version.rb +1 -1
  126. data/spec/controllers/spotlight/about_pages_controller_spec.rb +3 -3
  127. data/spec/controllers/spotlight/browse_controller_spec.rb +24 -1
  128. data/spec/controllers/spotlight/catalog_controller_spec.rb +1 -1
  129. data/spec/controllers/spotlight/contacts_controller_spec.rb +2 -2
  130. data/spec/controllers/spotlight/feature_pages_controller_spec.rb +11 -0
  131. data/spec/controllers/spotlight/groups_controller_spec.rb +103 -0
  132. data/spec/controllers/spotlight/home_pages_controller_spec.rb +2 -2
  133. data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +4 -4
  134. data/spec/controllers/spotlight/resources/upload_controller_spec.rb +2 -2
  135. data/spec/controllers/spotlight/searches_controller_spec.rb +10 -3
  136. data/spec/controllers/spotlight/translations_controller_spec.rb +53 -2
  137. data/spec/controllers/spotlight/view_configurations_controller_spec.rb +1 -1
  138. data/spec/examples.txt +1437 -1389
  139. data/spec/factories/featured_images.rb +4 -0
  140. data/spec/factories/group.rb +17 -0
  141. data/spec/factories/searches.rb +11 -1
  142. data/spec/features/add_contacts_spec.rb +1 -1
  143. data/spec/features/browse_category_admin_spec.rb +39 -7
  144. data/spec/features/browse_category_navigation_spec.rb +44 -0
  145. data/spec/features/browse_category_spec.rb +2 -2
  146. data/spec/features/catalog_spec.rb +2 -2
  147. data/spec/features/create_exhibit_spec.rb +5 -4
  148. data/spec/features/dashboard_spec.rb +7 -7
  149. data/spec/features/edit_search_fields_spec.rb +2 -2
  150. data/spec/features/exhibits/administration_spec.rb +3 -3
  151. data/spec/features/exhibits/edit_metadata_fields_spec.rb +1 -1
  152. data/spec/features/exhibits/language_create_edit_spec.rb +3 -3
  153. data/spec/features/exhibits/translation_editing_spec.rb +57 -8
  154. data/spec/features/home_page_spec.rb +13 -4
  155. data/spec/features/item_admin_spec.rb +4 -4
  156. data/spec/features/javascript/about_page_admin_spec.rb +1 -1
  157. data/spec/features/javascript/block_controls_spec.rb +3 -1
  158. data/spec/features/javascript/blocks/browse_group_categories_block_spec.rb +64 -0
  159. data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +4 -1
  160. data/spec/features/javascript/browse_group_admin_spec.rb +45 -0
  161. data/spec/features/javascript/edit_in_place_spec.rb +3 -3
  162. data/spec/features/javascript/feature_page_admin_spec.rb +1 -1
  163. data/spec/features/javascript/search_config_admin_spec.rb +1 -1
  164. data/spec/features/report_a_problem_spec.rb +6 -5
  165. data/spec/helpers/spotlight/crud_link_helpers_spec.rb +3 -3
  166. data/spec/helpers/spotlight/pages_helper_spec.rb +2 -2
  167. data/spec/i18n_spec.rb +0 -2
  168. data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +13 -1
  169. data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +11 -1
  170. data/spec/models/sir_trevor_rails/blocks/browse_group_categories_block_spec.rb +41 -0
  171. data/spec/models/solr_document_spec.rb +2 -3
  172. data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +1 -0
  173. data/spec/models/spotlight/exhibit_spec.rb +18 -2
  174. data/spec/models/spotlight/featured_image_spec.rb +27 -0
  175. data/spec/models/spotlight/group_spec.rb +19 -0
  176. data/spec/models/spotlight/main_navigation_spec.rb +1 -1
  177. data/spec/models/spotlight/page_spec.rb +6 -1
  178. data/spec/models/spotlight/resources/upload_spec.rb +43 -79
  179. data/spec/models/spotlight/role_spec.rb +3 -3
  180. data/spec/models/spotlight/search_spec.rb +30 -3
  181. data/spec/{serializers/spotlight/exhibit_export_serializer_spec.rb → services/spotlight/exhibit_import_export_service_spec.rb} +168 -23
  182. data/spec/services/spotlight/iiif_resource_resolver_spec.rb +1 -1
  183. data/spec/services/spotlight/solr_document_builder_spec.rb +1 -1
  184. data/spec/spec_helper.rb +1 -1
  185. data/spec/support/features/test_features_helpers.rb +15 -0
  186. data/spec/test_app_templates/Gemfile.extra +1 -3
  187. data/spec/test_app_templates/catalog_controller.rb +6 -3
  188. data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
  189. data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +1 -1
  190. data/spec/views/spotlight/browse/index.html.erb_spec.rb +2 -0
  191. data/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb +1 -1
  192. data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +6 -6
  193. data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +3 -3
  194. data/spec/views/spotlight/pages/show.html.erb_spec.rb +1 -0
  195. data/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb +1 -1
  196. data/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb +7 -8
  197. data/spec/views/spotlight/translations/_import.html.erb_spec.rb +24 -0
  198. data/vendor/assets/javascripts/leaflet-iiif.js +46 -21
  199. data/vendor/assets/javascripts/tiny-slider.js +3218 -0
  200. data/vendor/assets/stylesheets/tiny-slider.css +1 -0
  201. metadata +399 -284
  202. data/app/serializers/spotlight/exhibit_export_serializer.rb +0 -205
  203. data/app/serializers/spotlight/featured_image_representer.rb +0 -29
  204. data/app/serializers/spotlight/main_navigation_representer.rb +0 -13
  205. data/app/serializers/spotlight/page_representer.rb +0 -33
  206. 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
  }