blacklight 7.33.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.env +3 -2
- data/.github/workflows/ruby.yml +38 -107
- data/.gitignore +1 -0
- data/.rubocop.yml +243 -2
- data/.rubocop_todo.yml +216 -270
- data/Gemfile +7 -6
- data/README.md +12 -4
- data/Rakefile +18 -0
- data/VERSION +1 -1
- data/app/assets/config/blacklight/manifest.js +3 -0
- data/app/assets/javascripts/blacklight/blacklight.esm.js +376 -0
- data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -0
- data/app/assets/javascripts/blacklight/blacklight.js +332 -485
- data/app/assets/javascripts/blacklight/blacklight.js.map +1 -0
- data/app/assets/stylesheets/blacklight/_autocomplete.scss +25 -0
- data/app/assets/stylesheets/blacklight/_blacklight_base.scss +1 -1
- data/app/assets/stylesheets/blacklight/_bookmark.scss +16 -0
- data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +8 -0
- data/app/assets/stylesheets/blacklight/_facets.scss +104 -49
- data/app/assets/stylesheets/blacklight/_header.scss +0 -15
- data/app/assets/stylesheets/blacklight/_icons.scss +0 -14
- data/app/assets/stylesheets/blacklight/_mixins.scss +20 -0
- data/app/assets/stylesheets/blacklight/_modal.scss +8 -2
- data/app/assets/stylesheets/blacklight/_search_form.scss +30 -3
- data/app/assets/stylesheets/blacklight/_search_history.scss +10 -1
- data/app/assets/stylesheets/blacklight/_search_results.scss +6 -2
- data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +4 -1
- data/app/builders/blacklight/action_builder.rb +18 -9
- data/app/components/blacklight/advanced_search_form_component.html.erb +1 -1
- data/app/components/blacklight/advanced_search_form_component.rb +7 -9
- data/app/components/blacklight/constraints_component.rb +27 -37
- data/app/components/blacklight/document/action_component.html.erb +2 -9
- data/app/components/blacklight/document/action_component.rb +26 -8
- data/app/components/blacklight/document/actions_component.rb +2 -2
- data/app/components/blacklight/document/bookmark_component.html.erb +9 -0
- data/app/components/blacklight/document/bookmark_component.rb +4 -2
- data/app/components/blacklight/document/citation_component.rb +5 -3
- data/app/components/blacklight/document/group_component.rb +7 -3
- data/app/components/blacklight/document/show_tools_component.html.erb +12 -0
- data/app/components/blacklight/document/show_tools_component.rb +23 -0
- data/app/components/blacklight/document/sidebar_component.html.erb +2 -0
- data/app/components/blacklight/document/sidebar_component.rb +16 -0
- data/app/components/blacklight/document/thumbnail_component.html.erb +2 -7
- data/app/components/blacklight/document/thumbnail_component.rb +1 -9
- data/app/components/blacklight/document_component.html.erb +4 -0
- data/app/components/blacklight/document_component.rb +54 -42
- data/app/components/blacklight/document_metadata_component.html.erb +4 -2
- data/app/components/blacklight/document_metadata_component.rb +11 -6
- data/app/components/blacklight/document_title_component.rb +4 -1
- data/app/components/blacklight/facet_component.rb +1 -1
- data/app/components/blacklight/facet_field_checkboxes_component.html.erb +3 -3
- data/app/components/blacklight/facet_field_checkboxes_component.rb +1 -1
- data/app/components/blacklight/facet_field_component.html.erb +5 -5
- data/app/components/blacklight/facet_field_component.rb +9 -2
- data/app/components/blacklight/facet_field_list_component.html.erb +3 -3
- data/app/components/blacklight/facet_field_list_component.rb +37 -5
- data/app/components/blacklight/facet_field_no_layout_component.rb +0 -2
- data/app/components/blacklight/facet_item_component.rb +1 -43
- data/app/components/blacklight/facet_item_pivot_component.rb +21 -23
- data/app/components/blacklight/header_component.html.erb +2 -0
- data/app/components/blacklight/header_component.rb +26 -0
- data/app/components/blacklight/hidden_search_state_component.rb +1 -2
- data/app/components/blacklight/icons/legacy_icon_component.rb +30 -0
- data/app/components/blacklight/icons/list_component.rb +16 -0
- data/app/components/blacklight/icons/search_component.rb +16 -0
- data/app/components/blacklight/metadata_field_component.html.erb +2 -2
- data/app/components/blacklight/metadata_field_component.rb +24 -8
- data/app/components/blacklight/metadata_field_layout_component.rb +7 -22
- data/app/components/blacklight/metadata_field_plain_text_layout_component.rb +17 -0
- data/app/components/blacklight/response/facet_group_component.html.erb +5 -6
- data/app/components/blacklight/response/facet_group_component.rb +29 -8
- data/app/components/blacklight/response/sort_component.rb +2 -2
- data/app/components/blacklight/response/spellcheck_component.rb +18 -7
- data/app/components/blacklight/response/view_type_button_component.rb +3 -7
- data/app/components/blacklight/response/view_type_component.rb +4 -6
- data/app/components/blacklight/search/sidebar_component.html.erb +8 -0
- data/app/components/blacklight/search/sidebar_component.rb +17 -0
- data/app/components/blacklight/search_bar_component.html.erb +20 -15
- data/app/components/blacklight/search_bar_component.rb +2 -16
- data/app/components/blacklight/search_button_component.rb +3 -3
- data/app/components/blacklight/search_context/server_applied_params_component.html.erb +4 -0
- data/app/components/blacklight/search_context/server_applied_params_component.rb +13 -0
- data/app/components/blacklight/search_context/server_item_pagination_component.rb +71 -0
- data/app/components/blacklight/search_header_component.html.erb +2 -0
- data/app/components/blacklight/search_header_component.rb +6 -0
- data/app/components/blacklight/search_navbar_component.html.erb +5 -0
- data/app/components/blacklight/search_navbar_component.rb +34 -0
- data/app/components/blacklight/start_over_button_component.rb +5 -3
- data/app/components/blacklight/system/dropdown_component.rb +3 -3
- data/app/components/blacklight/system/flash_message_component.html.erb +3 -1
- data/app/components/blacklight/system/flash_message_component.rb +12 -3
- data/app/components/blacklight/system/modal_component.html.erb +1 -1
- data/app/components/blacklight/system/modal_component.rb +1 -3
- data/app/components/blacklight/top_navbar_component.html.erb +12 -0
- data/app/components/blacklight/top_navbar_component.rb +17 -0
- data/app/controllers/bookmarks_controller.rb +1 -0
- data/app/controllers/catalog_controller.rb +1 -0
- data/app/controllers/concerns/blacklight/bookmarks.rb +11 -6
- data/app/controllers/concerns/blacklight/catalog.rb +21 -72
- data/app/controllers/concerns/blacklight/controller.rb +6 -43
- data/app/controllers/concerns/blacklight/search_context.rb +71 -13
- data/app/controllers/concerns/blacklight/search_history.rb +2 -0
- data/app/controllers/concerns/blacklight/searchable.rb +12 -1
- data/app/controllers/concerns/blacklight/token_based_user.rb +1 -0
- data/app/controllers/search_history_controller.rb +1 -0
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +1 -400
- data/app/helpers/blacklight/catalog_helper_behavior.rb +40 -182
- data/app/helpers/blacklight/component_helper_behavior.rb +1 -63
- data/app/helpers/blacklight/configuration_helper_behavior.rb +2 -117
- data/app/helpers/blacklight/document_helper_behavior.rb +76 -0
- data/app/helpers/blacklight/facets_helper_behavior.rb +4 -321
- data/app/helpers/blacklight/icon_helper_behavior.rb +5 -4
- data/app/helpers/blacklight/layout_helper_behavior.rb +60 -0
- data/app/helpers/blacklight/render_partials_helper_behavior.rb +12 -30
- data/app/helpers/blacklight/url_helper_behavior.rb +21 -97
- data/app/helpers/blacklight_helper.rb +1 -0
- data/app/helpers/catalog_helper.rb +1 -0
- data/app/javascript/blacklight/bookmark_toggle.js +9 -22
- data/app/javascript/blacklight/button_focus.js +9 -7
- data/app/javascript/blacklight/checkbox_submit.js +68 -122
- data/app/javascript/blacklight/core.js +6 -5
- data/app/javascript/blacklight/index.js +14 -0
- data/app/javascript/blacklight/modal.js +100 -165
- data/app/javascript/blacklight/modalForm.js +60 -0
- data/app/javascript/blacklight/search_context.js +13 -29
- data/app/models/blacklight/facet_paginator.rb +3 -2
- data/app/models/blacklight/icon.rb +4 -2
- data/app/models/bookmark.rb +0 -2
- data/app/models/concerns/blacklight/configurable.rb +5 -4
- data/app/models/concerns/blacklight/document/active_model_shim.rb +1 -0
- data/app/models/concerns/blacklight/document/attributes.rb +50 -0
- data/app/models/concerns/blacklight/document/cache_key.rb +1 -0
- data/app/models/concerns/blacklight/document/dublin_core.rb +2 -1
- data/app/models/concerns/blacklight/document/export.rb +2 -1
- data/app/models/concerns/blacklight/document/extensions.rb +1 -0
- data/app/models/concerns/blacklight/document/schema_org.rb +1 -0
- data/app/models/concerns/blacklight/document/semantic_fields.rb +1 -0
- data/app/models/concerns/blacklight/document.rb +23 -20
- data/app/models/concerns/blacklight/suggest/response.rb +1 -0
- data/app/models/concerns/blacklight/user.rb +17 -8
- data/app/models/record_mailer.rb +23 -18
- data/app/models/search.rb +0 -1
- data/app/models/solr_document.rb +1 -0
- data/app/presenters/blacklight/clause_presenter.rb +1 -1
- data/app/presenters/blacklight/document_presenter.rb +24 -30
- data/app/presenters/blacklight/facet_field_presenter.rb +39 -14
- data/app/presenters/blacklight/facet_grouped_item_presenter.rb +1 -5
- data/app/presenters/blacklight/facet_item_pivot_presenter.rb +60 -0
- data/app/presenters/blacklight/facet_item_presenter.rb +3 -9
- data/app/presenters/blacklight/field_presenter.rb +1 -0
- data/app/presenters/blacklight/index_presenter.rb +2 -40
- data/app/presenters/blacklight/json_presenter.rb +7 -5
- data/app/presenters/blacklight/rendering/abstract_step.rb +4 -0
- data/app/presenters/blacklight/rendering/join.rb +7 -1
- data/app/presenters/blacklight/rendering/link_to_facet.rb +3 -6
- data/app/presenters/blacklight/rendering/microdata.rb +1 -1
- data/app/presenters/blacklight/show_presenter.rb +1 -9
- data/app/presenters/blacklight/thumbnail_presenter.rb +1 -1
- data/app/services/blacklight/bookmarks_search_builder.rb +22 -0
- data/app/services/blacklight/field_retriever.rb +1 -8
- data/app/services/blacklight/search_service.rb +9 -7
- data/app/values/blacklight/types.rb +95 -11
- data/app/views/bookmarks/_clear_bookmarks_widget.html.erb +8 -1
- data/app/views/bookmarks/_tools.html.erb +7 -12
- data/app/views/catalog/_advanced_search_form.html.erb +0 -1
- data/app/views/catalog/_bookmark_control.html.erb +1 -1
- data/app/views/catalog/_constraints.html.erb +1 -14
- data/app/views/catalog/_document.atom.builder +12 -14
- data/app/views/catalog/_document.html.erb +3 -6
- data/app/views/catalog/_document.rss.builder +2 -4
- data/app/views/catalog/_document_list.html.erb +2 -1
- data/app/views/catalog/_facet_layout.html.erb +2 -2
- data/app/views/catalog/_facets.html.erb +5 -4
- data/app/views/catalog/_home_text.html.erb +2 -14
- data/app/views/catalog/_search_form.html.erb +3 -3
- data/app/views/catalog/_search_header.html.erb +1 -2
- data/app/views/catalog/_search_results.html.erb +2 -2
- data/app/views/catalog/_search_sidebar.html.erb +5 -1
- data/app/views/catalog/_show_main_content.html.erb +8 -19
- data/app/views/catalog/_show_sidebar.html.erb +2 -2
- data/app/views/catalog/_show_tools.html.erb +1 -19
- data/app/views/catalog/_view_type_group.html.erb +1 -1
- data/app/views/catalog/email_success.html.erb +5 -6
- data/app/views/catalog/facet.html.erb +7 -5
- data/app/views/catalog/index.atom.builder +12 -14
- data/app/views/catalog/index.html.erb +7 -1
- data/app/views/catalog/index.json.jbuilder +19 -19
- data/app/views/catalog/index.rss.builder +1 -1
- data/app/views/catalog/opensearch.xml.builder +1 -1
- data/app/views/catalog/show.html.erb +1 -6
- data/app/views/catalog/sms_success.html.erb +5 -6
- data/app/views/catalog/suggest.html.erb +3 -0
- data/app/views/layouts/blacklight/base.html.erb +19 -9
- data/app/views/record_mailer/email_record.text.erb +4 -3
- data/app/views/record_mailer/sms_record.text.erb +4 -4
- data/app/views/search_history/index.html.erb +6 -2
- data/app/views/shared/_header_navbar.html.erb +1 -22
- data/app/views/shared/_modal.html.erb +3 -3
- data/blacklight.gemspec +8 -10
- data/config/importmap.rb +3 -0
- data/config/locales/blacklight.ar.yml +209 -233
- data/config/locales/blacklight.ca.yml +0 -7
- data/config/locales/blacklight.de.yml +197 -216
- data/config/locales/blacklight.en.yml +2 -7
- data/config/locales/blacklight.es.yml +196 -216
- data/config/locales/blacklight.fr.yml +196 -220
- data/config/locales/blacklight.hu.yml +193 -213
- data/config/locales/blacklight.it.yml +197 -216
- data/config/locales/blacklight.nl.yml +193 -213
- data/config/locales/blacklight.pt-BR.yml +195 -216
- data/config/locales/blacklight.sq.yml +193 -213
- data/config/locales/blacklight.zh.yml +194 -214
- data/config/routes.rb +3 -2
- data/db/migrate/20140202020201_create_searches.rb +1 -0
- data/db/migrate/20140202020202_create_bookmarks.rb +1 -0
- data/db/migrate/20140320000000_add_polymorphic_type_to_bookmarks.rb +1 -0
- data/docker-compose.yml +1 -0
- data/lib/blacklight/abstract_repository.rb +1 -0
- data/lib/blacklight/configuration/context.rb +4 -4
- data/lib/blacklight/configuration/display_field.rb +7 -9
- data/lib/blacklight/configuration/facet_field.rb +17 -11
- data/lib/blacklight/configuration/field.rb +1 -0
- data/lib/blacklight/configuration/fields.rb +12 -15
- data/lib/blacklight/configuration/index_field.rb +1 -0
- data/lib/blacklight/configuration/null_display_field.rb +17 -0
- data/lib/blacklight/configuration/search_field.rb +1 -0
- data/lib/blacklight/configuration/session_tracking_config.rb +45 -0
- data/lib/blacklight/configuration/show_field.rb +1 -0
- data/lib/blacklight/configuration/sort_field.rb +1 -0
- data/lib/blacklight/configuration/tool_config.rb +1 -0
- data/lib/blacklight/configuration/view_config.rb +16 -10
- data/lib/blacklight/configuration.rb +322 -341
- data/lib/blacklight/engine.rb +13 -15
- data/lib/blacklight/exceptions.rb +2 -2
- data/lib/blacklight/nested_open_struct_with_hash_access.rb +6 -12
- data/lib/blacklight/open_struct_with_hash_access.rb +19 -17
- data/lib/blacklight/parameters.rb +7 -21
- data/lib/blacklight/routes/exportable.rb +1 -0
- data/lib/blacklight/routes/searchable.rb +3 -1
- data/lib/blacklight/routes.rb +1 -0
- data/lib/blacklight/search_builder.rb +10 -10
- data/lib/blacklight/search_state/filter_field.rb +8 -25
- data/lib/blacklight/search_state/pivot_filter_field.rb +144 -0
- data/lib/blacklight/search_state.rb +23 -79
- data/lib/blacklight/solr/document.rb +1 -0
- data/lib/blacklight/solr/facet_paginator.rb +1 -0
- data/lib/blacklight/solr/repository.rb +1 -0
- data/lib/blacklight/solr/request.rb +3 -0
- data/lib/blacklight/solr/response/facets.rb +21 -5
- data/lib/blacklight/solr/response/group.rb +1 -0
- data/lib/blacklight/solr/response/group_response.rb +1 -0
- data/lib/blacklight/solr/response/more_like_this.rb +1 -0
- data/lib/blacklight/solr/response/pagination_methods.rb +4 -3
- data/lib/blacklight/solr/response/params.rb +5 -4
- data/lib/blacklight/solr/response/response.rb +1 -0
- data/lib/blacklight/solr/response/spelling.rb +1 -0
- data/lib/blacklight/solr/response.rb +4 -3
- data/lib/blacklight/solr/search_builder_behavior.rb +16 -32
- data/lib/blacklight/solr.rb +1 -0
- data/lib/blacklight/version.rb +1 -0
- data/lib/blacklight.rb +8 -11
- data/lib/generators/blacklight/assets/importmap_generator.rb +56 -0
- data/lib/generators/blacklight/assets/propshaft_generator.rb +34 -0
- data/lib/generators/blacklight/assets/sprockets_generator.rb +68 -0
- data/lib/generators/blacklight/assets_generator.rb +14 -88
- data/lib/generators/blacklight/controller_generator.rb +3 -2
- data/lib/generators/blacklight/document_generator.rb +1 -0
- data/lib/generators/blacklight/install_generator.rb +7 -4
- data/lib/generators/blacklight/models_generator.rb +1 -0
- data/lib/generators/blacklight/search_builder_generator.rb +1 -0
- data/lib/generators/blacklight/solr_generator.rb +1 -1
- data/lib/generators/blacklight/templates/catalog_controller.rb +37 -7
- data/lib/generators/blacklight/templates/solr_document.rb +1 -7
- data/lib/generators/blacklight/test_support_generator.rb +4 -2
- data/lib/generators/blacklight/user_generator.rb +7 -9
- data/lib/railties/blacklight.rake +2 -3
- data/package.json +10 -10
- data/rollup.config.js +37 -0
- data/spec/components/blacklight/constraints_component_spec.rb +17 -13
- data/spec/components/blacklight/document_component_spec.rb +74 -33
- data/spec/components/blacklight/facet_component_spec.rb +2 -7
- data/spec/components/blacklight/facet_field_checkboxes_component_spec.rb +1 -2
- data/spec/components/blacklight/facet_field_list_component_spec.rb +7 -6
- data/spec/components/blacklight/facet_item_pivot_component_spec.rb +9 -7
- data/spec/components/blacklight/header_component_spec.rb +20 -0
- data/spec/components/blacklight/response/view_type_component_spec.rb +83 -0
- data/spec/components/blacklight/search_bar_component_spec.rb +1 -1
- data/spec/components/blacklight/search_context/server_applied_params_component_spec.rb +29 -0
- data/spec/components/blacklight/search_context/server_item_pagination_component_spec.rb +51 -0
- data/spec/controllers/blacklight/catalog/component_configuration_spec.rb +1 -6
- data/spec/controllers/blacklight/{base_spec.rb → catalog_spec.rb} +2 -2
- data/spec/controllers/bookmarks_controller_spec.rb +2 -3
- data/spec/controllers/catalog_controller_spec.rb +24 -126
- data/spec/features/autocomplete_spec.rb +1 -1
- data/spec/features/axe_spec.rb +1 -1
- data/spec/features/bookmarks_spec.rb +1 -1
- data/spec/features/component_template_override_spec.rb +8 -0
- data/spec/features/facets_spec.rb +1 -1
- data/spec/features/modal_spec.rb +12 -0
- data/spec/features/search_context_spec.rb +4 -10
- data/spec/features/search_results_spec.rb +0 -33
- data/spec/features/sitelinks_search_box_spec.rb +13 -0
- data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +2 -138
- data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +0 -387
- data/spec/helpers/blacklight/icon_helper_behavior_spec.rb +8 -0
- data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +5 -7
- data/spec/helpers/blacklight/url_helper_behavior_spec.rb +10 -132
- data/spec/helpers/blacklight_helper_spec.rb +3 -298
- data/spec/helpers/catalog_helper_spec.rb +60 -115
- data/spec/i18n_spec.rb +1 -0
- data/spec/integration/generators/blacklight/solr_generator_spec.rb +1 -1
- data/spec/lib/blacklight/configuration/facet_field_spec.rb +27 -16
- data/spec/lib/blacklight/configuration/field_spec.rb +1 -1
- data/spec/lib/blacklight/configuration/session_tracking_config_spec.rb +38 -0
- data/spec/lib/blacklight/configuration/view_config_spec.rb +1 -1
- data/spec/lib/blacklight/open_struct_with_hash_access_spec.rb +4 -4
- data/spec/lib/blacklight/parameters_spec.rb +1 -4
- data/spec/lib/blacklight/search_state/filter_field_spec.rb +4 -4
- data/spec/lib/blacklight/search_state/pivot_filter_field_spec.rb +117 -0
- data/spec/lib/blacklight/search_state_spec.rb +80 -198
- data/spec/lib/tasks/blacklight_task_spec.rb +1 -0
- data/spec/models/blacklight/configuration_spec.rb +41 -53
- data/spec/models/blacklight/document/active_model_shim_spec.rb +2 -2
- data/spec/models/blacklight/icon_spec.rb +29 -15
- data/spec/models/blacklight/search_builder_spec.rb +12 -12
- data/spec/models/blacklight/solr/document_spec.rb +3 -3
- data/spec/models/blacklight/solr/request_spec.rb +2 -2
- data/spec/models/blacklight/solr/response/facets_spec.rb +27 -27
- data/spec/models/blacklight/solr/response/group_response_spec.rb +1 -0
- data/spec/models/blacklight/solr/response/group_spec.rb +1 -0
- data/spec/models/blacklight/solr/response_spec.rb +9 -2
- data/spec/models/blacklight/solr/search_builder_spec.rb +32 -23
- data/spec/models/blacklight/user_spec.rb +22 -0
- data/spec/models/record_mailer_spec.rb +36 -23
- data/spec/models/solr_document_spec.rb +21 -3
- data/spec/presenters/blacklight/clause_presenter_spec.rb +1 -0
- data/spec/presenters/blacklight/document_presenter_spec.rb +3 -2
- data/spec/presenters/blacklight/facet_field_presenter_spec.rb +85 -12
- data/spec/presenters/blacklight/facet_grouped_item_presenter_spec.rb +1 -0
- data/spec/presenters/blacklight/facet_item_presenter_spec.rb +14 -13
- data/spec/presenters/blacklight/field_presenter_spec.rb +2 -16
- data/spec/presenters/blacklight/index_presenter_spec.rb +3 -4
- data/spec/presenters/blacklight/json_presenter_spec.rb +1 -0
- data/spec/presenters/blacklight/link_alternate_presenter_spec.rb +3 -2
- data/spec/presenters/blacklight/show_presenter_spec.rb +11 -25
- data/spec/presenters/pipeline_spec.rb +13 -2
- data/spec/presenters/thumbnail_presenter_spec.rb +1 -1
- data/spec/requests/load_suggestions_spec.rb +16 -0
- data/spec/routing/catalog_routing_spec.rb +6 -1
- data/spec/services/blacklight/search_service_spec.rb +31 -68
- data/spec/spec_helper.rb +4 -3
- data/spec/support/controller_level_helpers.rb +1 -2
- data/spec/support/features/search_helpers.rb +39 -0
- data/spec/support/features/session_helpers.rb +1 -0
- data/spec/support/features.rb +3 -0
- data/spec/support/view_component_test_helpers.rb +21 -0
- data/spec/test_app_templates/Gemfile.extra +4 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +17 -2
- data/spec/views/catalog/_document.html.erb_spec.rb +23 -33
- data/spec/views/catalog/_document_list.html.erb_spec.rb +7 -2
- data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_search_header.erb_spec.rb +1 -0
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +1 -0
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +7 -54
- data/spec/views/catalog/_view_type_group.html.erb_spec.rb +17 -9
- data/spec/views/catalog/email_success.html.erb_spec.rb +2 -2
- data/spec/views/catalog/facet.html.erb_spec.rb +6 -3
- data/spec/views/catalog/index.atom.builder_spec.rb +18 -11
- data/spec/views/catalog/index.html.erb_spec.rb +5 -6
- data/spec/views/catalog/index.json.jbuilder_spec.rb +3 -3
- data/spec/views/catalog/show.html.erb_spec.rb +3 -25
- data/spec/views/catalog/sms_success.html.erb_spec.rb +2 -2
- data/tasks/blacklight.rake +7 -5
- metadata +95 -123
- data/.babelrc +0 -11
- data/app/assets/images/blacklight/list.svg +0 -1
- data/app/assets/images/blacklight/search.svg +0 -1
- data/app/assets/stylesheets/blacklight/_twitter_typeahead.scss +0 -37
- data/app/components/blacklight/content_areas_shim.rb +0 -13
- data/app/components/blacklight/search_context_component.rb +0 -34
- data/app/controllers/concerns/blacklight/base.rb +0 -7
- data/app/controllers/concerns/blacklight/default_component_configuration.rb +0 -64
- data/app/controllers/concerns/blacklight/facet.rb +0 -69
- data/app/controllers/concerns/blacklight/search_fields.rb +0 -46
- data/app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb +0 -27
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +0 -188
- data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +0 -97
- data/app/helpers/blacklight/suggest_helper_behavior.rb +0 -13
- data/app/javascript/blacklight/autocomplete.js +0 -36
- data/app/javascript/blacklight/facet_load.js +0 -22
- data/app/models/concerns/blacklight/document/email.rb +0 -26
- data/app/models/concerns/blacklight/document/sms.rb +0 -24
- data/app/presenters/blacklight/search_bar_presenter.rb +0 -47
- data/app/views/catalog/_constraints_element.html.erb +0 -14
- data/app/views/catalog/_document_action.html.erb +0 -5
- data/app/views/catalog/_facet_group.html.erb +0 -5
- data/app/views/catalog/_facet_limit.html.erb +0 -3
- data/app/views/catalog/_index.html.erb +0 -1
- data/app/views/catalog/_index_header.html.erb +0 -22
- data/app/views/catalog/_previous_next_doc.html.erb +0 -2
- data/app/views/catalog/_show.html.erb +0 -6
- data/app/views/catalog/_show_header.html.erb +0 -2
- data/app/views/catalog/_thumbnail.html.erb +0 -1
- data/lib/blacklight/deprecations/engine_configuration.rb +0 -66
- data/lib/blacklight/deprecations/search_state_normalization.rb +0 -52
- data/spec/controllers/blacklight/facet_spec.rb +0 -33
- data/spec/controllers/blacklight/search_fields_spec.rb +0 -62
- data/spec/features/sitelinks_search_box.rb +0 -13
- data/spec/helpers/blacklight/hash_as_hidden_fields_behavior_spec.rb +0 -26
- data/spec/helpers/blacklight/render_constraints_helper_behavior_spec.rb +0 -92
- data/spec/helpers/blacklight/search_history_constraints_helper_behavior_spec.rb +0 -108
- data/spec/helpers/blacklight/suggest_helper_behavior_spec.rb +0 -48
- data/spec/lib/blacklight/engine_spec.rb +0 -41
- data/spec/models/blacklight/document/email_spec.rb +0 -57
- data/spec/models/blacklight/document/sms_spec.rb +0 -58
- data/spec/presenters/blacklight/search_bar_presenter_spec.rb +0 -94
- data/spec/support/view_component_capybara_test_helpers.rb +0 -8
- data/spec/views/catalog/_constraints.html.erb_spec.rb +0 -33
- data/spec/views/catalog/_facet_group.html.erb_spec.rb +0 -84
- data/spec/views/catalog/_facets.html.erb_spec.rb +0 -15
- data/spec/views/catalog/_index.html.erb_spec.rb +0 -62
- data/spec/views/catalog/_index_header.html.erb_spec.rb +0 -35
- data/spec/views/catalog/_previous_next_doc.html.erb_spec.rb +0 -22
- data/spec/views/catalog/_show.html.erb_spec.rb +0 -62
- data/spec/views/catalog/_thumbnail.html.erb_spec.rb +0 -38
- /data/app/components/blacklight/{search_context_component.html.erb → search_context/server_item_pagination_component.html.erb} +0 -0
|
@@ -72,7 +72,7 @@ module Blacklight
|
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
def thumbnail_value_from_document
|
|
75
|
-
Array(thumbnail_field).lazy.map { |field| retrieve_values(field_config(field)).first }.
|
|
75
|
+
Array(thumbnail_field).lazy.map { |field| retrieve_values(field_config(field)).first }.compact_blank.first
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
def retrieve_values(field_config)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Blacklight
|
|
4
|
+
# Extends the search Builders to add bookmarks
|
|
5
|
+
class BookmarksSearchBuilder < ::SearchBuilder
|
|
6
|
+
##
|
|
7
|
+
# Filters the query to only include the bookmarked items
|
|
8
|
+
#
|
|
9
|
+
# @param [Hash] solr_parameters
|
|
10
|
+
#
|
|
11
|
+
# @return [void]
|
|
12
|
+
def bookmarked(solr_parameters)
|
|
13
|
+
solr_parameters[:fq] ||= []
|
|
14
|
+
bookmarks = @scope.context.fetch(:bookmarks)
|
|
15
|
+
return unless bookmarks
|
|
16
|
+
|
|
17
|
+
document_ids = bookmarks.collect { |b| b.document_id.to_s }
|
|
18
|
+
solr_parameters[:fq] += ["{!terms f=id}#{document_ids.join(',')}"]
|
|
19
|
+
end
|
|
20
|
+
self.default_processor_chain += [:bookmarked]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -67,14 +67,7 @@ module Blacklight
|
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
def retrieve_values
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if values_method.respond_to?(:arity) && values_method.arity.abs == 2
|
|
73
|
-
Deprecation.warn(self, ":values parameter for field #{field_config.key} only accepts 2 arguments; should accept 3")
|
|
74
|
-
values_method.call(field_config, document)
|
|
75
|
-
else
|
|
76
|
-
values_method.call(field_config, document, view_context)
|
|
77
|
-
end
|
|
70
|
+
field_config.values.call(field_config, document, view_context)
|
|
78
71
|
end
|
|
79
72
|
end
|
|
80
73
|
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
# SearchService returns search results from the repository
|
|
3
4
|
module Blacklight
|
|
4
5
|
class SearchService
|
|
@@ -33,17 +34,18 @@ module Blacklight
|
|
|
33
34
|
response = repository.search(builder)
|
|
34
35
|
|
|
35
36
|
if response.grouped? && grouped_key_for_results
|
|
36
|
-
|
|
37
|
+
response.group(grouped_key_for_results)
|
|
37
38
|
elsif response.grouped? && response.grouped.length == 1
|
|
38
|
-
|
|
39
|
+
response.grouped.first
|
|
39
40
|
else
|
|
40
|
-
|
|
41
|
+
response
|
|
41
42
|
end
|
|
42
43
|
end
|
|
43
44
|
|
|
44
45
|
# retrieve a document, given the doc id
|
|
45
46
|
# @param [Array{#to_s},#to_s] id
|
|
46
|
-
# @return [Blacklight::
|
|
47
|
+
# @return [Blacklight::SolrDocument] the solr document (or array of
|
|
48
|
+
# documents if an array of ids was given)
|
|
47
49
|
def fetch(id = nil, extra_controller_params = {})
|
|
48
50
|
if id.is_a? Array
|
|
49
51
|
fetch_many(id, extra_controller_params)
|
|
@@ -123,7 +125,7 @@ module Blacklight
|
|
|
123
125
|
|
|
124
126
|
if index > 0
|
|
125
127
|
solr_params[:start] = index - window # get one before
|
|
126
|
-
solr_params[:rows] = 2 * window + 1 # and one after
|
|
128
|
+
solr_params[:rows] = (2 * window) + 1 # and one after
|
|
127
129
|
else
|
|
128
130
|
solr_params[:start] = 0 # there is no previous doc
|
|
129
131
|
solr_params[:rows] = 2 * window # but there should be one after
|
|
@@ -148,12 +150,12 @@ module Blacklight
|
|
|
148
150
|
|
|
149
151
|
solr_response = repository.search(query)
|
|
150
152
|
|
|
151
|
-
|
|
153
|
+
solr_response.documents
|
|
152
154
|
end
|
|
153
155
|
|
|
154
156
|
def fetch_one(id, extra_controller_params)
|
|
155
157
|
solr_response = repository.find id, extra_controller_params
|
|
156
|
-
|
|
158
|
+
solr_response.documents.first
|
|
157
159
|
end
|
|
158
160
|
end
|
|
159
161
|
end
|
|
@@ -1,31 +1,115 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "active_model"
|
|
4
|
+
|
|
3
5
|
module Blacklight
|
|
4
6
|
# These are data types that blacklight can use to coerce values from the index
|
|
5
7
|
module Types
|
|
6
|
-
|
|
8
|
+
@registry = ActiveModel::Type::Registry.new
|
|
9
|
+
|
|
10
|
+
class << self
|
|
11
|
+
delegate :lookup, :register, to: :@registry
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
class Value
|
|
7
15
|
def self.coerce(input)
|
|
8
|
-
|
|
16
|
+
new.cast(input)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def cast(input)
|
|
20
|
+
if input.is_a?(::Array)
|
|
21
|
+
input.first
|
|
22
|
+
else
|
|
23
|
+
input
|
|
24
|
+
end
|
|
9
25
|
end
|
|
10
26
|
end
|
|
11
27
|
|
|
12
|
-
class
|
|
13
|
-
def
|
|
14
|
-
|
|
28
|
+
class Array < Value
|
|
29
|
+
def initialize(of: nil, **kwargs)
|
|
30
|
+
@of = of
|
|
31
|
+
@kwargs = kwargs
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def cast(input)
|
|
35
|
+
::Array.wrap(input).map do |value|
|
|
36
|
+
lookup_type.cast(value)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
private
|
|
41
|
+
|
|
42
|
+
def lookup_type
|
|
43
|
+
return Blacklight::Types::Value.new(**@kwargs) if @of.nil?
|
|
44
|
+
|
|
45
|
+
@lookup_type ||= Blacklight::Types.lookup(@of, **@kwargs)
|
|
15
46
|
end
|
|
16
47
|
end
|
|
17
48
|
|
|
18
|
-
class
|
|
19
|
-
def
|
|
20
|
-
|
|
21
|
-
|
|
49
|
+
class String < Value
|
|
50
|
+
def cast(input)
|
|
51
|
+
super&.to_s
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
class Date < Value
|
|
56
|
+
def cast(input)
|
|
57
|
+
value = super
|
|
58
|
+
return if value.blank?
|
|
22
59
|
|
|
23
60
|
begin
|
|
24
|
-
::Date.parse(
|
|
61
|
+
::Date.parse(value.to_s)
|
|
25
62
|
rescue ArgumentError
|
|
26
|
-
Rails.logger&.info "Unable to parse date: #{
|
|
63
|
+
Rails.logger&.info "Unable to parse date: #{value.inspect}"
|
|
27
64
|
end
|
|
28
65
|
end
|
|
29
66
|
end
|
|
67
|
+
|
|
68
|
+
class Boolean < Value
|
|
69
|
+
def cast(input)
|
|
70
|
+
ActiveModel::Type::Boolean.new.cast(super)
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
class JsonValue < Value
|
|
75
|
+
def cast(input)
|
|
76
|
+
value = super
|
|
77
|
+
|
|
78
|
+
return value unless value.is_a?(String)
|
|
79
|
+
|
|
80
|
+
JSON.parse(value)
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
class Selector < Array
|
|
85
|
+
def initialize(by: nil, block: nil, **kwargs)
|
|
86
|
+
super(**kwargs)
|
|
87
|
+
@by = by
|
|
88
|
+
@block = block
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def cast(input)
|
|
92
|
+
return super.public_send(@by) unless @block
|
|
93
|
+
|
|
94
|
+
super.public_send(@by, &@block)
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# rubocop:disable Rails/OutputSafety
|
|
99
|
+
class Html < String
|
|
100
|
+
def cast(input)
|
|
101
|
+
super&.html_safe
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
# rubocop:enable Rails/OutputSafety
|
|
105
|
+
|
|
106
|
+
register :boolean, Boolean
|
|
107
|
+
register :string, String
|
|
108
|
+
register :date, Date
|
|
109
|
+
register :array, Array
|
|
110
|
+
register :json, JsonValue
|
|
111
|
+
register :html, Html
|
|
112
|
+
register :select, Selector
|
|
113
|
+
register :value, Value
|
|
30
114
|
end
|
|
31
115
|
end
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
<%= link_to t('blacklight.bookmarks.clear.action_title'), clear_bookmarks_path,
|
|
1
|
+
<%= link_to t('blacklight.bookmarks.clear.action_title'), clear_bookmarks_path,
|
|
2
|
+
method: :delete, # for rails-UJS
|
|
3
|
+
data: {
|
|
4
|
+
confirm: t('blacklight.bookmarks.clear.action_confirm'), # for rails-UJS
|
|
5
|
+
turbo_method: :delete,
|
|
6
|
+
turbo_confirm: t('blacklight.bookmarks.clear.action_confirm')
|
|
7
|
+
},
|
|
8
|
+
class: 'clear-bookmarks btn btn-danger' %>
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<%= inner %>
|
|
9
|
-
</li>
|
|
10
|
-
<% end %>
|
|
11
|
-
</ul>
|
|
12
|
-
<% end %>
|
|
1
|
+
<%= render Blacklight::Document::ActionsComponent.new(document: nil,
|
|
2
|
+
tag: 'div',
|
|
3
|
+
classes: "#{controller_name}Tools",
|
|
4
|
+
link_classes: 'btn btn-outline-primary',
|
|
5
|
+
actions: document_actions(document_list, options: { document: nil }),
|
|
6
|
+
options: { document_list: @response.documents },
|
|
7
|
+
url_opts: Blacklight::Parameters.sanitize(params.to_unsafe_h)) %>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<%= render Blacklight::Document::BookmarkComponent.new(document: document
|
|
1
|
+
<%= render Blacklight::Document::BookmarkComponent.new(document: document, action: document_action_config) %>
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
2
|
-
<%= render((blacklight_config&.view_config(document_index_view_type)&.constraints_component || Blacklight::ConstraintsComponent).new(search_state: convert_to_search_state(controller.params != params ? params : search_state))) %>
|
|
3
|
-
<% else %>
|
|
4
|
-
<% Deprecation.warn(Blacklight::RenderConstraintsHelperBehavior, 'Constraints helpers or partials were overridden; not using components') %>
|
|
5
|
-
<% if Deprecation.silence(Blacklight::RenderConstraintsHelperBehavior) { query_has_constraints? } %>
|
|
6
|
-
<div id="appliedParams" class="clearfix constraints-container">
|
|
7
|
-
<h2 class="sr-only visually-hidden"><%= t('blacklight.search.search_constraints_header') %></h2>
|
|
8
|
-
|
|
9
|
-
<%= render 'start_over' %>
|
|
10
|
-
<span class="constraints-label sr-only visually-hidden"><%= t('blacklight.search.filters.title') %></span>
|
|
11
|
-
<%= render_constraints(controller.params != params ? params : search_state) %>
|
|
12
|
-
</div>
|
|
13
|
-
<% end %>
|
|
14
|
-
<% end %>
|
|
1
|
+
<%= render (blacklight_config&.view_config(document_index_view_type)&.constraints_component || Blacklight::ConstraintsComponent).new(search_state: search_state) %>
|
|
@@ -7,14 +7,12 @@ xml.entry do
|
|
|
7
7
|
# updated is required, for now we'll just set it to now, sorry
|
|
8
8
|
xml.updated Time.current.iso8601
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
xml << presenter.link_rel_alternates(unique: true)
|
|
10
|
+
xml.link "rel" => "alternate", "type" => "text/html", "href" => polymorphic_url(search_state.url_for_document(document))
|
|
11
|
+
# add other doc-specific formats, atom only lets us have one per
|
|
12
|
+
# content type, so the first one in the list wins.
|
|
13
|
+
xml << presenter.link_rel_alternates(unique: true)
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
end
|
|
15
|
+
xml.id polymorphic_url(search_state.url_for_document(document))
|
|
18
16
|
|
|
19
17
|
if document.to_semantic_values.key? :author
|
|
20
18
|
xml.author { xml.name(document.to_semantic_values[:author].first) }
|
|
@@ -22,13 +20,12 @@ xml.entry do
|
|
|
22
20
|
|
|
23
21
|
with_format(:html) do
|
|
24
22
|
xml.summary "type" => "html" do
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
document_counter: document_counter)
|
|
23
|
+
document_component = blacklight_config.view_config(:atom).summary_component
|
|
24
|
+
xml.text! render document_component.new(document_component.collection_parameter => document_presenter(document), component: :div, show: true)
|
|
28
25
|
end
|
|
29
26
|
end
|
|
30
27
|
|
|
31
|
-
#If they asked for a format, give it to them.
|
|
28
|
+
# If they asked for a format, give it to them.
|
|
32
29
|
if (params["content_format"] &&
|
|
33
30
|
document.export_formats[params["content_format"].to_sym])
|
|
34
31
|
|
|
@@ -40,14 +37,15 @@ xml.entry do
|
|
|
40
37
|
# encode properly. See:
|
|
41
38
|
# http://tools.ietf.org/html/rfc4287#section-4.1.3.3
|
|
42
39
|
type = type.downcase
|
|
43
|
-
|
|
40
|
+
case type.downcase
|
|
41
|
+
when %r{\+|/xml$}
|
|
44
42
|
# xml, just put it right in
|
|
45
43
|
content_element << data
|
|
46
|
-
|
|
44
|
+
when %r{text/}
|
|
47
45
|
# text, escape
|
|
48
46
|
content_element.text! data
|
|
49
47
|
else
|
|
50
|
-
#something else, base64 encode it
|
|
48
|
+
# something else, base64 encode it
|
|
51
49
|
content_element << Base64.encode64(data)
|
|
52
50
|
end
|
|
53
51
|
end
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
<% # container for a single doc -%>
|
|
2
|
-
<% view_config = local_assigns[:view_config] || blacklight_config.view_config(document_index_view_type) %>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<%= render_document_partials document, view_config.partials, component: component, document_counter: document_counter %>
|
|
6
|
-
<% end %>
|
|
7
|
-
<% end %>
|
|
2
|
+
<% view_config = local_assigns[:view_config] || blacklight_config.view_config(document_index_view_type, action_name: action_name) %>
|
|
3
|
+
<% document_component = view_config.document_component -%>
|
|
4
|
+
<%= render document_component.new(document_component.collection_parameter => document_presenter(document), counter: document_counter_with_offset(document_counter), partials: view_config&.partials) %>
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
xml.item do
|
|
4
4
|
xml.title(document_presenter(document).heading || (document.to_semantic_values[:title].first if document.to_semantic_values.key?(:title)))
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
end
|
|
8
|
-
xml.author( document.to_semantic_values[:author].first ) if document.to_semantic_values.key? :author
|
|
5
|
+
xml.link(polymorphic_url(search_state.url_for_document(document)))
|
|
6
|
+
xml.author(document.to_semantic_values[:author].first) if document.to_semantic_values.key? :author
|
|
9
7
|
end
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<% # container for all documents in index list view -%>
|
|
2
2
|
<% view_config = local_assigns[:view_config] || blacklight_config&.view_config(document_index_view_type) %>
|
|
3
3
|
<div id="documents" class="documents-<%= view_config&.key || document_index_view_type %>">
|
|
4
|
-
|
|
4
|
+
<% document_presenters = documents.map { |doc| document_presenter(doc) } -%>
|
|
5
|
+
<%= render view_config.document_component.with_collection(document_presenters, partials: view_config.partials, counter_offset: @response&.start || 0) %>
|
|
5
6
|
</div>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<%= render(Blacklight::FacetFieldComponent.new(facet_field: facet_field_presenter(facet_field, nil))) do |component| %>
|
|
2
|
-
<% component.
|
|
2
|
+
<% component.with_label do %>
|
|
3
3
|
<%= facet_field_label(facet_field.key) %>
|
|
4
4
|
<% end %>
|
|
5
|
-
<% component.
|
|
5
|
+
<% component.with_body do %>
|
|
6
6
|
<%= yield %>
|
|
7
7
|
<% end %>
|
|
8
8
|
<% end %>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<% #
|
|
2
|
-
<%
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<% # this partial is deprecated. catalog/index now renders the component %>
|
|
2
|
+
<% conf = blacklight_config.view_config(document_index_view_type) %>
|
|
3
|
+
<%= render conf.sidebar_component.new(blacklight_config: blacklight_config,
|
|
4
|
+
response: @response,
|
|
5
|
+
view_config: conf) %>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
<p>
|
|
7
7
|
<%= link_to 'Read the Documentation', 'https://github.com/projectblacklight/blacklight/wiki', class: 'btn btn-primary' %>
|
|
8
|
-
<%= link_to 'See Examples', 'http://projectblacklight.org', class: 'btn btn-
|
|
8
|
+
<%= link_to 'See Examples', 'http://projectblacklight.org', class: 'btn btn-secondary' %>
|
|
9
9
|
</p>
|
|
10
10
|
</div>
|
|
11
11
|
|
|
@@ -29,16 +29,4 @@
|
|
|
29
29
|
</p>
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
<div id="about" class="card">
|
|
34
|
-
<h2 class='card-header collapsed collapse-toggle' data-toggle="collapse" data-bs-toggle="collapse" data-bs-target="#about-content" data-target="#about-content"><a href="/rails/info/properties">About your application’s environment</a></h2>
|
|
35
|
-
<div id="about-content" class="card-body collapse"></div>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
<script>
|
|
39
|
-
Blacklight.onLoad(function() {
|
|
40
|
-
$('#about .card-header').one('click', function() {
|
|
41
|
-
$($(this).data('target')).load($(this).find('a').attr('href'));
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
</script>
|
|
32
|
+
<p>Blacklight <%= Blacklight::VERSION %></p>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<%= warn "#{
|
|
1
|
+
<%= warn "#{__file__} is a deprecated partial." %>
|
|
2
2
|
<%= render((blacklight_config&.view_config(document_index_view_type)&.search_bar_component || Blacklight::SearchBarComponent).new(
|
|
3
3
|
url: search_action_url,
|
|
4
4
|
advanced_search_url: search_action_url(action: 'advanced_search'),
|
|
5
5
|
params: search_state.params_for_search.except(:qt),
|
|
6
|
-
|
|
7
|
-
autocomplete_path:
|
|
6
|
+
presenter: presenter,
|
|
7
|
+
autocomplete_path: suggest_index_catalog_path)) %>
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
<%= render
|
|
2
|
-
<%= render 'sort_and_per_page' %>
|
|
1
|
+
<%= render blacklight_config.view_config(document_index_view_type).search_header_component.new %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<% @page_title = t('blacklight.search.page_title.title', constraints: render_search_to_page_title(
|
|
1
|
+
<% @page_title = t('blacklight.search.page_title.title', constraints: render_search_to_page_title(search_state), application_name: application_name) %>
|
|
2
2
|
|
|
3
3
|
<% content_for(:head) do -%>
|
|
4
4
|
<%= render 'catalog/opensearch_response_metadata', response: @response %>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<%- if @response.empty? %>
|
|
24
24
|
<%= render "zero_results" %>
|
|
25
25
|
<%- elsif render_grouped_response? %>
|
|
26
|
-
<%=
|
|
26
|
+
<%= render 'catalog/group' %>
|
|
27
27
|
<%- else %>
|
|
28
28
|
<%= render_document_index @response.documents %>
|
|
29
29
|
<%- end %>
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
<% # this partial is deprecated. catalog/index now renders the component %>
|
|
2
|
+
<% conf = blacklight_config.view_config(document_index_view_type) %>
|
|
3
|
+
<%= render conf.sidebar_component.new(blacklight_config: blacklight_config,
|
|
4
|
+
response: @response,
|
|
5
|
+
view_config: conf) %>
|
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
<%= render
|
|
2
|
-
|
|
3
|
-
<% @page_title = t('blacklight.search.show.title', document_title: Deprecation.silence(Blacklight::BlacklightHelperBehavior) { document_show_html_title }, application_name: application_name).html_safe %>
|
|
1
|
+
<%= render blacklight_config.track_search_session.item_pagination_component.new(search_context: @search_context, search_session: search_session, current_document: @document) if blacklight_config.track_search_session.item_pagination_component %>
|
|
2
|
+
<% @page_title = t('blacklight.search.show.title', document_title: document_presenter(@document).html_title, application_name: application_name).html_safe %>
|
|
4
3
|
<% content_for(:head) { render_link_rel_alternates } %>
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<% document_component = blacklight_config.view_config(:show).document_component -%>
|
|
6
|
+
<%= render (document_component).new(document_component.collection_parameter => document_presenter(@document), component: :div, show: true, partials: blacklight_config.view_config(:show).partials) do |component| %>
|
|
7
|
+
<% component.with_title(as: 'h1', classes: '', link_to_document: false, actions: false) %>
|
|
8
|
+
<% component.with_footer do %>
|
|
8
9
|
<% if @document.respond_to?(:export_as_openurl_ctx_kev) %>
|
|
9
|
-
<!--
|
|
10
|
-
|
|
11
|
-
// This document_partial_name(@document) business is not quite right,
|
|
12
|
-
// but has been there for a while.
|
|
13
|
-
-->
|
|
14
|
-
<span class="Z3988" title="<%= @document.export_as_openurl_ctx_kev(Deprecation.silence(Blacklight::RenderPartialsHelperBehavior) { document_partial_name(@document) }) %>"></span>
|
|
10
|
+
<!-- COinS, for Zotero among others. -->
|
|
11
|
+
<span class="Z3988" title="<%= @document.export_as_openurl_ctx_kev(document_presenter(@document).display_type) %>"></span>
|
|
15
12
|
<% end %>
|
|
16
|
-
<% end %>
|
|
17
|
-
|
|
18
|
-
<%# Use :body for complete backwards compatibility (overriding the component body markup),
|
|
19
|
-
but if the app explicitly opted-in to components, make the partials data available as :partials to ease migrations pain %>
|
|
20
|
-
<% component.public_send(blacklight_config.view_config(:show).document_component.blank? && blacklight_config.view_config(:show).partials.any? ? :body : :partial) do %>
|
|
21
|
-
<div id="doc_<%= @document.id.to_s.parameterize %>">
|
|
22
|
-
<%= render_document_partials @document, blacklight_config.view_config(:show).partials, component: component %>
|
|
23
|
-
</div>
|
|
24
13
|
<% end %>
|
|
25
14
|
<% end %>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
<%= render
|
|
1
|
+
<% presenter = document_presenter(document) %>
|
|
2
|
+
<%= render presenter.view_config.sidebar_component.new(presenter: presenter) %>
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
<div class="card show-tools">
|
|
3
|
-
<div class="card-header">
|
|
4
|
-
<h2 class="mb-0 h6"><%= t('blacklight.tools.title') %></h2>
|
|
5
|
-
</div>
|
|
6
|
-
<% if render_show_doc_actions_method_from_blacklight? %>
|
|
7
|
-
<%= render(Blacklight::Document::ActionsComponent.new(document: @document, tag: 'ul', classes: 'list-group list-group-flush', wrapping_tag: 'li', wrapping_classes: 'list-group-item', actions: document_actions(@document), url_opts: Blacklight::Parameters.sanitize(params.to_unsafe_h))) %>
|
|
8
|
-
<% else %>
|
|
9
|
-
<% Deprecation.warn(self, '#render_show_doc_actions is deprecated; use ActionComponents instead') %>
|
|
10
|
-
<ul class="list-group list-group-flush">
|
|
11
|
-
<%= render_show_doc_actions @document do |config, inner| %>
|
|
12
|
-
<li class="list-group-item <%= config.key %>">
|
|
13
|
-
<%= inner %>
|
|
14
|
-
</li>
|
|
15
|
-
<% end %>
|
|
16
|
-
</ul>
|
|
17
|
-
<% end %>
|
|
18
|
-
</div>
|
|
19
|
-
<% end %>
|
|
1
|
+
<%= render Blacklight::Document::ShowToolsComponent.new(document: document) %>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<% end %>
|
|
1
|
+
<turbo-stream action="append" target="main-flashes">
|
|
2
|
+
<template>
|
|
3
|
+
<%= render '/shared/flash_msg' %>
|
|
4
|
+
</template>
|
|
5
|
+
</turbo-stream>
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
<%= render Blacklight::System::ModalComponent.new do |component| %>
|
|
2
|
-
<% component.
|
|
2
|
+
<% component.with_prefix do %>
|
|
3
3
|
<div class="facet-pagination top row justify-content-between">
|
|
4
4
|
<%= render :partial=>'facet_pagination' %>
|
|
5
5
|
</div>
|
|
6
6
|
<% end %>
|
|
7
7
|
|
|
8
|
-
<% component.
|
|
8
|
+
<% component.with_title { facet_field_label(@facet.key) } %>
|
|
9
9
|
|
|
10
10
|
<%= render partial: 'facet_index_navigation' if @facet.index_range && @display_facet.index? %>
|
|
11
11
|
|
|
12
12
|
<div class="facet-extended-list">
|
|
13
|
-
<%=
|
|
13
|
+
<%= render Blacklight::FacetComponent.new(display_facet: @display_facet,
|
|
14
|
+
blacklight_config: blacklight_config,
|
|
15
|
+
layout: false) %>
|
|
14
16
|
</div>
|
|
15
17
|
|
|
16
|
-
<% component.
|
|
17
|
-
<div class="facet-pagination bottom row justify-content-between">
|
|
18
|
+
<% component.with_footer do %>
|
|
19
|
+
<div class="facet-pagination bottom flex-row justify-content-between">
|
|
18
20
|
<%= render :partial=>'facet_pagination' %>
|
|
19
21
|
</div>
|
|
20
22
|
<% end %>
|
|
@@ -6,7 +6,7 @@ xml.instruct!(:xml, encoding: "UTF-8")
|
|
|
6
6
|
|
|
7
7
|
xml.feed("xmlns" => "http://www.w3.org/2005/Atom",
|
|
8
8
|
"xmlns:opensearch" => "http://a9.com/-/spec/opensearch/1.1/") do
|
|
9
|
-
xml.title
|
|
9
|
+
xml.title t('blacklight.search.page_title.title', constraints: render_search_to_page_title(params), application_name: application_name)
|
|
10
10
|
# an author is required, so we'll just use the app name
|
|
11
11
|
xml.author { xml.name application_name }
|
|
12
12
|
|
|
@@ -16,25 +16,23 @@ xml.feed("xmlns" => "http://www.w3.org/2005/Atom",
|
|
|
16
16
|
|
|
17
17
|
# Navigational and context links
|
|
18
18
|
|
|
19
|
-
xml.link(
|
|
20
|
-
|
|
21
|
-
) if @response.next_page
|
|
19
|
+
xml.link("rel" => "next",
|
|
20
|
+
"href" => url_for(search_state.to_h.merge(only_path: false, page: @response.next_page.to_s))) if @response.next_page
|
|
22
21
|
|
|
23
|
-
xml.link(
|
|
24
|
-
|
|
25
|
-
) if @response.prev_page
|
|
22
|
+
xml.link("rel" => "previous",
|
|
23
|
+
"href" => url_for(search_state.to_h.merge(only_path: false, page: @response.prev_page.to_s))) if @response.prev_page
|
|
26
24
|
|
|
27
|
-
xml.link(
|
|
28
|
-
|
|
25
|
+
xml.link("rel" => "first",
|
|
26
|
+
"href" => url_for(search_state.to_h.merge(only_path: false, page: "1")))
|
|
29
27
|
|
|
30
|
-
xml.link(
|
|
31
|
-
|
|
28
|
+
xml.link("rel" => "last",
|
|
29
|
+
"href" => url_for(search_state.to_h.merge(only_path: false, page: @response.total_pages.to_s)))
|
|
32
30
|
|
|
33
31
|
# "search" doesn't seem to actually be legal, but is very common, and
|
|
34
32
|
# used as an example in opensearch docs
|
|
35
|
-
xml.link(
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
xml.link("rel" => "search",
|
|
34
|
+
"type" => "application/opensearchdescription+xml",
|
|
35
|
+
"href" => url_for(controller: 'catalog', action: 'opensearch', format: 'xml', only_path: false))
|
|
38
36
|
|
|
39
37
|
# opensearch response elements
|
|
40
38
|
xml.opensearch :totalResults, @response.total.to_s
|