blacklight-spotlight 3.0.0.alpha.2 → 3.0.0.alpha.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -4
- data/app/assets/javascripts/spotlight/admin/appearance.js +3 -3
- data/app/assets/javascripts/spotlight/admin/blocks/resources_block.js +18 -16
- data/app/assets/javascripts/spotlight/admin/blocks/uploaded_items_block.js +19 -20
- data/app/assets/javascripts/spotlight/admin/exhibits.js +6 -1
- data/app/assets/javascripts/spotlight/admin/multi_image_selector.js +1 -1
- data/app/assets/javascripts/spotlight/admin/search_typeahead.js +1 -1
- data/app/assets/javascripts/spotlight/admin/sir-trevor/locales.js +1 -1
- data/app/assets/javascripts/spotlight/admin/spotlight_nestable.js +6 -1
- data/app/assets/javascripts/spotlight/admin/tabs.js +2 -2
- data/app/assets/stylesheets/spotlight/_blacklight_configuration.scss +1 -35
- data/app/assets/stylesheets/spotlight/_bootstrap_overrides.scss +17 -10
- data/app/assets/stylesheets/spotlight/_browse.scss +11 -18
- data/app/assets/stylesheets/spotlight/_catalog.scss +13 -4
- data/app/assets/stylesheets/spotlight/_curation.scss +21 -14
- data/app/assets/stylesheets/spotlight/_exhibit_navbar.scss +10 -0
- data/app/assets/stylesheets/spotlight/_exhibits_index.scss +4 -48
- data/app/assets/stylesheets/spotlight/_header.scss +3 -1
- data/app/assets/stylesheets/spotlight/_item_text_block.scss +3 -3
- data/app/assets/stylesheets/spotlight/_multi_image_selector.scss +6 -7
- data/app/assets/stylesheets/spotlight/_nestable.scss +12 -1
- data/app/assets/stylesheets/spotlight/_pages.scss +7 -19
- data/app/assets/stylesheets/spotlight/_spotlight.scss +1 -0
- data/app/assets/stylesheets/spotlight/_translations.scss +5 -0
- data/app/controllers/concerns/spotlight/base.rb +2 -2
- data/app/controllers/concerns/spotlight/controller.rb +2 -2
- data/app/controllers/concerns/spotlight/search_helper.rb +2 -0
- data/app/controllers/spotlight/about_pages_controller.rb +1 -1
- data/app/controllers/spotlight/appearances_controller.rb +9 -9
- data/app/controllers/spotlight/browse_controller.rb +1 -1
- data/app/controllers/spotlight/catalog_controller.rb +5 -9
- data/app/controllers/spotlight/concerns/application_controller.rb +3 -3
- data/app/controllers/spotlight/contacts_controller.rb +1 -1
- data/app/controllers/spotlight/custom_fields_controller.rb +1 -1
- data/app/controllers/spotlight/custom_search_fields_controller.rb +1 -1
- data/app/controllers/spotlight/exhibits_controller.rb +4 -4
- data/app/controllers/spotlight/feature_pages_controller.rb +3 -5
- data/app/controllers/spotlight/filters_controller.rb +1 -3
- data/app/controllers/spotlight/home_pages_controller.rb +1 -1
- data/app/controllers/spotlight/metadata_configurations_controller.rb +1 -1
- data/app/controllers/spotlight/pages_controller.rb +7 -7
- data/app/controllers/spotlight/resources/upload_controller.rb +1 -1
- data/app/controllers/spotlight/resources_controller.rb +1 -1
- data/app/controllers/spotlight/roles_controller.rb +1 -1
- data/app/controllers/spotlight/search_configurations_controller.rb +3 -3
- data/app/controllers/spotlight/searches_controller.rb +12 -12
- data/app/controllers/spotlight/sites_controller.rb +5 -5
- data/app/controllers/spotlight/translations_controller.rb +1 -1
- data/app/helpers/spotlight/application_helper.rb +3 -3
- data/app/helpers/spotlight/main_app_helpers.rb +6 -6
- data/app/helpers/spotlight/masthead_helper.rb +19 -0
- data/app/helpers/spotlight/search_configurations_helper.rb +9 -7
- data/app/helpers/spotlight/searches_helper.rb +1 -1
- data/app/jobs/spotlight/add_uploads_from_csv.rb +0 -1
- data/app/jobs/spotlight/reindex_job.rb +4 -4
- data/app/models/concerns/spotlight/access_controls_enforcement_search_builder.rb +1 -1
- data/app/models/concerns/spotlight/exhibit_analytics.rb +2 -2
- data/app/models/concerns/spotlight/solr_document.rb +5 -1
- data/app/models/concerns/spotlight/solr_document/uploaded_resource.rb +2 -2
- data/app/models/spotlight/ability.rb +2 -2
- data/app/models/spotlight/about_page.rb +1 -1
- data/app/models/spotlight/analytics/ga.rb +1 -1
- data/app/models/spotlight/blacklight_configuration.rb +20 -18
- data/app/models/spotlight/contact.rb +1 -1
- data/app/models/spotlight/custom_field.rb +7 -7
- data/app/models/spotlight/exhibit.rb +11 -2
- data/app/models/spotlight/feature_page.rb +1 -1
- data/app/models/spotlight/featured_image.rb +1 -4
- data/app/models/spotlight/home_page.rb +1 -1
- data/app/models/spotlight/page.rb +2 -2
- data/app/models/spotlight/reindexing_log_entry.rb +3 -3
- data/app/models/spotlight/resource.rb +3 -5
- data/app/models/spotlight/resources/iiif_manifest.rb +1 -1
- data/app/models/spotlight/resources/upload.rb +0 -1
- data/app/models/spotlight/role.rb +1 -1
- data/app/models/spotlight/search.rb +3 -3
- data/app/serializers/spotlight/exhibit_export_serializer.rb +10 -10
- data/app/serializers/spotlight/featured_image_representer.rb +1 -1
- data/app/serializers/spotlight/main_navigation_representer.rb +1 -1
- data/app/serializers/spotlight/page_representer.rb +1 -1
- data/app/uploaders/spotlight/attachment_uploader.rb +0 -1
- data/app/views/catalog/_image_default.html.erb +3 -3
- data/app/views/catalog/_save_search.html.erb +2 -2
- data/app/views/layouts/spotlight/spotlight.html.erb +2 -2
- data/app/views/shared/_breadcrumbs.html.erb +1 -1
- data/app/views/shared/_exhibit_navbar.html.erb +3 -3
- data/app/views/shared/_header_navbar.html.erb +1 -1
- data/app/views/shared/_masthead.html.erb +12 -15
- data/app/views/spotlight/about_pages/_contact.html.erb +12 -12
- data/app/views/spotlight/about_pages/_contact_properties.html.erb +16 -12
- data/app/views/spotlight/about_pages/_contacts.html.erb +1 -1
- data/app/views/spotlight/about_pages/_contacts_form.html.erb +2 -2
- data/app/views/spotlight/about_pages/_sidebar.html.erb +1 -1
- data/app/views/spotlight/appearances/edit.html.erb +27 -31
- data/app/views/spotlight/browse/_search.html.erb +1 -1
- data/app/views/spotlight/browse/_search_box.html.erb +2 -2
- data/app/views/spotlight/browse/_sort_and_per_page.html.erb +1 -1
- data/app/views/spotlight/browse/index.html.erb +3 -2
- data/app/views/spotlight/catalog/_admin_thumbnail_default.html.erb +1 -1
- data/app/views/spotlight/catalog/_document_admin_table.html.erb +1 -1
- data/app/views/spotlight/contacts/_form.html.erb +2 -2
- data/app/views/spotlight/custom_fields/form_group/_text.html.erb +15 -6
- data/app/views/spotlight/custom_fields/form_group/_vocab.html.erb +15 -6
- data/app/views/spotlight/custom_search_fields/edit.html.erb +5 -5
- data/app/views/spotlight/custom_search_fields/new.html.erb +5 -5
- data/app/views/spotlight/dashboards/_analytics.html.erb +1 -1
- data/app/views/spotlight/dashboards/_page_activity.html.erb +1 -1
- data/app/views/spotlight/dashboards/_reindexing_activity.html.erb +1 -1
- data/app/views/spotlight/dashboards/_solr_document_activity.html.erb +1 -1
- data/app/views/spotlight/exhibits/_contact.html.erb +1 -1
- data/app/views/spotlight/exhibits/_delete.html.erb +2 -2
- data/app/views/spotlight/exhibits/_exhibit_card.html.erb +2 -2
- data/app/views/spotlight/exhibits/_exhibit_card_back.html.erb +21 -19
- data/app/views/spotlight/exhibits/_exhibit_card_front.html.erb +5 -3
- data/app/views/spotlight/exhibits/_exhibits.html.erb +3 -5
- data/app/views/spotlight/exhibits/_form.html.erb +3 -3
- data/app/views/spotlight/exhibits/_languages.html.erb +6 -4
- data/app/views/spotlight/feature_pages/_header.html.erb +5 -5
- data/app/views/spotlight/feature_pages/_sidebar.html.erb +1 -1
- data/app/views/spotlight/featured_images/_form.html.erb +2 -2
- data/app/views/spotlight/featured_images/_upload_form.html.erb +2 -2
- data/app/views/spotlight/home_pages/_edit_page_link.html.erb +1 -1
- data/app/views/spotlight/metadata_configurations/edit.html.erb +2 -2
- data/app/views/spotlight/pages/_order_pages.html.erb +1 -1
- data/app/views/spotlight/pages/_page.html.erb +23 -23
- data/app/views/spotlight/pages/_view_type_group.html.erb +1 -1
- data/app/views/spotlight/resources/_external_resources_form.html.erb +10 -2
- data/app/views/spotlight/resources/new.html.erb +2 -2
- data/app/views/spotlight/resources/upload/_form.html.erb +1 -1
- data/app/views/spotlight/roles/index.html.erb +2 -6
- data/app/views/spotlight/search_configurations/_default_per_page.html.erb +1 -1
- data/app/views/spotlight/search_configurations/_document_index_view_types.html.erb +1 -1
- data/app/views/spotlight/search_configurations/_facets.html.erb +22 -22
- data/app/views/spotlight/search_configurations/_search_fields.html.erb +11 -15
- data/app/views/spotlight/search_configurations/_sort.html.erb +19 -19
- data/app/views/spotlight/searches/_form.html.erb +3 -3
- data/app/views/spotlight/searches/_search.html.erb +24 -24
- data/app/views/spotlight/searches/index.html.erb +1 -1
- data/app/views/spotlight/shared/_configuration_sidebar.html.erb +2 -1
- data/app/views/spotlight/shared/_curation_sidebar.html.erb +1 -1
- data/app/views/spotlight/shared/_exhibit_sidebar.html.erb +1 -0
- data/app/views/spotlight/sir_trevor/blocks/_oembed_block.html.erb +3 -3
- data/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb +1 -2
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +6 -6
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +3 -3
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb +15 -7
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +3 -3
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +7 -6
- data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +4 -4
- data/config/locales/spotlight.en.yml +13 -5
- data/config/locales/spotlight.es.yml +40 -0
- data/config/locales/spotlight.pt-BR.yml +25 -0
- data/config/routes.rb +14 -14
- data/lib/generators/spotlight/install_generator.rb +1 -1
- data/lib/generators/spotlight/scaffold_resource_generator.rb +1 -1
- data/lib/generators/spotlight/templates/config/initializers/translation.rb +5 -5
- data/lib/spotlight/engine.rb +12 -11
- data/lib/spotlight/version.rb +1 -1
- data/lib/tasks/spotlight_tasks.rake +2 -2
- data/spec/controllers/application_controller_spec.rb +1 -0
- data/spec/controllers/spotlight/about_pages_controller_spec.rb +10 -0
- data/spec/controllers/spotlight/admin_users_controller_spec.rb +4 -0
- data/spec/controllers/spotlight/appearances_controller_spec.rb +2 -0
- data/spec/controllers/spotlight/application_controller_spec.rb +1 -0
- data/spec/controllers/spotlight/attachments_controller_spec.rb +2 -0
- data/spec/controllers/spotlight/browse_controller_spec.rb +5 -4
- data/spec/controllers/spotlight/catalog_controller_spec.rb +18 -4
- data/spec/controllers/spotlight/confirmations_controller_spec.rb +1 -0
- data/spec/controllers/spotlight/contact_forms_controller_spec.rb +2 -0
- data/spec/controllers/spotlight/contacts_controller_spec.rb +3 -0
- data/spec/controllers/spotlight/custom_fields_controller_spec.rb +2 -0
- data/spec/controllers/spotlight/custom_search_fields_controller_spec.rb +2 -0
- data/spec/controllers/spotlight/dashboards_controller_spec.rb +1 -0
- data/spec/controllers/spotlight/exhibits_controller_spec.rb +4 -2
- data/spec/controllers/spotlight/feature_pages_controller_spec.rb +13 -1
- data/spec/controllers/spotlight/featured_images_controller_spec.rb +1 -0
- data/spec/controllers/spotlight/home_pages_controller_spec.rb +5 -2
- data/spec/controllers/spotlight/metadata_configurations_controller_spec.rb +2 -1
- data/spec/controllers/spotlight/pages_controller_spec.rb +2 -0
- data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +4 -0
- data/spec/controllers/spotlight/resources/upload_controller_spec.rb +1 -0
- data/spec/controllers/spotlight/resources_controller_spec.rb +2 -0
- data/spec/controllers/spotlight/roles_controller_spec.rb +1 -0
- data/spec/controllers/spotlight/search_configurations_controller_spec.rb +2 -1
- data/spec/controllers/spotlight/searches_controller_spec.rb +4 -0
- data/spec/controllers/spotlight/sites_controller_spec.rb +1 -0
- data/spec/controllers/spotlight/tags_controller_spec.rb +1 -0
- data/spec/controllers/spotlight/translations_controller_spec.rb +2 -0
- data/spec/controllers/spotlight/versions_controller_spec.rb +2 -0
- data/spec/controllers/spotlight/view_configurations_controller_spec.rb +2 -1
- data/spec/examples.txt +1382 -50
- data/spec/factories/contact_emails.rb +1 -1
- data/spec/factories/contact_images.rb +1 -1
- data/spec/factories/contacts.rb +1 -1
- data/spec/factories/custom_fields.rb +1 -1
- data/spec/factories/custom_search_fields.rb +1 -1
- data/spec/factories/exhibit_thumbnails.rb +1 -1
- data/spec/factories/exhibits.rb +1 -1
- data/spec/factories/featured_images.rb +2 -2
- data/spec/factories/language.rb +1 -1
- data/spec/factories/main_navigation.rb +1 -1
- data/spec/factories/reindexing_log_entries.rb +6 -6
- data/spec/factories/resources.rb +2 -2
- data/spec/factories/roles.rb +1 -1
- data/spec/factories/searches.rb +2 -2
- data/spec/factories/tags.rb +2 -2
- data/spec/features/about_page_spec.rb +1 -0
- data/spec/features/add_contacts_spec.rb +2 -1
- data/spec/features/add_custom_field_metadata_spec.rb +3 -0
- data/spec/features/add_iiif_manifest_spec.rb +1 -0
- data/spec/features/add_items_spec.rb +1 -0
- data/spec/features/browse_category_admin_spec.rb +3 -1
- data/spec/features/browse_category_spec.rb +4 -1
- data/spec/features/catalog_spec.rb +1 -0
- data/spec/features/create_exhibit_spec.rb +1 -0
- data/spec/features/create_page_spec.rb +1 -0
- data/spec/features/edit_contact_spec.rb +1 -0
- data/spec/features/edit_search_fields_spec.rb +4 -3
- data/spec/features/exhibit_masthead_spec.rb +4 -4
- data/spec/features/exhibits/administration_spec.rb +11 -2
- data/spec/features/exhibits/edit_metadata_fields_spec.rb +3 -2
- data/spec/features/exhibits/language_create_edit_spec.rb +1 -0
- data/spec/features/exhibits/translation_editing_spec.rb +5 -3
- data/spec/features/exhibits_index_spec.rb +2 -2
- data/spec/features/feature_page_spec.rb +6 -2
- data/spec/features/home_page_spec.rb +3 -1
- data/spec/features/import_exhibit_spec.rb +1 -0
- data/spec/features/item_admin_spec.rb +4 -2
- data/spec/features/javascript/about_page_admin_spec.rb +2 -1
- data/spec/features/javascript/block_controls_spec.rb +3 -2
- data/spec/features/javascript/blocks/rule_block_spec.rb +1 -0
- data/spec/features/javascript/blocks/solr_documents_block_spec.rb +11 -11
- data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +5 -7
- data/spec/features/javascript/edit_in_place_spec.rb +2 -1
- data/spec/features/javascript/feature_page_admin_spec.rb +1 -1
- data/spec/features/javascript/home_page_edit_spec.rb +1 -1
- data/spec/features/javascript/metadata_admin_spec.rb +3 -1
- data/spec/features/javascript/multi_image_select_spec.rb +3 -2
- data/spec/features/javascript/reindex_monitor_spec.rb +1 -1
- data/spec/features/javascript/roles_admin_spec.rb +1 -0
- data/spec/features/javascript/search_config_admin_spec.rb +3 -1
- data/spec/features/javascript/search_context_spec.rb +5 -4
- data/spec/features/main_navigation_spec.rb +46 -2
- data/spec/features/metadata_admin_spec.rb +1 -0
- data/spec/features/report_a_problem_spec.rb +1 -1
- data/spec/features/site_masthead_spec.rb +3 -3
- data/spec/features/slideshow_spec.rb +1 -1
- data/spec/helpers/spotlight/application_helper_spec.rb +10 -5
- data/spec/helpers/spotlight/crud_link_helpers_spec.rb +3 -0
- data/spec/helpers/spotlight/languages_helper_spec.rb +2 -0
- data/spec/helpers/spotlight/main_app_helpers_spec.rb +10 -6
- data/spec/helpers/spotlight/masthead_helper_spec.rb +51 -0
- data/spec/helpers/spotlight/meta_helper_spec.rb +1 -0
- data/spec/helpers/spotlight/navbar_helper_spec.rb +5 -3
- data/spec/helpers/spotlight/pages_helper_spec.rb +10 -3
- data/spec/helpers/spotlight/title_helper_spec.rb +1 -0
- data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +1 -0
- data/spec/jobs/spotlight/default_thumbnail_job_spec.rb +2 -1
- data/spec/lib/migration/iiif_spec.rb +1 -1
- data/spec/lib/migration/page_language_spec.rb +1 -0
- data/spec/lib/spotlight/controller_spec.rb +4 -4
- data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +2 -1
- data/spec/models/sir_trevor_rails/blocks/browse_block_spec.rb +2 -1
- data/spec/models/sir_trevor_rails/blocks/featured_pages_block_spec.rb +2 -1
- data/spec/models/sir_trevor_rails/blocks/search_results_block_spec.rb +2 -1
- data/spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb +2 -1
- data/spec/models/sir_trevor_rails/blocks/textable_spec.rb +5 -2
- data/spec/models/solr_document_spec.rb +19 -10
- data/spec/models/spotlight/ability_spec.rb +3 -1
- data/spec/models/spotlight/about_page_spec.rb +6 -3
- data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +2 -1
- data/spec/models/spotlight/analytics/ga_spec.rb +1 -1
- data/spec/models/spotlight/blacklight_configuration_spec.rb +36 -31
- data/spec/models/spotlight/contact_email_spec.rb +4 -3
- data/spec/models/spotlight/contact_form_spec.rb +3 -2
- data/spec/models/spotlight/contact_spec.rb +4 -3
- data/spec/models/spotlight/custom_field_spec.rb +17 -8
- data/spec/models/spotlight/custom_search_field_spec.rb +2 -0
- data/spec/models/spotlight/custom_translation_extension_spec.rb +2 -1
- data/spec/models/spotlight/exhibit_spec.rb +34 -3
- data/spec/models/spotlight/feature_page_spec.rb +21 -9
- data/spec/models/spotlight/field_metadata_spec.rb +4 -4
- data/spec/models/spotlight/home_page_spec.rb +8 -4
- data/spec/models/spotlight/language_spec.rb +1 -0
- data/spec/models/spotlight/masthead_spec.rb +2 -1
- data/spec/models/spotlight/page_configurations_spec.rb +2 -1
- data/spec/models/spotlight/page_spec.rb +14 -8
- data/spec/models/spotlight/reindexing_log_entry_spec.rb +4 -4
- data/spec/models/spotlight/resources/iiif_harvester_spec.rb +5 -3
- data/spec/models/spotlight/resources/iiif_manifest_spec.rb +6 -2
- data/spec/models/spotlight/resources/iiif_service_spec.rb +4 -1
- data/spec/models/spotlight/resources/open_graph_spec.rb +3 -2
- data/spec/models/spotlight/resources/upload_spec.rb +7 -2
- data/spec/models/spotlight/role_spec.rb +5 -0
- data/spec/models/spotlight/search_spec.rb +4 -1
- data/spec/models/spotlight/sitemap_spec.rb +2 -2
- data/spec/models/spotlight/solr_document/atomic_updates_spec.rb +2 -1
- data/spec/models/spotlight/solr_document/uploaded_resource_spec.rb +3 -1
- data/spec/models/spotlight/solr_document_sidecar_spec.rb +8 -7
- data/spec/models/spotlight/user_spec.rb +1 -0
- data/spec/models/translation_spec.rb +3 -2
- data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +24 -23
- data/spec/services/spotlight/clone_translated_page_from_locale_spec.rb +2 -1
- data/spec/services/spotlight/iiif_resource_resolver_spec.rb +3 -2
- data/spec/services/spotlight/solr_document_builder_spec.rb +2 -1
- data/spec/spec_helper.rb +4 -4
- data/spec/support/features/test_features_helpers.rb +1 -1
- data/spec/test_app_templates/Gemfile.extra +1 -1
- data/spec/test_app_templates/catalog_controller.rb +1 -1
- data/spec/test_app_templates/spotlight_test.rake +1 -1
- data/spec/uploaders/spotlight/attachment_uploader_spec.rb +2 -1
- data/spec/uploaders/spotlight/featured_image_uploader_spec.rb +2 -1
- data/spec/views/shared/_analytics.html.erb_spec.rb +1 -0
- data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +5 -5
- data/spec/views/shared/_masthead.html.erb_spec.rb +4 -1
- data/spec/views/shared/_user_util_links.html.erb_spec.rb +9 -2
- data/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb +4 -1
- data/spec/views/spotlight/about_pages/index.html.erb_spec.rb +2 -0
- data/spec/views/spotlight/browse/_search.html.erb_spec.rb +1 -0
- data/spec/views/spotlight/browse/index.html.erb_spec.rb +3 -1
- data/spec/views/spotlight/browse/show.html.erb_spec.rb +2 -2
- data/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb +6 -5
- data/spec/views/spotlight/catalog/admin.html.erb_spec.rb +1 -0
- data/spec/views/spotlight/contacts/edit.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb +1 -0
- data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/exhibits/_form.html.erb_spec.rb +1 -0
- data/spec/views/spotlight/exhibits/edit.html.erb_spec.rb +2 -1
- data/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb +2 -1
- data/spec/views/spotlight/featured_images/_form.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/featured_images/_upload_form.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb +2 -1
- data/spec/views/spotlight/metadata_configurations/edit.html.erb_spec.rb +1 -0
- data/spec/views/spotlight/pages/_form.html.erb_spec.rb +1 -0
- data/spec/views/spotlight/pages/edit.html.erb_spec.rb +1 -0
- data/spec/views/spotlight/pages/index.html.erb_spec.rb +1 -0
- data/spec/views/spotlight/pages/new.html.erb_spec.rb +1 -0
- data/spec/views/spotlight/pages/show.html.erb_spec.rb +4 -3
- data/spec/views/spotlight/resources/_external_resources_form.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/resources/new.html.erb_spec.rb +2 -2
- data/spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb +2 -2
- data/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb +2 -1
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb +17 -3
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb +8 -1
- data/spec/views/spotlight/tags/index.html.erb_spec.rb +1 -0
- data/spec/views/spotlight/translations/_page.html.erb_spec.rb +1 -0
- metadata +158 -152
@@ -50,7 +50,7 @@ module Spotlight
|
|
50
50
|
def contact_params
|
51
51
|
params.require(:contact).permit(:name,
|
52
52
|
contact_info: Spotlight::Contact.fields.keys,
|
53
|
-
avatar_attributes: [
|
53
|
+
avatar_attributes: %i[iiif_tilesource iiif_region])
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
@@ -8,7 +8,7 @@ module Spotlight
|
|
8
8
|
|
9
9
|
load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
|
10
10
|
load_and_authorize_resource through: :exhibit
|
11
|
-
before_action :attach_breadcrumbs, only: [
|
11
|
+
before_action :attach_breadcrumbs, only: %i[new edit]
|
12
12
|
|
13
13
|
def new
|
14
14
|
@custom_field.field_type ||= 'text'
|
@@ -7,7 +7,7 @@ module Spotlight
|
|
7
7
|
|
8
8
|
load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
|
9
9
|
load_and_authorize_resource through: :exhibit
|
10
|
-
before_action :attach_breadcrumbs, only: [
|
10
|
+
before_action :attach_breadcrumbs, only: %i[new edit]
|
11
11
|
|
12
12
|
# GET /custom_search_fields/new
|
13
13
|
def new
|
@@ -6,7 +6,7 @@ module Spotlight
|
|
6
6
|
class ExhibitsController < Spotlight::ApplicationController
|
7
7
|
include Spotlight::SearchHelper
|
8
8
|
before_action :authenticate_user!, except: [:index]
|
9
|
-
before_action :set_tab, only: [
|
9
|
+
before_action :set_tab, only: %i[edit update]
|
10
10
|
|
11
11
|
load_and_authorize_resource
|
12
12
|
|
@@ -83,7 +83,7 @@ module Spotlight
|
|
83
83
|
protected
|
84
84
|
|
85
85
|
def current_exhibit
|
86
|
-
@exhibit if @exhibit
|
86
|
+
@exhibit if @exhibit&.persisted?
|
87
87
|
end
|
88
88
|
|
89
89
|
def exhibit_params
|
@@ -93,8 +93,8 @@ module Spotlight
|
|
93
93
|
:description,
|
94
94
|
:published,
|
95
95
|
:tag_list,
|
96
|
-
contact_emails_attributes: [
|
97
|
-
languages_attributes: [
|
96
|
+
contact_emails_attributes: %i[id email],
|
97
|
+
languages_attributes: %i[id public]
|
98
98
|
)
|
99
99
|
end
|
100
100
|
|
@@ -26,9 +26,7 @@ module Spotlight
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def attach_page_breadcrumbs
|
29
|
-
if action_name == 'edit'
|
30
|
-
add_breadcrumb t(:'spotlight.curation.sidebar.feature_pages'), exhibit_feature_pages_path(@exhibit)
|
31
|
-
end
|
29
|
+
add_breadcrumb t(:'spotlight.curation.sidebar.feature_pages'), exhibit_feature_pages_path(@exhibit) if action_name == 'edit'
|
32
30
|
|
33
31
|
add_breadcrumb @page.parent_page.title, [spotlight, @page.exhibit, @page.parent_page] unless @page.top_level_page?
|
34
32
|
add_breadcrumb @page.title, action_name == 'edit' ? [:edit, @page.exhibit, @page] : [spotlight, @page.exhibit, @page]
|
@@ -42,12 +40,12 @@ module Spotlight
|
|
42
40
|
def update_all_page_params
|
43
41
|
params.require(:exhibit).permit(
|
44
42
|
'feature_pages_attributes' => page_attributes,
|
45
|
-
'home_page_attributes' => [
|
43
|
+
'home_page_attributes' => %i[id title display_title]
|
46
44
|
)
|
47
45
|
end
|
48
46
|
|
49
47
|
def allowed_page_params
|
50
|
-
super.concat [
|
48
|
+
super.concat %i[display_sidebar published]
|
51
49
|
end
|
52
50
|
end
|
53
51
|
end
|
@@ -17,9 +17,7 @@ module Spotlight
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def update
|
20
|
-
unless @filter.update(filter_params)
|
21
|
-
flash[:alert] = @filter.errors.full_messages.join('<br/>'.html_safe)
|
22
|
-
end
|
20
|
+
flash[:alert] = @filter.errors.full_messages.join('<br/>'.html_safe) unless @filter.update(filter_params)
|
23
21
|
redirect_to spotlight.edit_exhibit_path @exhibit, tab: 'filter'
|
24
22
|
end
|
25
23
|
|
@@ -44,7 +44,7 @@ module Spotlight
|
|
44
44
|
views = @blacklight_configuration.default_blacklight_config.view.keys | [:show]
|
45
45
|
|
46
46
|
@blacklight_configuration.blacklight_config.index_fields.keys.each_with_object({}) do |element, result|
|
47
|
-
result[element] = ([
|
47
|
+
result[element] = (%i[enabled label weight] | views)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
@@ -8,7 +8,7 @@ module Spotlight
|
|
8
8
|
# controller that gives other controllers their behavior
|
9
9
|
class PagesController < Spotlight::ApplicationController
|
10
10
|
before_action :authenticate_user!, except: [:show]
|
11
|
-
before_action :load_locale_specific_page, only: [
|
11
|
+
before_action :load_locale_specific_page, only: %i[destroy edit show update]
|
12
12
|
load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
|
13
13
|
load_and_authorize_resource through: :exhibit, instance_name: 'page', only: [:index]
|
14
14
|
|
@@ -71,7 +71,7 @@ module Spotlight
|
|
71
71
|
|
72
72
|
# PATCH/PUT /pages/1
|
73
73
|
def update
|
74
|
-
@page.lock
|
74
|
+
@page.lock&.delete
|
75
75
|
|
76
76
|
if @page.update(page_params.merge(last_edited_by: current_user))
|
77
77
|
redirect_to [spotlight, @page.exhibit, @page], flash: { html_safe: true }, notice: undo_notice(:updated)
|
@@ -146,7 +146,7 @@ module Spotlight
|
|
146
146
|
end
|
147
147
|
|
148
148
|
def page_attributes
|
149
|
-
[
|
149
|
+
%i[id published title weight display_sidebar parent_page_id]
|
150
150
|
end
|
151
151
|
|
152
152
|
def allowed_page_params
|
@@ -154,9 +154,9 @@ module Spotlight
|
|
154
154
|
end
|
155
155
|
|
156
156
|
def featured_image_attributes
|
157
|
-
[
|
158
|
-
|
159
|
-
|
157
|
+
%i[
|
158
|
+
source image document_global_id iiif_region iiif_tilesource
|
159
|
+
iiif_manifest_url iiif_canvas_id iiif_image_id
|
160
160
|
]
|
161
161
|
end
|
162
162
|
|
@@ -188,7 +188,7 @@ module Spotlight
|
|
188
188
|
|
189
189
|
def update_all_page_params
|
190
190
|
params.require(:exhibit).permit(
|
191
|
-
pages_attributes: [
|
191
|
+
pages_attributes: %i[id published]
|
192
192
|
)
|
193
193
|
end
|
194
194
|
|
@@ -9,7 +9,7 @@ module Spotlight
|
|
9
9
|
helper :all
|
10
10
|
|
11
11
|
before_action :authenticate_user!
|
12
|
-
before_action :set_tab, only: [
|
12
|
+
before_action :set_tab, only: %i[new create]
|
13
13
|
|
14
14
|
load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
|
15
15
|
before_action :build_resource
|
@@ -5,7 +5,7 @@ module Spotlight
|
|
5
5
|
# CRUD actions for exhibit resources
|
6
6
|
class ResourcesController < Spotlight::ApplicationController
|
7
7
|
before_action :authenticate_user!, except: [:show]
|
8
|
-
before_action :set_tab, only: [
|
8
|
+
before_action :set_tab, only: %i[new create]
|
9
9
|
|
10
10
|
load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
|
11
11
|
|
@@ -49,19 +49,19 @@ module Spotlight
|
|
49
49
|
|
50
50
|
def exhibit_configuration_facet_params
|
51
51
|
@blacklight_configuration.blacklight_config.facet_fields.keys.each_with_object({}) do |element, result|
|
52
|
-
result[element] = [
|
52
|
+
result[element] = %i[show label weight sort]
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
56
|
def exhibit_configuration_search_params
|
57
57
|
@blacklight_configuration.blacklight_config.search_fields.keys.each_with_object({}) do |element, result|
|
58
|
-
result[element] = [
|
58
|
+
result[element] = %i[enabled label weight]
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
62
|
def exhibit_configuration_sort_params
|
63
63
|
@blacklight_configuration.blacklight_config.sort_fields.keys.each_with_object({}) do |element, result|
|
64
|
-
result[element] = [
|
64
|
+
result[element] = %i[enabled label weight]
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
@@ -10,7 +10,7 @@ module Spotlight
|
|
10
10
|
before_action :only_curators!
|
11
11
|
before_action :create_or_load_resource, only: [:create]
|
12
12
|
load_and_authorize_resource through: :exhibit
|
13
|
-
before_action :attach_breadcrumbs, only: [
|
13
|
+
before_action :attach_breadcrumbs, only: %i[index edit], unless: -> { request.format.json? }
|
14
14
|
|
15
15
|
include Spotlight::Base
|
16
16
|
include Spotlight::SearchHelper
|
@@ -31,7 +31,7 @@ module Spotlight
|
|
31
31
|
respond_to do |format|
|
32
32
|
format.html
|
33
33
|
format.json do
|
34
|
-
render json: @searches.as_json(methods: [
|
34
|
+
render json: @searches.as_json(methods: %i[count thumbnail_image_url]), root: false
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -92,14 +92,14 @@ module Spotlight
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def attach_breadcrumbs
|
95
|
-
e = @exhibit ||
|
95
|
+
e = @exhibit || @search&.exhibit
|
96
96
|
add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: e.title), e
|
97
97
|
add_breadcrumb t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(e)
|
98
98
|
add_breadcrumb t(:'spotlight.curation.sidebar.browse'), exhibit_searches_path(e)
|
99
99
|
end
|
100
100
|
|
101
101
|
def batch_search_params
|
102
|
-
params.require(:exhibit).permit('searches_attributes' => [
|
102
|
+
params.require(:exhibit).permit('searches_attributes' => %i[id published weight])
|
103
103
|
end
|
104
104
|
|
105
105
|
def search_params
|
@@ -118,13 +118,13 @@ module Spotlight
|
|
118
118
|
end
|
119
119
|
|
120
120
|
def featured_image_params
|
121
|
-
[
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
121
|
+
%i[
|
122
|
+
iiif_region iiif_tilesource
|
123
|
+
iiif_manifest_url iiif_canvas_id iiif_image_id
|
124
|
+
display
|
125
|
+
source
|
126
|
+
image
|
127
|
+
document_global_id
|
128
128
|
]
|
129
129
|
end
|
130
130
|
|
@@ -133,7 +133,7 @@ module Spotlight
|
|
133
133
|
end
|
134
134
|
|
135
135
|
def blacklisted_search_session_params
|
136
|
-
[
|
136
|
+
%i[id commit counter total search_id page per_page authenticity_token utf8 action controller]
|
137
137
|
end
|
138
138
|
|
139
139
|
def fallback_url
|
@@ -40,15 +40,15 @@ module Spotlight
|
|
40
40
|
:title,
|
41
41
|
:subtitle,
|
42
42
|
masthead_attributes: masthead_params,
|
43
|
-
exhibits_attributes: [
|
43
|
+
exhibits_attributes: %i[id weight]
|
44
44
|
)
|
45
45
|
end
|
46
46
|
|
47
47
|
def masthead_params
|
48
|
-
[
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
%i[
|
49
|
+
display
|
50
|
+
iiif_region
|
51
|
+
iiif_tilesource
|
52
52
|
]
|
53
53
|
end
|
54
54
|
end
|
@@ -132,7 +132,7 @@ module Spotlight
|
|
132
132
|
|
133
133
|
def uploaded_field_label(config)
|
134
134
|
solr_field = Array(config.solr_field || config.field_name).first.to_s
|
135
|
-
|
135
|
+
blacklight_config.index_fields[solr_field].try(:label) || config.label || t(".#{solr_field}")
|
136
136
|
end
|
137
137
|
|
138
138
|
def available_view_fields
|
@@ -143,13 +143,13 @@ module Spotlight
|
|
143
143
|
if current_exhibit_theme && current_exhibit.theme != 'default'
|
144
144
|
stylesheet_link_tag "#{tag}_#{current_exhibit_theme}"
|
145
145
|
else
|
146
|
-
Rails.logger.warn "Exhibit theme '#{current_exhibit_theme}' not in white-list of available themes: #{
|
146
|
+
Rails.logger.warn "Exhibit theme '#{current_exhibit_theme}' not in white-list of available themes: #{current_exhibit.themes}"
|
147
147
|
stylesheet_link_tag(tag)
|
148
148
|
end
|
149
149
|
end
|
150
150
|
|
151
151
|
def current_exhibit_theme
|
152
|
-
current_exhibit.theme if current_exhibit && current_exhibit.theme.present? &&
|
152
|
+
current_exhibit.theme if current_exhibit && current_exhibit.theme.present? && current_exhibit.themes.include?(current_exhibit.theme)
|
153
153
|
end
|
154
154
|
|
155
155
|
private
|
@@ -5,6 +5,8 @@ module Spotlight
|
|
5
5
|
# Helpers that are injected into the main application (because they used in layouts)
|
6
6
|
module MainAppHelpers
|
7
7
|
include Spotlight::NavbarHelper
|
8
|
+
include Spotlight::MastheadHelper
|
9
|
+
|
8
10
|
def cache_key_for_spotlight_exhibits
|
9
11
|
"#{Spotlight::Exhibit.count}/#{Spotlight::Exhibit.maximum(:updated_at).try(:utc)}"
|
10
12
|
end
|
@@ -22,9 +24,7 @@ module Spotlight
|
|
22
24
|
end
|
23
25
|
|
24
26
|
def link_back_to_catalog(opts = { label: nil })
|
25
|
-
if (current_search_session.try(:query_params) || {}).fetch(:controller, '').starts_with? 'spotlight'
|
26
|
-
opts[:route_set] ||= spotlight
|
27
|
-
end
|
27
|
+
opts[:route_set] ||= spotlight if (current_search_session.try(:query_params) || {}).fetch(:controller, '').starts_with? 'spotlight'
|
28
28
|
super
|
29
29
|
end
|
30
30
|
|
@@ -38,16 +38,16 @@ module Spotlight
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def exhibit_stylesheet_link_tag(tag)
|
41
|
-
if current_exhibit_theme && current_exhibit
|
41
|
+
if current_exhibit_theme && current_exhibit&.theme != 'default'
|
42
42
|
stylesheet_link_tag "#{tag}_#{current_exhibit_theme}"
|
43
43
|
else
|
44
|
-
Rails.logger.warn "Exhibit theme '#{current_exhibit_theme}' not in white-list of available themes: #{
|
44
|
+
Rails.logger.warn "Exhibit theme '#{current_exhibit_theme}' not in white-list of available themes: #{current_exhibit&.themes}"
|
45
45
|
stylesheet_link_tag(tag)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
49
|
def current_exhibit_theme
|
50
|
-
current_exhibit.theme if current_exhibit && current_exhibit.theme.present? &&
|
50
|
+
current_exhibit.theme if current_exhibit && current_exhibit.theme.present? && current_exhibit.themes.include?(current_exhibit.theme)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Spotlight
|
4
|
+
##
|
5
|
+
# Helper module for content in mastheads
|
6
|
+
module MastheadHelper
|
7
|
+
def masthead_heading_content
|
8
|
+
return current_exhibit.title if current_exhibit
|
9
|
+
|
10
|
+
application_name
|
11
|
+
end
|
12
|
+
|
13
|
+
def masthead_subheading_content
|
14
|
+
return current_exhibit&.subtitle&.presence if current_exhibit
|
15
|
+
|
16
|
+
current_site&.subtitle&.presence
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -10,13 +10,15 @@ module Spotlight
|
|
10
10
|
def translate_sort_fields(sort_config)
|
11
11
|
sort_description = sort_config[:sort_description] if sort_config[:sort_description]
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
if sort_config[:sort]
|
14
|
+
sort_description ||= sort_config[:sort].split(',').map do |sort|
|
15
|
+
sort_field, sort_order = sort.split(' ')
|
16
|
+
safe_join([
|
17
|
+
t(:"spotlight.search_configurations.sort.keys.#{sort_field.strip}", default: sort_field.humanize.downcase),
|
18
|
+
t(:"spotlight.search_configurations.sort.keys.#{sort_order.strip}", default: '')
|
19
|
+
], ' ')
|
20
|
+
end.to_sentence
|
21
|
+
end
|
20
22
|
|
21
23
|
sort_description
|
22
24
|
end
|
@@ -23,16 +23,16 @@ module Spotlight
|
|
23
23
|
|
24
24
|
around_perform do |job, block|
|
25
25
|
job_log_entry = log_entry(job)
|
26
|
-
job_log_entry
|
26
|
+
job_log_entry&.in_progress!
|
27
27
|
|
28
28
|
begin
|
29
29
|
block.call
|
30
|
-
rescue
|
31
|
-
job_log_entry
|
30
|
+
rescue StandardError
|
31
|
+
job_log_entry&.failed!
|
32
32
|
raise
|
33
33
|
end
|
34
34
|
|
35
|
-
job_log_entry
|
35
|
+
job_log_entry&.succeeded!
|
36
36
|
end
|
37
37
|
|
38
38
|
def self.perform_later(exhibit_or_resources, log_entry = nil)
|