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
@@ -58,13 +58,18 @@
|
|
58
58
|
}
|
59
59
|
|
60
60
|
.contact-properties {
|
61
|
-
padding-left:
|
62
|
-
|
61
|
+
padding-left: 0.125rem;
|
62
|
+
|
63
|
+
> div {
|
64
|
+
padding-bottom: 5px;
|
65
|
+
}
|
63
66
|
}
|
64
67
|
|
65
68
|
ol.contacts {
|
69
|
+
line-height: 1.33;
|
70
|
+
|
66
71
|
li {
|
67
|
-
margin-bottom:
|
72
|
+
margin-bottom: 1rem;
|
68
73
|
margin-top: $spacer * .5;
|
69
74
|
word-break: break-word;
|
70
75
|
.name {
|
@@ -76,7 +81,7 @@
|
|
76
81
|
ol.sidenav {
|
77
82
|
li {
|
78
83
|
color: $gray-900;
|
79
|
-
margin-top: $spacer * .
|
84
|
+
margin-top: $spacer * .5;
|
80
85
|
}
|
81
86
|
|
82
87
|
ol.subsection {
|
@@ -5,7 +5,9 @@
|
|
5
5
|
@import "spotlight/sir-trevor_overrides";
|
6
6
|
@import "spotlight/attachments";
|
7
7
|
@import "spotlight/pages";
|
8
|
+
@import "spotlight/breadcrumbs";
|
8
9
|
@import "spotlight/browse";
|
10
|
+
@import "spotlight/browse_group_categories_block";
|
9
11
|
@import "spotlight/header";
|
10
12
|
@import "spotlight/footer";
|
11
13
|
@import "spotlight/catalog";
|
@@ -36,6 +36,7 @@
|
|
36
36
|
}
|
37
37
|
}
|
38
38
|
|
39
|
+
.translation-subtitle-toggle,
|
39
40
|
.translation-description-toggle {
|
40
41
|
margin: 0;
|
41
42
|
padding: 0;
|
@@ -77,3 +78,9 @@
|
|
77
78
|
margin-top: $spacer;
|
78
79
|
padding-bottom: 3px;
|
79
80
|
}
|
81
|
+
|
82
|
+
.translation-import-export-label {
|
83
|
+
@media (min-width: 576px) {
|
84
|
+
text-align: right;
|
85
|
+
}
|
86
|
+
}
|
@@ -0,0 +1,92 @@
|
|
1
|
+
@import "tiny-slider";
|
2
|
+
|
3
|
+
.browse-group-categories-block {
|
4
|
+
padding-bottom: $spacer * .75;
|
5
|
+
padding-top: $spacer * .75;
|
6
|
+
|
7
|
+
.browse-categories .browse-category {
|
8
|
+
.category-caption {
|
9
|
+
z-index: 100;
|
10
|
+
}
|
11
|
+
|
12
|
+
.hover-overlay {
|
13
|
+
height: 100%;
|
14
|
+
position: absolute;
|
15
|
+
width: 100%;
|
16
|
+
}
|
17
|
+
|
18
|
+
&:hover {
|
19
|
+
.hover-overlay {
|
20
|
+
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7));
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
.spotlight-flexbox.browse-categories .box {
|
26
|
+
display: flex;
|
27
|
+
}
|
28
|
+
|
29
|
+
.browse-group-categories-controls {
|
30
|
+
list-style: none;
|
31
|
+
li {
|
32
|
+
display: inline-block;
|
33
|
+
cursor: pointer;
|
34
|
+
}
|
35
|
+
|
36
|
+
.blacklight-icon-arrow-alt-circle-left, .blacklight-icon-arrow-alt-circle-right {
|
37
|
+
display: inline-block;
|
38
|
+
fill: $gray-600;
|
39
|
+
height: 44px;
|
40
|
+
width: 44px;
|
41
|
+
|
42
|
+
&:hover,&:focus {
|
43
|
+
fill: $gray-700;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
li[aria-disabled="true"] {
|
48
|
+
cursor: auto;
|
49
|
+
}
|
50
|
+
|
51
|
+
[aria-disabled="true"] {
|
52
|
+
.blacklight-icon-arrow-alt-circle-left, .blacklight-icon-arrow-alt-circle-right {
|
53
|
+
fill: $gray-400;
|
54
|
+
|
55
|
+
&:hover,&:focus {
|
56
|
+
fill: $gray-400;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
// Coming from tiny-slider, make sure these disappear when navigating via turbolinks
|
63
|
+
.tns-controls {
|
64
|
+
display: none;
|
65
|
+
}
|
66
|
+
|
67
|
+
@media screen and (min-width: breakpoint-min("md")) {
|
68
|
+
.browse-group-categories-controls {
|
69
|
+
.blacklight-icon-arrow-alt-circle-left, .blacklight-icon-arrow-alt-circle-right {
|
70
|
+
height: 32px;
|
71
|
+
width: 32px;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
&[data-browse-group-categories-count="2"],&[data-browse-group-categories-count="3"] {
|
76
|
+
.browse-group-categories-controls {
|
77
|
+
display: none !important;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
[dir="rtl"] {
|
84
|
+
.browse-group-categories-block .blacklight-icon-arrow-alt-circle-left, .blacklight-icon-arrow-alt-circle-right{
|
85
|
+
transform: rotate(180deg);
|
86
|
+
}
|
87
|
+
// Hack to override overflow issue not fixed in RTL upstream in tiny-slider
|
88
|
+
.tns-visually-hidden {
|
89
|
+
left: 0;
|
90
|
+
right: -10000em;
|
91
|
+
}
|
92
|
+
}
|
@@ -31,8 +31,7 @@ module Spotlight
|
|
31
31
|
private
|
32
32
|
|
33
33
|
def element_label(element)
|
34
|
-
|
35
|
-
@context.truncate(label, escape: !label.html_safe?, length: 30, separator: ' ')
|
34
|
+
@context.content_tag(:span, class: 'truncated-value') { compute_name(element) }
|
36
35
|
end
|
37
36
|
end
|
38
37
|
end
|
@@ -4,15 +4,9 @@ module Spotlight
|
|
4
4
|
# ...
|
5
5
|
module SearchHelper
|
6
6
|
def search_service(user_params = respond_to?(:search_state, true) ? search_state.to_h : {})
|
7
|
-
|
8
|
-
end
|
7
|
+
klass = respond_to?(:search_service_class) ? search_service_class : Blacklight::SearchService
|
9
8
|
|
10
|
-
|
11
|
-
if defined?(super)
|
12
|
-
super
|
13
|
-
else
|
14
|
-
Blacklight::SearchService
|
15
|
-
end
|
9
|
+
klass.new(config: blacklight_config, user_params: user_params, **search_service_context)
|
16
10
|
end
|
17
11
|
|
18
12
|
# @return [Hash] a hash of context information to pass through to the search service
|
@@ -30,17 +30,5 @@ module Spotlight
|
|
30
30
|
masthead_attributes: featured_image_params,
|
31
31
|
thumbnail_attributes: featured_image_params)
|
32
32
|
end
|
33
|
-
|
34
|
-
def featured_image_params
|
35
|
-
%i[
|
36
|
-
iiif_region iiif_tilesource
|
37
|
-
iiif_manifest_url iiif_canvas_id
|
38
|
-
iiif_image_id
|
39
|
-
display
|
40
|
-
source
|
41
|
-
image
|
42
|
-
document_global_id
|
43
|
-
]
|
44
|
-
end
|
45
33
|
end
|
46
34
|
end
|
@@ -9,7 +9,8 @@ module Spotlight
|
|
9
9
|
include Spotlight::Catalog
|
10
10
|
include Blacklight::Facet
|
11
11
|
|
12
|
-
load_and_authorize_resource :
|
12
|
+
load_and_authorize_resource :group, through: :exhibit
|
13
|
+
load_and_authorize_resource :search, through: %i[group exhibit], parent: false
|
13
14
|
before_action :attach_breadcrumbs
|
14
15
|
before_action :attach_search_breadcrumb, only: :show
|
15
16
|
record_search_parameters only: :show
|
@@ -20,10 +21,12 @@ module Spotlight
|
|
20
21
|
|
21
22
|
before_action do
|
22
23
|
blacklight_config.track_search_session = false
|
24
|
+
blacklight_config.view.gallery.classes = 'row-cols-2 row-cols-md-4'
|
23
25
|
end
|
24
26
|
|
25
27
|
def index
|
26
|
-
@
|
28
|
+
@groups = @exhibit.groups.published
|
29
|
+
@searches = @searches.published
|
27
30
|
end
|
28
31
|
|
29
32
|
def show
|
@@ -66,10 +69,11 @@ module Spotlight
|
|
66
69
|
def attach_breadcrumbs
|
67
70
|
add_breadcrumb t(:'spotlight.curation.nav.home', title: @exhibit.title), @exhibit
|
68
71
|
add_breadcrumb(@exhibit.main_navigations.browse.label_or_default, exhibit_browse_index_path(@exhibit))
|
72
|
+
add_breadcrumb(@group.title, exhibit_browse_groups_path(@exhibit, @group)) if @group.present?
|
69
73
|
end
|
70
74
|
|
71
75
|
def attach_search_breadcrumb
|
72
|
-
add_breadcrumb @search.
|
76
|
+
add_breadcrumb @search.full_title, (@group.present? ? exhibit_browse_group_path(@exhibit, @group, @search) : exhibit_browse_path(@exhibit, @search))
|
73
77
|
end
|
74
78
|
|
75
79
|
def _prefixes
|
@@ -31,7 +31,10 @@ module Spotlight
|
|
31
31
|
blacklight_config.view.admin_table.document_actions = []
|
32
32
|
blacklight_config.track_search_session = false
|
33
33
|
|
34
|
-
|
34
|
+
unless blacklight_config.sort_fields.key? :timestamp
|
35
|
+
blacklight_config.add_sort_field :timestamp, default: true,
|
36
|
+
sort: "#{blacklight_config.index.timestamp_field} desc"
|
37
|
+
end
|
35
38
|
end
|
36
39
|
|
37
40
|
before_action only: :edit do
|
@@ -127,7 +130,7 @@ module Spotlight
|
|
127
130
|
# /exhibits/1?f%5Bgenre_sim%5D%5B%5D=map&q= is not the same as /exhibits/1
|
128
131
|
# Otherwise the exhibit breadcrumb won't be a link.
|
129
132
|
# see http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-current_page-3F
|
130
|
-
if view_context.current_page?(action: :admin)
|
133
|
+
if view_context.current_page?({ action: :admin })
|
131
134
|
add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), exhibit_root_path(@exhibit, q: '')
|
132
135
|
else
|
133
136
|
# When not on the admin page, get the translated value for the "Home" breadcrumb
|
@@ -38,7 +38,6 @@ module Spotlight
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
# rubocop:disable Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity
|
42
41
|
def field_enabled?(field, *args)
|
43
42
|
if !field.enabled
|
44
43
|
false
|
@@ -52,7 +51,6 @@ module Spotlight
|
|
52
51
|
field.send(document_index_view_type)
|
53
52
|
end
|
54
53
|
end
|
55
|
-
# rubocop:enable Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity
|
56
54
|
|
57
55
|
private
|
58
56
|
|
@@ -82,6 +80,19 @@ module Spotlight
|
|
82
80
|
def default_document_index_view_type
|
83
81
|
document_index_views.select { |_k, config| config.respond_to?(:default) && config.default }.keys.first || document_index_views.keys.first
|
84
82
|
end
|
83
|
+
|
84
|
+
def featured_image_params
|
85
|
+
%i[
|
86
|
+
iiif_region iiif_tilesource
|
87
|
+
iiif_manifest_url iiif_canvas_id
|
88
|
+
iiif_image_id
|
89
|
+
display
|
90
|
+
source
|
91
|
+
image
|
92
|
+
document_global_id
|
93
|
+
upload_id
|
94
|
+
]
|
95
|
+
end
|
85
96
|
end
|
86
97
|
end
|
87
98
|
end
|
@@ -22,7 +22,7 @@ module Spotlight
|
|
22
22
|
|
23
23
|
@pages = @exhibit.pages.recent.limit(5)
|
24
24
|
@solr_documents = load_recent_solr_documents 5
|
25
|
-
@recent_reindexing = @exhibit.
|
25
|
+
@recent_reindexing = @exhibit.job_trackers.recent
|
26
26
|
|
27
27
|
attach_dashboard_breadcrumbs
|
28
28
|
end
|
@@ -27,8 +27,7 @@ module Spotlight
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def process_import
|
30
|
-
@exhibit.import(JSON.parse(import_exhibit_params.read))
|
31
|
-
if @exhibit.save && @exhibit.reindex_later
|
30
|
+
if @exhibit.import(JSON.parse(import_exhibit_params.read)) && @exhibit.reindex_later(current_user)
|
32
31
|
redirect_to spotlight.exhibit_dashboard_path(@exhibit), notice: t(:'helpers.submit.exhibit.updated', model: @exhibit.class.model_name.human.downcase)
|
33
32
|
else
|
34
33
|
render action: :import
|
@@ -50,7 +49,7 @@ module Spotlight
|
|
50
49
|
respond_to do |format|
|
51
50
|
format.json do
|
52
51
|
authorize! :export, @exhibit
|
53
|
-
send_data JSON.pretty_generate(Spotlight::
|
52
|
+
send_data JSON.pretty_generate(Spotlight::ExhibitImportExportService.new(@exhibit).as_json),
|
54
53
|
type: 'application/json',
|
55
54
|
disposition: 'attachment',
|
56
55
|
filename: "#{@exhibit.friendly_id}-export.json"
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Spotlight
|
4
4
|
# Handles requests to upload images for exhibit thumbnails
|
5
5
|
class FeaturedImagesController < Spotlight::ApplicationController
|
6
|
-
load_and_authorize_resource instance_name: :featured_image
|
6
|
+
load_and_authorize_resource instance_name: :featured_image, class: 'Spotlight::TemporaryImage'
|
7
7
|
|
8
8
|
def create
|
9
9
|
if @featured_image.save && @featured_image.file_present?
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Spotlight
|
4
|
+
##
|
5
|
+
# Base CRUD controller for groups
|
6
|
+
class GroupsController < Spotlight::ApplicationController
|
7
|
+
before_action :authenticate_user!
|
8
|
+
load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
|
9
|
+
load_and_authorize_resource through: :exhibit
|
10
|
+
|
11
|
+
def index
|
12
|
+
respond_to do |format|
|
13
|
+
format.json do
|
14
|
+
render json: @groups.as_json, root: false
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# POST /exhibits/1/groups
|
20
|
+
def create
|
21
|
+
@group.attributes = group_params
|
22
|
+
|
23
|
+
if @group.save
|
24
|
+
redirect_to(
|
25
|
+
spotlight.exhibit_searches_path(anchor: 'browse-groups'),
|
26
|
+
notice: t(:'helpers.submit.group.created', model: human_name)
|
27
|
+
)
|
28
|
+
else
|
29
|
+
redirect_to spotlight.exhibit_searches_path(anchor: 'browse-groups')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# PATCH/PUT /groups/1
|
34
|
+
def update
|
35
|
+
@group.update(group_params)
|
36
|
+
|
37
|
+
redirect_to spotlight.exhibit_searches_path(anchor: 'browse-groups'), notice: t(:'helpers.submit.group.updated', model: human_name)
|
38
|
+
end
|
39
|
+
|
40
|
+
# DELETE /groups/1
|
41
|
+
def destroy
|
42
|
+
@group.destroy
|
43
|
+
|
44
|
+
redirect_to spotlight.exhibit_searches_path(anchor: 'browse-groups'), alert: t(:'helpers.submit.group.destroyed', model: human_name)
|
45
|
+
end
|
46
|
+
|
47
|
+
def update_all
|
48
|
+
notice = if @exhibit.update update_all_group_params
|
49
|
+
t(:'helpers.submit.group.batch_updated', model: human_name)
|
50
|
+
else
|
51
|
+
t(:'helpers.submit.group.batch_error', model: human_name)
|
52
|
+
end
|
53
|
+
redirect_to spotlight.exhibit_searches_path(anchor: 'browse-groups'), notice: notice
|
54
|
+
end
|
55
|
+
|
56
|
+
protected
|
57
|
+
|
58
|
+
def allowed_group_params
|
59
|
+
[:title]
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
def human_name
|
65
|
+
@human_name ||= @group ? @group.class.model_name.human.downcase : Spotlight::Group.model_name.human.pluralize
|
66
|
+
end
|
67
|
+
|
68
|
+
alias group_collection_name controller_name
|
69
|
+
|
70
|
+
def update_all_group_params
|
71
|
+
params.require(:exhibit).permit(
|
72
|
+
groups_attributes: %i[id title published weight]
|
73
|
+
)
|
74
|
+
end
|
75
|
+
|
76
|
+
def group_params
|
77
|
+
params.require(controller_name.singularize).permit(allowed_group_params)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|