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.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/app/assets/images/blacklight/arrow-alt-circle-left.svg +1 -0
- data/app/assets/images/blacklight/arrow-alt-circle-right.svg +1 -0
- data/app/assets/javascripts/spotlight/admin/{add_new_page_button.js → add_new_button.js} +7 -0
- data/app/assets/javascripts/spotlight/admin/block_mixins/autocompleteable.js +4 -4
- data/app/assets/javascripts/spotlight/admin/blocks/browse_block.js +55 -1
- data/app/assets/javascripts/spotlight/admin/blocks/browse_group_categories_block.js +88 -0
- data/app/assets/javascripts/spotlight/admin/blocks/pages_block.js +1 -1
- data/app/assets/javascripts/spotlight/admin/blocks/solr_documents_base_block.js +1 -1
- data/app/assets/javascripts/spotlight/admin/blocks/uploaded_items_block.js +7 -2
- data/app/assets/javascripts/spotlight/admin/crop.es6 +11 -0
- data/app/assets/javascripts/spotlight/admin/croppable.js +1 -1
- data/app/assets/javascripts/spotlight/admin/index.js +0 -2
- data/app/assets/javascripts/spotlight/admin/reindex_monitor.js +1 -0
- data/app/assets/javascripts/spotlight/admin/search_typeahead.js +2 -2
- data/app/assets/javascripts/spotlight/admin/sir-trevor/block_controls.js +21 -12
- data/app/assets/javascripts/spotlight/admin/sir-trevor/locales.js +11 -3
- data/app/assets/javascripts/spotlight/user/browse_group_categories.js +59 -0
- data/app/assets/javascripts/spotlight/user/index.js +1 -0
- data/app/assets/stylesheets/spotlight/_accessibility.scss +1 -1
- data/app/assets/stylesheets/spotlight/_breadcrumbs.scss +8 -0
- data/app/assets/stylesheets/spotlight/_browse.scss +16 -0
- data/app/assets/stylesheets/spotlight/_catalog.scss +6 -6
- data/app/assets/stylesheets/spotlight/_curation.scss +6 -0
- data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +214 -83
- data/app/assets/stylesheets/spotlight/_header.scss +1 -1
- data/app/assets/stylesheets/spotlight/_item_text_block.scss +6 -0
- data/app/assets/stylesheets/spotlight/_pages.scss +9 -4
- data/app/assets/stylesheets/spotlight/_report_a_problem.scss +5 -2
- data/app/assets/stylesheets/spotlight/_spotlight.scss +2 -0
- data/app/assets/stylesheets/spotlight/_translations.scss +7 -0
- data/app/assets/stylesheets/spotlight/browse_group_categories_block.scss +92 -0
- data/app/builders/spotlight/bootstrap_breadcrumbs_builder.rb +1 -2
- data/app/controllers/concerns/spotlight/search_helper.rb +2 -8
- data/app/controllers/spotlight/appearances_controller.rb +0 -12
- data/app/controllers/spotlight/browse_controller.rb +7 -3
- data/app/controllers/spotlight/catalog_controller.rb +5 -2
- data/app/controllers/spotlight/concerns/application_controller.rb +13 -2
- data/app/controllers/spotlight/dashboards_controller.rb +1 -1
- data/app/controllers/spotlight/exhibits_controller.rb +2 -3
- data/app/controllers/spotlight/featured_images_controller.rb +1 -1
- data/app/controllers/spotlight/groups_controller.rb +80 -0
- data/app/controllers/spotlight/pages_controller.rb +6 -9
- data/app/controllers/spotlight/resources/csv_upload_controller.rb +1 -1
- data/app/controllers/spotlight/searches_controller.rb +7 -19
- data/app/controllers/spotlight/translations_controller.rb +46 -0
- data/app/helpers/spotlight/application_helper.rb +20 -1
- data/app/helpers/spotlight/crop_helper.rb +4 -1
- data/app/helpers/spotlight/crud_link_helpers.rb +1 -1
- data/app/helpers/spotlight/main_app_helpers.rb +1 -1
- data/app/helpers/spotlight/pages_helper.rb +1 -1
- data/app/jobs/concerns/spotlight/job_tracking.rb +47 -0
- data/app/jobs/concerns/spotlight/limit_concurrency.rb +33 -0
- data/app/jobs/spotlight/add_uploads_from_csv.rb +34 -6
- data/app/jobs/spotlight/application_job.rb +8 -0
- data/app/jobs/spotlight/cleanup_job_trackers_job.rb +13 -0
- data/app/jobs/spotlight/default_thumbnail_job.rb +1 -3
- data/app/jobs/spotlight/reindex_exhibit_job.rb +36 -0
- data/app/jobs/spotlight/reindex_job.rb +49 -41
- data/app/jobs/spotlight/rename_sidecar_field_job.rb +2 -2
- data/app/jobs/spotlight/update_job_trackers_job.rb +20 -0
- data/app/mailers/spotlight/indexing_complete_mailer.rb +3 -2
- data/app/models/concerns/spotlight/exhibit_defaults.rb +1 -1
- data/app/models/concerns/spotlight/translatables.rb +17 -1
- data/app/models/concerns/spotlight/user.rb +2 -1
- data/app/models/sir_trevor_rails/blocks/browse_group_categories_block.rb +25 -0
- data/app/models/spotlight/ability.rb +2 -0
- data/app/models/spotlight/about_page.rb +3 -1
- data/app/models/spotlight/blacklight_configuration.rb +2 -1
- data/app/models/spotlight/contact.rb +1 -1
- data/app/models/spotlight/custom_field.rb +3 -3
- data/app/models/spotlight/event.rb +13 -0
- data/app/models/spotlight/exhibit.rb +18 -14
- data/app/models/spotlight/feature_page.rb +3 -1
- data/app/models/spotlight/featured_image.rb +29 -12
- data/app/models/spotlight/group.rb +22 -0
- data/app/models/spotlight/group_member.rb +11 -0
- data/app/models/spotlight/home_page.rb +3 -1
- data/app/models/spotlight/job_tracker.rb +105 -0
- data/app/models/spotlight/main_navigation.rb +2 -2
- data/app/models/spotlight/masthead.rb +1 -1
- data/app/models/spotlight/page.rb +5 -1
- data/app/models/spotlight/page_configurations.rb +6 -0
- data/app/models/spotlight/page_content.rb +2 -0
- data/app/models/spotlight/reindex_progress.rb +44 -27
- data/app/models/spotlight/resource.rb +24 -58
- data/app/models/spotlight/resources/csv_upload.rb +2 -1
- data/app/models/spotlight/resources/iiif_harvester.rb +10 -1
- data/app/models/spotlight/resources/iiif_manifest.rb +11 -7
- data/app/models/spotlight/resources/iiif_service.rb +1 -1
- data/app/models/spotlight/resources/json_upload.rb +12 -0
- data/app/models/spotlight/resources/upload.rb +25 -2
- data/app/models/spotlight/search.rb +10 -1
- data/app/models/spotlight/solr_document_sidecar.rb +9 -6
- data/app/models/spotlight/temporary_image.rb +8 -0
- data/app/services/spotlight/etl.rb +7 -0
- data/app/services/spotlight/etl/context.rb +52 -0
- data/app/services/spotlight/etl/executor.rb +194 -0
- data/app/services/spotlight/etl/loaders.rb +12 -0
- data/app/services/spotlight/etl/pipeline.rb +81 -0
- data/app/services/spotlight/etl/solr_loader.rb +96 -0
- data/app/services/spotlight/etl/sources.rb +25 -0
- data/app/services/spotlight/etl/step.rb +82 -0
- data/app/services/spotlight/etl/transforms.rb +64 -0
- data/app/services/spotlight/exhibit_import_export_service.rb +482 -0
- data/app/services/spotlight/validity_checker.rb +5 -5
- data/app/values/custom_field_name.rb +1 -0
- data/app/views/catalog/_save_search.html.erb +1 -1
- data/app/views/spotlight/about_pages/_empty.html.erb +5 -5
- data/app/views/spotlight/browse/_search.html.erb +5 -3
- data/app/views/spotlight/browse/_search_title.html.erb +2 -1
- data/app/views/spotlight/browse/index.html.erb +13 -0
- data/app/views/spotlight/catalog/_document.html.erb +2 -4
- data/app/views/spotlight/catalog/index.iiif_json.jbuilder +22 -0
- data/app/views/spotlight/contacts/_form.html.erb +1 -1
- data/app/views/spotlight/dashboards/_reindexing_activity.html.erb +6 -6
- data/app/views/spotlight/feature_pages/_empty.html.erb +5 -5
- data/app/views/spotlight/featured_images/_form.html.erb +1 -1
- data/app/views/spotlight/featured_images/_upload_form.html.erb +1 -1
- data/app/views/spotlight/home_pages/_empty.html.erb +3 -3
- data/app/views/spotlight/indexing_complete_mailer/documents_indexed.html.erb +9 -0
- data/app/views/spotlight/pages/_form.html.erb +2 -2
- data/app/views/spotlight/searches/_form.html.erb +13 -0
- data/app/views/spotlight/searches/_group.html.erb +27 -0
- data/app/views/spotlight/searches/_search.html.erb +1 -0
- data/app/views/spotlight/searches/index.html.erb +58 -17
- data/app/views/spotlight/shared/_honeypot_field.html.erb +4 -0
- data/app/views/spotlight/shared/_locale_picker.html.erb +1 -1
- data/app/views/spotlight/shared/_report_a_problem.html.erb +7 -10
- data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -0
- data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +45 -0
- data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +7 -1
- data/app/views/spotlight/translations/_browse_categories.html.erb +29 -3
- data/app/views/spotlight/translations/_general.html.erb +7 -7
- data/app/views/spotlight/translations/_groups.html.erb +34 -0
- data/app/views/spotlight/translations/_import.html.erb +24 -0
- data/app/views/spotlight/translations/_metadata.html.erb +1 -1
- data/app/views/spotlight/translations/_page.html.erb +5 -5
- data/app/views/spotlight/translations/_pages.html.erb +4 -4
- data/app/views/spotlight/translations/_pages_table.html.erb +5 -5
- data/app/views/spotlight/translations/_search_fields.html.erb +3 -3
- data/app/views/spotlight/translations/edit.html.erb +14 -6
- data/app/views/spotlight/translations/show.yaml.yamlbuilder +81 -0
- data/config/i18n-tasks.yml +7 -0
- data/config/locales/spotlight.ar.yml +57 -24
- data/config/locales/spotlight.en.yml +184 -128
- data/config/routes.rb +16 -1
- data/db/migrate/20200403161512_add_subtitle_to_searches.rb +7 -0
- data/db/migrate/20210113092223_create_spotlight_groups.rb +23 -0
- data/db/migrate/20210122082032_create_job_trackers.rb +22 -0
- data/db/migrate/20210126123041_create_events.rb +15 -0
- data/lib/generators/spotlight/install_generator.rb +23 -2
- data/lib/generators/spotlight/scaffold_resource_generator.rb +5 -13
- data/lib/generators/spotlight/templates/config/initializers/sir_trevor_rails.rb +10 -0
- data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +3 -1
- data/lib/spotlight/engine.rb +35 -4
- data/lib/spotlight/upload_field_config.rb +1 -0
- data/lib/spotlight/version.rb +1 -1
- data/spec/controllers/spotlight/about_pages_controller_spec.rb +3 -3
- data/spec/controllers/spotlight/browse_controller_spec.rb +24 -1
- data/spec/controllers/spotlight/catalog_controller_spec.rb +4 -2
- data/spec/controllers/spotlight/contacts_controller_spec.rb +2 -2
- data/spec/controllers/spotlight/feature_pages_controller_spec.rb +11 -0
- data/spec/controllers/spotlight/groups_controller_spec.rb +103 -0
- data/spec/controllers/spotlight/home_pages_controller_spec.rb +2 -2
- data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +4 -4
- data/spec/controllers/spotlight/searches_controller_spec.rb +10 -3
- data/spec/controllers/spotlight/translations_controller_spec.rb +53 -2
- data/spec/controllers/spotlight/view_configurations_controller_spec.rb +1 -1
- data/spec/examples.txt +1448 -125
- data/spec/factories/featured_images.rb +4 -0
- data/spec/factories/group.rb +17 -0
- data/spec/factories/job_trackers.rb +9 -0
- data/spec/factories/searches.rb +11 -1
- data/spec/features/add_contacts_spec.rb +1 -1
- data/spec/features/add_items_spec.rb +9 -4
- data/spec/features/browse_category_admin_spec.rb +39 -7
- data/spec/features/browse_category_navigation_spec.rb +44 -0
- data/spec/features/browse_category_spec.rb +2 -2
- data/spec/features/catalog_spec.rb +2 -2
- data/spec/features/create_exhibit_spec.rb +5 -4
- data/spec/features/dashboard_spec.rb +7 -7
- data/spec/features/edit_search_fields_spec.rb +2 -2
- data/spec/features/exhibits/administration_spec.rb +3 -3
- data/spec/features/exhibits/edit_metadata_fields_spec.rb +1 -1
- data/spec/features/exhibits/language_create_edit_spec.rb +3 -3
- data/spec/features/exhibits/translation_editing_spec.rb +57 -8
- data/spec/features/home_page_spec.rb +13 -4
- data/spec/features/item_admin_spec.rb +4 -4
- data/spec/features/javascript/about_page_admin_spec.rb +1 -1
- data/spec/features/javascript/block_controls_spec.rb +3 -1
- data/spec/features/javascript/blocks/browse_group_categories_block_spec.rb +64 -0
- data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +4 -1
- data/spec/features/javascript/browse_group_admin_spec.rb +45 -0
- data/spec/features/javascript/edit_in_place_spec.rb +3 -3
- data/spec/features/javascript/feature_page_admin_spec.rb +1 -1
- data/spec/features/javascript/reindex_monitor_spec.rb +1 -1
- data/spec/features/javascript/search_config_admin_spec.rb +1 -1
- data/spec/features/report_a_problem_spec.rb +6 -5
- data/spec/features/site_users_management_spec.rb +4 -4
- data/spec/helpers/spotlight/crud_link_helpers_spec.rb +3 -3
- data/spec/helpers/spotlight/pages_helper_spec.rb +10 -2
- data/spec/i18n_spec.rb +0 -2
- data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +13 -1
- data/spec/jobs/spotlight/reindex_exhibit_job_spec.rb +43 -0
- data/spec/jobs/spotlight/reindex_job_spec.rb +30 -59
- data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +11 -1
- data/spec/models/sir_trevor_rails/blocks/browse_group_categories_block_spec.rb +41 -0
- data/spec/models/solr_document_spec.rb +2 -3
- data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +1 -0
- data/spec/models/spotlight/exhibit_spec.rb +21 -59
- data/spec/models/spotlight/featured_image_spec.rb +27 -0
- data/spec/models/spotlight/group_spec.rb +19 -0
- data/spec/models/spotlight/main_navigation_spec.rb +1 -1
- data/spec/models/spotlight/page_spec.rb +6 -1
- data/spec/models/spotlight/reindex_progress_spec.rb +89 -87
- data/spec/models/spotlight/resource_spec.rb +69 -90
- data/spec/models/spotlight/resources/iiif_harvester_spec.rb +9 -10
- data/spec/models/spotlight/resources/upload_spec.rb +43 -79
- data/spec/models/spotlight/role_spec.rb +3 -3
- data/spec/models/spotlight/search_spec.rb +30 -3
- data/spec/models/spotlight/solr_document_sidecar_spec.rb +1 -0
- data/spec/services/spotlight/etl/context_spec.rb +66 -0
- data/spec/services/spotlight/etl/executor_spec.rb +149 -0
- data/spec/services/spotlight/etl/pipeline_spec.rb +22 -0
- data/spec/services/spotlight/etl/solr_loader_spec.rb +76 -0
- data/spec/services/spotlight/etl/step_spec.rb +70 -0
- data/spec/{serializers/spotlight/exhibit_export_serializer_spec.rb → services/spotlight/exhibit_import_export_service_spec.rb} +168 -23
- data/spec/services/spotlight/iiif_resource_resolver_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -6
- data/spec/support/features/test_features_helpers.rb +15 -0
- data/spec/test_app_templates/Gemfile.extra +1 -3
- data/spec/test_app_templates/catalog_controller.rb +6 -3
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
- data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/browse/index.html.erb_spec.rb +2 -0
- data/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +28 -25
- data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +3 -3
- data/spec/views/spotlight/pages/show.html.erb_spec.rb +1 -0
- data/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb +7 -8
- data/spec/views/spotlight/translations/_import.html.erb_spec.rb +24 -0
- data/vendor/assets/javascripts/leaflet-iiif.js +46 -21
- data/vendor/assets/javascripts/tiny-slider.js +3218 -0
- data/vendor/assets/stylesheets/tiny-slider.css +1 -0
- metadata +444 -289
- data/app/models/concerns/spotlight/resources/open_graph.rb +0 -36
- data/app/models/spotlight/reindexing_log_entry.rb +0 -42
- data/app/serializers/spotlight/exhibit_export_serializer.rb +0 -205
- data/app/serializers/spotlight/featured_image_representer.rb +0 -29
- data/app/serializers/spotlight/main_navigation_representer.rb +0 -13
- data/app/serializers/spotlight/page_representer.rb +0 -33
- data/app/services/spotlight/resources/iiif_builder.rb +0 -19
- data/app/services/spotlight/solr_document_builder.rb +0 -76
- data/app/services/spotlight/upload_solr_document_builder.rb +0 -57
- data/spec/factories/reindexing_log_entries.rb +0 -54
- data/spec/models/spotlight/reindexing_log_entry_spec.rb +0 -129
- data/spec/models/spotlight/resources/open_graph_spec.rb +0 -65
- data/spec/services/spotlight/solr_document_builder_spec.rb +0 -66
- 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
|
+
});
|
@@ -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
|
-
|
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
|
}
|
@@ -1,138 +1,269 @@
|
|
1
1
|
$featured-browse-category-border-color: $border-color;
|
2
2
|
$featured-browse-category-caption-color: $white;
|
3
|
-
|
4
|
-
|
5
|
-
$container-
|
6
|
-
//
|
7
|
-
$
|
8
|
-
$
|
9
|
-
$
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
//
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
$
|
22
|
-
|
23
|
-
//
|
24
|
-
$
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
$
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
$
|
34
|
-
$
|
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
|
-
|
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
|
68
|
+
text-shadow: 0 1px 0 $black;
|
50
69
|
width: 100%;
|
51
70
|
}
|
71
|
+
|
52
72
|
.category-title {
|
53
|
-
font-size: $font-size
|
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
|
-
|
65
|
-
|
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:
|
68
|
-
|
69
|
-
|
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
|
-
|
74
|
-
|
75
|
-
|
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: $
|
79
|
-
height: $
|
179
|
+
width: $xl-four-tile-width;
|
180
|
+
height: $xl-four-tile-width * $aspect-ratio-factor-4x3;
|
80
181
|
}
|
81
182
|
}
|
82
183
|
}
|
83
|
-
&.categories-
|
184
|
+
&.categories-5 {
|
84
185
|
.browse-category {
|
85
|
-
width:
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
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
|
-
|
93
|
-
|
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
|
-
|
96
|
-
|
97
|
-
@
|
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-
|
230
|
+
&.categories-3 {
|
104
231
|
.browse-category {
|
105
|
-
width:
|
106
|
-
|
107
|
-
|
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: $
|
117
|
-
height: $
|
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-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
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: $
|
131
|
-
height: $
|
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
|
-
|
136
|
-
|
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
|
}
|