blacklight 8.8.3 → 9.0.0.beta1
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 -3
- data/.github/pull_request_template.md +7 -0
- data/.github/workflows/ruby.yml +1 -9
- data/.rubocop.yml +2 -2
- data/.rubocop_todo.yml +0 -9
- data/README.md +30 -8
- data/VERSION +1 -1
- data/app/assets/builds/blacklight.css +448 -0
- data/app/assets/javascripts/blacklight/blacklight.esm.js +18 -15
- data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +18 -15
- data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
- data/app/assets/stylesheets/blacklight/_balanced_list.scss +1 -4
- data/app/assets/stylesheets/blacklight/_blacklight_base.scss +1 -3
- data/app/assets/stylesheets/blacklight/_bookmark.scss +44 -41
- data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +7 -26
- data/app/assets/stylesheets/blacklight/_constraints.scss +15 -24
- data/app/assets/stylesheets/blacklight/_controls.scss +2 -18
- data/app/assets/stylesheets/blacklight/_facets.scss +15 -82
- data/app/assets/stylesheets/blacklight/_group.scss +2 -5
- data/app/assets/stylesheets/blacklight/_header.scss +4 -11
- data/app/assets/stylesheets/blacklight/_icons.scss +0 -8
- data/app/assets/stylesheets/blacklight/_modal.scss +2 -2
- data/app/assets/stylesheets/blacklight/_pagination.scss +0 -4
- data/app/assets/stylesheets/blacklight/_search_form.scss +0 -1
- data/app/assets/stylesheets/blacklight/_search_history.scss +0 -4
- data/app/assets/stylesheets/blacklight/_search_results.scss +1 -15
- data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +9 -14
- data/app/assets/stylesheets/blacklight/build.scss +4 -0
- data/app/components/blacklight/advanced_search_form_component.rb +1 -1
- data/app/components/blacklight/constraint_component.rb +1 -1
- data/app/components/blacklight/constraint_layout_component.html.erb +2 -2
- data/app/components/blacklight/constraints_component.html.erb +2 -2
- data/app/components/blacklight/constraints_component.rb +1 -1
- data/app/components/blacklight/document/action_component.rb +3 -1
- data/app/components/blacklight/document/bookmark_component.html.erb +3 -3
- data/app/components/blacklight/document/group_component.html.erb +1 -1
- data/app/components/blacklight/document/page_header_component.rb +1 -1
- data/app/components/blacklight/document/sidebar_component.rb +5 -5
- data/app/components/blacklight/document_component.rb +9 -13
- data/app/components/blacklight/document_title_component.rb +3 -2
- data/app/components/blacklight/facet_field_component.html.erb +5 -5
- data/app/components/blacklight/facet_field_list_component.rb +4 -22
- data/app/components/blacklight/facet_item_component.rb +2 -2
- data/app/components/blacklight/facet_item_pivot_component.rb +2 -2
- data/app/components/blacklight/response/facet_group_component.html.erb +3 -18
- data/app/components/blacklight/response/facet_group_component.rb +7 -23
- data/app/components/blacklight/response/facet_toggle_button_component.html.erb +16 -0
- data/app/components/blacklight/response/facet_toggle_button_component.rb +14 -0
- data/app/components/blacklight/response/pagination_component.html.erb +1 -1
- data/app/components/blacklight/response/pagination_component.rb +2 -1
- data/app/components/blacklight/response/sort_component.rb +1 -0
- data/app/components/blacklight/response/view_type_button_component.html.erb +1 -1
- data/app/components/blacklight/response/view_type_component.html.erb +1 -1
- data/app/components/blacklight/search/facet_suggest_input.html.erb +7 -7
- data/app/components/blacklight/search/facet_suggest_input.rb +0 -4
- data/app/components/blacklight/search/per_page_component.html.erb +1 -1
- data/app/components/blacklight/search/per_page_component.rb +1 -0
- data/app/components/blacklight/search/sidebar_component.html.erb +1 -1
- data/app/components/blacklight/search/sidebar_component.rb +1 -1
- data/app/components/blacklight/search_bar_component.html.erb +3 -3
- data/app/components/blacklight/search_bar_component.rb +2 -2
- data/app/components/blacklight/search_button_component.rb +2 -2
- data/app/components/blacklight/search_context/server_applied_params_component.html.erb +2 -2
- data/app/components/blacklight/search_context/server_applied_params_component.rb +9 -0
- data/app/components/blacklight/skip_link_component.html.erb +1 -1
- data/app/components/blacklight/skip_link_component.rb +7 -3
- data/app/components/blacklight/skip_link_item_component.rb +18 -0
- data/app/components/blacklight/top_navbar_component.html.erb +1 -1
- data/app/controllers/concerns/blacklight/catalog.rb +3 -2
- data/app/controllers/concerns/blacklight/search_context.rb +0 -12
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +0 -6
- data/app/helpers/blacklight/catalog_helper_behavior.rb +1 -11
- data/app/helpers/blacklight/configuration_helper_behavior.rb +0 -12
- data/app/helpers/blacklight/document_helper_behavior.rb +0 -26
- data/app/helpers/blacklight/icon_helper_behavior.rb +1 -9
- data/app/helpers/blacklight/layout_helper_behavior.rb +2 -2
- data/app/helpers/blacklight/render_partials_helper_behavior.rb +0 -14
- data/app/helpers/blacklight/url_helper_behavior.rb +1 -1
- data/app/javascript/{blacklight → blacklight-frontend}/bookmark_toggle.js +1 -1
- data/app/javascript/{blacklight → blacklight-frontend}/core.js +2 -10
- data/app/javascript/{blacklight → blacklight-frontend}/debounce.js +1 -1
- data/app/javascript/{blacklight → blacklight-frontend}/facet_suggest.js +3 -3
- data/app/javascript/blacklight-frontend/index.js +18 -0
- data/app/javascript/{blacklight → blacklight-frontend}/modal.js +16 -2
- data/app/models/concerns/blacklight/document.rb +0 -11
- data/app/models/concerns/blacklight/user.rb +1 -1
- data/app/presenters/blacklight/facet_field_presenter.rb +2 -2
- data/app/presenters/blacklight/json_presenter.rb +3 -1
- data/app/services/blacklight/search_params_yaml_coder.rb +0 -2
- data/app/views/bookmarks/_clear_bookmarks_widget.html.erb +0 -2
- data/app/views/bookmarks/index.html.erb +1 -1
- data/app/views/catalog/_results_pagination.html.erb +2 -5
- data/app/views/catalog/_search_results.html.erb +4 -4
- data/app/views/catalog/_search_results_header.html.erb +1 -1
- data/app/views/catalog/_sort_and_per_page.html.erb +1 -1
- data/app/views/catalog/_sort_widget.html.erb +1 -0
- data/app/views/catalog/facet.html.erb +1 -1
- data/app/views/catalog/show.html.erb +2 -3
- data/app/views/kaminari/blacklight/_paginator.html.erb +1 -2
- data/app/views/layouts/blacklight/base.html.erb +3 -7
- data/app/views/search_history/index.html.erb +0 -2
- data/blacklight.gemspec +4 -4
- data/config/importmap.rb +1 -1
- data/config/locales/blacklight.ar.yml +4 -4
- data/config/locales/blacklight.ca.yml +124 -124
- data/config/locales/blacklight.de.yml +2 -2
- data/config/locales/blacklight.en.yml +14 -14
- data/config/locales/blacklight.es.yml +4 -4
- data/config/locales/blacklight.fr.yml +4 -4
- data/config/locales/blacklight.hu.yml +4 -4
- data/config/locales/blacklight.it.yml +3 -3
- data/config/locales/blacklight.nl.yml +3 -3
- data/config/locales/blacklight.pt-BR.yml +3 -3
- data/config/locales/blacklight.sq.yml +4 -4
- data/config/locales/blacklight.zh.yml +4 -4
- data/lib/blacklight/configuration/display_field.rb +1 -1
- data/lib/blacklight/configuration/fields.rb +3 -3
- data/lib/blacklight/configuration/view_config.rb +0 -2
- data/lib/blacklight/configuration.rb +7 -12
- data/lib/blacklight/engine.rb +0 -6
- data/lib/blacklight/open_struct_with_hash_access.rb +4 -4
- data/lib/blacklight/search_builder.rb +4 -4
- data/lib/blacklight/search_state/filter_field.rb +2 -2
- data/lib/blacklight/solr/request.rb +1 -7
- data/lib/blacklight/solr/response/group_response.rb +2 -2
- data/lib/blacklight.rb +1 -1
- data/lib/generators/blacklight/assets/importmap_generator.rb +8 -24
- data/lib/generators/blacklight/assets/propshaft_generator.rb +1 -1
- data/lib/generators/blacklight/assets_generator.rb +3 -3
- data/lib/generators/blacklight/controller_generator.rb +3 -3
- data/lib/generators/blacklight/user_generator.rb +9 -10
- data/package.json +14 -4
- data/rollup.config.js +1 -1
- data/spec/components/blacklight/document/action_component_spec.rb +1 -5
- data/spec/components/blacklight/document/sidebar_component_spec.rb +5 -20
- data/spec/components/blacklight/facet_field_checkboxes_component_spec.rb +2 -2
- data/spec/components/blacklight/facet_field_list_component_spec.rb +2 -2
- data/spec/components/blacklight/search/facet_suggest_input_spec.rb +2 -18
- data/spec/components/blacklight/search_bar_component_spec.rb +1 -1
- data/spec/controllers/catalog_controller_spec.rb +1 -1
- data/spec/features/axe_spec.rb +6 -11
- data/spec/features/bookmarks_spec.rb +48 -11
- data/spec/features/facets_spec.rb +21 -36
- data/spec/features/search_context_spec.rb +1 -2
- data/spec/features/search_filters_spec.rb +6 -6
- data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +0 -9
- data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +1 -1
- data/spec/lib/blacklight/parameters_spec.rb +1 -12
- data/spec/lib/blacklight/search_state/filter_field_spec.rb +0 -18
- data/spec/models/blacklight/solr/request_spec.rb +7 -0
- data/spec/services/blacklight/search_service_spec.rb +1 -1
- data/spec/test_app_templates/Gemfile.extra +0 -1
- data/spec/views/catalog/_facet_layout.html.erb_spec.rb +3 -3
- data/spec/views/catalog/index.html.erb_spec.rb +6 -3
- data/spec/views/catalog/show.html.erb_spec.rb +1 -0
- data/tasks/blacklight.rake +8 -5
- metadata +30 -54
- data/app/assets/stylesheets/blacklight/_autocomplete.scss +0 -25
- data/app/assets/stylesheets/blacklight/_mixins.scss +0 -20
- data/app/components/blacklight/icons/legacy_icon_component.rb +0 -30
- data/app/javascript/blacklight/index.js +0 -18
- data/app/views/catalog/_constraints.html.erb +0 -1
- data/app/views/catalog/_facets.html.erb +0 -5
- data/app/views/catalog/_search_form.html.erb +0 -7
- data/app/views/catalog/_search_header.html.erb +0 -1
- data/app/views/catalog/_show_sidebar.html.erb +0 -3
- data/app/views/catalog/_show_tools.html.erb +0 -2
- data/app/views/catalog/_start_over.html.erb +0 -1
- data/app/views/shared/_header_navbar.html.erb +0 -1
- data/lib/generators/blacklight/assets/sprockets_generator.rb +0 -68
- data/spec/views/catalog/_search_header.erb_spec.rb +0 -14
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +0 -24
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +0 -37
- /data/app/javascript/{blacklight → blacklight-frontend}/button_focus.js +0 -0
- /data/app/javascript/{blacklight → blacklight-frontend}/checkbox_submit.js +0 -0
- /data/app/javascript/{blacklight → blacklight-frontend}/modalForm.js +0 -0
- /data/app/javascript/{blacklight → blacklight-frontend}/search_context.js +0 -0
@@ -11,20 +11,6 @@ module Blacklight::RenderPartialsHelperBehavior
|
|
11
11
|
render_document_index_with_view(document_index_view_type, documents, locals)
|
12
12
|
end
|
13
13
|
|
14
|
-
##
|
15
|
-
# Return the list of partials for a given solr document
|
16
|
-
# @param [SolrDocument] doc solr document to render partials for
|
17
|
-
# @param [Array<String>] partials list of partials to render
|
18
|
-
# @param [Hash] locals local variables to pass to the render call
|
19
|
-
# @return [String]
|
20
|
-
def render_document_partials(doc, partials = [], locals = {})
|
21
|
-
safe_join(partials.map do |action_name|
|
22
|
-
render_document_partial(doc, action_name, locals)
|
23
|
-
end, "\n")
|
24
|
-
end
|
25
|
-
Blacklight.deprecation.deprecate_methods(self, render_document_partials: 'Replace this call with: "document_component = blacklight_config.view_config(:atom).summary_component
|
26
|
-
render document_component.new(presenter: document_presenter(document), component: :div, show: true)"')
|
27
|
-
|
28
14
|
##
|
29
15
|
# Return the list of xml for a given solr document. Doesn't safely escape for HTML.
|
30
16
|
# @param [SolrDocument] doc solr document to render partials for
|
@@ -114,6 +114,6 @@ module Blacklight::UrlHelperBehavior
|
|
114
114
|
# Use in e.g. the search history display, where we want something more like text instead of the normal constraints
|
115
115
|
def link_to_previous_search(params)
|
116
116
|
search_state = controller.search_state_class.new(params, blacklight_config, self)
|
117
|
-
link_to(render(Blacklight::ConstraintsComponent.for_search_history(search_state: search_state)), search_action_path(params))
|
117
|
+
link_to(render(Blacklight::ConstraintsComponent.for_search_history(search_state: search_state, classes: 'clearfix constraints-container mb-0')), search_action_path(params))
|
118
118
|
end
|
119
119
|
end
|
@@ -15,14 +15,6 @@ const Core = function() {
|
|
15
15
|
const listeners = [];
|
16
16
|
if (typeof Turbo !== 'undefined') {
|
17
17
|
listeners.push('turbo:load', 'turbo:frame-load');
|
18
|
-
} else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {
|
19
|
-
// Turbolinks 5
|
20
|
-
if (Turbolinks.BrowserAdapter) {
|
21
|
-
listeners.push('turbolinks:load');
|
22
|
-
} else {
|
23
|
-
// Turbolinks < 5
|
24
|
-
listeners.push('page:load', 'DOMContentLoaded');
|
25
|
-
}
|
26
18
|
} else {
|
27
19
|
listeners.push('DOMContentLoaded');
|
28
20
|
}
|
@@ -32,8 +24,8 @@ const Core = function() {
|
|
32
24
|
};
|
33
25
|
}();
|
34
26
|
|
35
|
-
//
|
36
|
-
// If app isn't using
|
27
|
+
// turbo triggers turbo:load events on page transition
|
28
|
+
// If app isn't using turbo, this event will never be triggered, no prob.
|
37
29
|
Core.listeners().forEach(function(listener) {
|
38
30
|
document.addEventListener(listener, function() {
|
39
31
|
Core.activate()
|
@@ -3,7 +3,7 @@
|
|
3
3
|
// const basicFunction = (entry) => console.log(entry)
|
4
4
|
// const debounced = debounce(basicFunction("I should only be called once"));
|
5
5
|
//
|
6
|
-
// debounced // does NOT print to the screen
|
6
|
+
// debounced // does NOT print to the screen becase it is invoked again less than 200 milliseconds later
|
7
7
|
// debounced // does print to the screen
|
8
8
|
// ```
|
9
9
|
export default function debounce(func, timeout = 200) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import debounce from "blacklight/debounce";
|
1
|
+
import debounce from "blacklight-frontend/debounce";
|
2
2
|
|
3
3
|
const FacetSuggest = async (e) => {
|
4
4
|
if (e.target.matches('.facet-suggest')) {
|
@@ -11,9 +11,9 @@ const FacetSuggest = async (e) => {
|
|
11
11
|
if (response.ok) {
|
12
12
|
const blob = await response.blob()
|
13
13
|
const text = await blob.text()
|
14
|
-
|
14
|
+
|
15
15
|
const facetArea = document.querySelector('.facet-extended-list');
|
16
|
-
|
16
|
+
|
17
17
|
if (text && facetArea) {
|
18
18
|
facetArea.innerHTML = text
|
19
19
|
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import BookmarkToggle from 'blacklight-frontend/bookmark_toggle'
|
2
|
+
import ButtonFocus from 'blacklight-frontend/button_focus'
|
3
|
+
import FacetSuggest from 'blacklight-frontend/facet_suggest'
|
4
|
+
import Modal from 'blacklight-frontend/modal'
|
5
|
+
import ModalForm from 'blacklight-frontend/modalForm'
|
6
|
+
import SearchContext from 'blacklight-frontend/search_context'
|
7
|
+
import Core from 'blacklight-frontend/core'
|
8
|
+
|
9
|
+
export default {
|
10
|
+
BookmarkToggle,
|
11
|
+
ButtonFocus,
|
12
|
+
FacetSuggest,
|
13
|
+
Modal,
|
14
|
+
ModalForm,
|
15
|
+
SearchContext,
|
16
|
+
Core,
|
17
|
+
onLoad: Core.onLoad
|
18
|
+
}
|
@@ -56,6 +56,9 @@
|
|
56
56
|
const Modal = (() => {
|
57
57
|
const modal = {}
|
58
58
|
|
59
|
+
// bootstrap class that will stop body scrolling when modal is open
|
60
|
+
const bootstrapBodyClassOpen = "modal-open";
|
61
|
+
|
59
62
|
// a Bootstrap modal div that should be already on the page hidden
|
60
63
|
modal.modalSelector = '#blacklight-modal';
|
61
64
|
|
@@ -110,7 +113,7 @@ const Modal = (() => {
|
|
110
113
|
}
|
111
114
|
elements.forEach((el) => frag.appendChild(el))
|
112
115
|
modal.activateScripts(frag)
|
113
|
-
|
116
|
+
|
114
117
|
modal.target().querySelector('.modal-content').replaceChildren(frag)
|
115
118
|
|
116
119
|
// send custom event with the modal dialog div as the target
|
@@ -119,7 +122,6 @@ const Modal = (() => {
|
|
119
122
|
|
120
123
|
// if they did preventDefault, don't show the dialog
|
121
124
|
if (e.defaultPrevented) return;
|
122
|
-
|
123
125
|
modal.show();
|
124
126
|
};
|
125
127
|
|
@@ -170,6 +172,12 @@ const Modal = (() => {
|
|
170
172
|
dom.dispatchEvent(e)
|
171
173
|
|
172
174
|
dom.close()
|
175
|
+
|
176
|
+
// Turn body scrolling back to what it was
|
177
|
+
document.body.style["overflow"] = modal.originalBodyOverflow;
|
178
|
+
document.body.style["padding-right"] = modal.originalBodyPaddingRight;
|
179
|
+
modal.originalBodyOverflow = undefined;
|
180
|
+
modal.originalBodyPaddingRight = undefined;
|
173
181
|
}
|
174
182
|
|
175
183
|
modal.show = function(el) {
|
@@ -181,6 +189,12 @@ const Modal = (() => {
|
|
181
189
|
dom.dispatchEvent(e)
|
182
190
|
|
183
191
|
dom.showModal()
|
192
|
+
|
193
|
+
// Turn off body scrolling
|
194
|
+
modal.originalBodyOverflow = document.body.style['overflow'];
|
195
|
+
modal.originalBodyPaddingRight = document.body.style['padding-right'];
|
196
|
+
document.body.style["overflow"] = "hidden"
|
197
|
+
document.body.style["padding-right"] = "0px"
|
184
198
|
}
|
185
199
|
|
186
200
|
modal.target = function() {
|
@@ -31,17 +31,6 @@ module Blacklight::Document
|
|
31
31
|
class_attribute :inspector_fields, default: [:_source]
|
32
32
|
end
|
33
33
|
|
34
|
-
Email = Module.new do
|
35
|
-
def self.included(mod)
|
36
|
-
Blacklight.deprecation.warn("Blacklight::Document::Email is deprecated and will be removed (included in #{mod}).")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
Sms = Module.new do
|
40
|
-
def self.included(mod)
|
41
|
-
Blacklight.deprecation.warn("Blacklight::Document::Sms is deprecated and will be removed (included in #{mod}).")
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
34
|
attr_reader :response, :_source
|
46
35
|
alias_method :solr_response, :response
|
47
36
|
|
@@ -5,7 +5,7 @@ module Blacklight::User
|
|
5
5
|
# SEE ALSO: The lib/blacklight/generator/user_generator.rb class for where this
|
6
6
|
# is generated into the hosting application.
|
7
7
|
included do
|
8
|
-
class_attribute :string_display_key
|
8
|
+
class_attribute :string_display_key, default: :email
|
9
9
|
|
10
10
|
has_many :bookmarks, dependent: :destroy, as: :user
|
11
11
|
has_many :searches, dependent: :destroy, as: :user
|
@@ -13,7 +13,9 @@ module Blacklight
|
|
13
13
|
|
14
14
|
delegate :facet_field_names, :facet_configuration_for_field, to: :blacklight_config
|
15
15
|
|
16
|
-
|
16
|
+
def documents
|
17
|
+
@response.documents
|
18
|
+
end
|
17
19
|
|
18
20
|
# @return [Array<Blacklight::Solr::Response::Facets::FacetField>]
|
19
21
|
def search_facets
|
@@ -21,7 +21,6 @@ module Blacklight
|
|
21
21
|
params.with_indifferent_access
|
22
22
|
end
|
23
23
|
|
24
|
-
# rubocop:disable Security/YAMLLoad
|
25
24
|
if YAML.respond_to?(:unsafe_load)
|
26
25
|
def self.yaml_load(payload)
|
27
26
|
if ActiveRecord.try(:use_yaml_unsafe_load) || ActiveRecord::Base.try(:use_yaml_unsafe_load)
|
@@ -43,6 +42,5 @@ module Blacklight
|
|
43
42
|
end
|
44
43
|
end
|
45
44
|
end
|
46
|
-
# rubocop:enable Security/YAMLLoad
|
47
45
|
end
|
48
46
|
end
|
@@ -1,7 +1,5 @@
|
|
1
1
|
<%= link_to t('blacklight.bookmarks.clear.action_title'), clear_bookmarks_path,
|
2
|
-
method: :delete, # for rails-UJS
|
3
2
|
data: {
|
4
|
-
confirm: t('blacklight.bookmarks.clear.action_confirm'), # for rails-UJS
|
5
3
|
turbo_method: :delete,
|
6
4
|
turbo_confirm: t('blacklight.bookmarks.clear.action_confirm')
|
7
5
|
},
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<% else %>
|
14
14
|
<%= render 'sort_and_per_page' %>
|
15
15
|
<%= render partial: 'tools', locals: { document_list: @response.documents } %>
|
16
|
-
<h2 class='section-heading
|
16
|
+
<h2 class='section-heading visually-hidden'><%= t('blacklight.bookmarks.list_title') %></h2>
|
17
17
|
<%= render_document_index @response.documents %>
|
18
18
|
<%= render 'results_pagination' %>
|
19
19
|
<% end %>
|
@@ -1,7 +1,4 @@
|
|
1
1
|
<% if show_pagination? and @response.total_pages > 1 %>
|
2
|
-
|
3
|
-
|
4
|
-
<%= render Blacklight::Response::PaginationComponent.new(response: @response) %>
|
5
|
-
</div>
|
6
|
-
</div>
|
2
|
+
<%= render Blacklight::Response::PaginationComponent.new(response: @response,
|
3
|
+
classes: 'paginate-section mt-2') %>
|
7
4
|
<% end %>
|
@@ -8,17 +8,17 @@
|
|
8
8
|
<% end %>
|
9
9
|
|
10
10
|
<% content_for(:skip_links) do -%>
|
11
|
-
|
11
|
+
<%= render Blacklight::SkipLinkItemComponent.new(text: t('blacklight.skip_links.first_result'), href: '#documents') %>
|
12
12
|
<% end %>
|
13
13
|
|
14
14
|
<% content_for(:container_header) do -%>
|
15
15
|
<%= render 'search_results_header' %>
|
16
|
-
<%= render
|
16
|
+
<%= render blacklight_config.view_config(document_index_view_type).constraints_component.new(search_state: search_state) %>
|
17
17
|
<% end %>
|
18
18
|
|
19
|
-
<%= render
|
19
|
+
<%= render blacklight_config.view_config(document_index_view_type).search_header_component.new %>
|
20
20
|
|
21
|
-
<h2 class="
|
21
|
+
<h2 class="visually-hidden"><%= t('blacklight.search.search_results') %></h2>
|
22
22
|
|
23
23
|
<%- if @response.empty? %>
|
24
24
|
<%= render "zero_results" %>
|
@@ -1 +1 @@
|
|
1
|
-
<h1 class="
|
1
|
+
<h1 class="visually-hidden top-content-title"><%= t('blacklight.search.header') %></h1>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div id="sortAndPerPage" class="sort-pagination d-md-flex justify-content-between" role="navigation" aria-label="<%= t('blacklight.search.per_page.aria_label')%>">
|
1
|
+
<div id="sortAndPerPage" class="sort-pagination pb-3 d-md-flex justify-content-between" role="navigation" aria-label="<%= t('blacklight.search.per_page.aria_label')%>">
|
2
2
|
<%= render partial: "paginate_compact", object: @response if show_pagination? %>
|
3
3
|
<%= render_results_collection_tools wrapping_class: "search-widgets" %>
|
4
4
|
</div>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<% if show_sort_and_per_page? %>
|
2
2
|
<%= render(Blacklight::Response::SortComponent.new(
|
3
3
|
choices: active_sort_fields.map { |key, config| [sort_field_label(config.key), key] },
|
4
|
+
classes: ['mx-1'],
|
4
5
|
search_state: search_state,
|
5
6
|
selected: current_sort_field&.key)) %>
|
6
7
|
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= render Blacklight::System::ModalComponent.new do |component| %>
|
2
2
|
<% component.with_prefix do %>
|
3
|
-
<div class="facet-pagination top
|
3
|
+
<div class="facet-pagination top d-flex w-100 justify-content-between">
|
4
4
|
<%= render :partial=>'facet_pagination' %>
|
5
5
|
</div>
|
6
6
|
<% end %>
|
@@ -1,7 +1,6 @@
|
|
1
1
|
<%= render 'show_main_content' %>
|
2
2
|
|
3
3
|
<% content_for(:sidebar) do %>
|
4
|
-
<%
|
5
|
-
|
6
|
-
<% end %>
|
4
|
+
<% presenter = document_presenter(@document) %>
|
5
|
+
<%= render presenter.view_config.sidebar_component.new(presenter: presenter) %>
|
7
6
|
<% end %>
|
@@ -11,7 +11,6 @@
|
|
11
11
|
<%= paginator.render do -%>
|
12
12
|
<ul class="pagination">
|
13
13
|
<%= prev_page_tag %>
|
14
|
-
<%= next_page_tag if Blacklight::Engine.config.blacklight.paginator[:next_button_position] == :before %>
|
15
14
|
<% each_relevant_page do |page| -%>
|
16
15
|
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
|
17
16
|
<%= page_tag page %>
|
@@ -19,6 +18,6 @@
|
|
19
18
|
<%= gap_tag %>
|
20
19
|
<% end -%>
|
21
20
|
<% end -%>
|
22
|
-
<%= next_page_tag
|
21
|
+
<%= next_page_tag %>
|
23
22
|
</ul>
|
24
23
|
<% end -%>
|
@@ -12,15 +12,11 @@
|
|
12
12
|
<%= opensearch_description_tag application_name, opensearch_catalog_url(format: 'xml') %>
|
13
13
|
<%= favicon_link_tag %>
|
14
14
|
<%= stylesheet_link_tag "application", media: "all", "data-turbo-track": "reload" %>
|
15
|
+
|
15
16
|
<% if defined? Importmap %>
|
16
17
|
<%= javascript_importmap_tags %>
|
17
|
-
<% elsif defined? Propshaft %>
|
18
|
-
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
|
19
18
|
<% else %>
|
20
19
|
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
|
21
|
-
<script type="module">
|
22
|
-
import githubAutoCompleteElement from 'https://cdn.skypack.dev/@github/auto-complete-element';
|
23
|
-
</script>
|
24
20
|
<% end %>
|
25
21
|
|
26
22
|
<%= csrf_meta_tags %>
|
@@ -31,9 +27,9 @@
|
|
31
27
|
<%= content_for(:skip_links) %>
|
32
28
|
<% end %>
|
33
29
|
|
34
|
-
<%= render
|
30
|
+
<%= render blacklight_config.header_component.new(blacklight_config: blacklight_config) %>
|
35
31
|
|
36
|
-
<main id="main-container" class="<%= container_classes %>"
|
32
|
+
<main id="main-container" class="<%= container_classes %>" aria-label="<%= t('blacklight.main.aria.main_container') %>">
|
37
33
|
<%= content_for(:container_header) %>
|
38
34
|
|
39
35
|
<%= render partial: 'shared/flash_msg', layout: 'shared/flash_messages' %>
|
@@ -7,9 +7,7 @@
|
|
7
7
|
<% else %>
|
8
8
|
<%= link_to t('blacklight.search_history.clear.action_title'),
|
9
9
|
blacklight.clear_search_history_path,
|
10
|
-
method: :delete, # for rails-ujs
|
11
10
|
data: {
|
12
|
-
confirm: t('blacklight.search_history.clear.action_confirm'), # for rails-ujs
|
13
11
|
turbo_confirm: t('blacklight.search_history.clear.action_confirm'),
|
14
12
|
turbo_method: :delete
|
15
13
|
},
|
data/blacklight.gemspec
CHANGED
@@ -23,19 +23,19 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
s.require_paths = ["lib"]
|
25
25
|
|
26
|
-
s.required_ruby_version = '>=
|
26
|
+
s.required_ruby_version = '>= 3.1'
|
27
27
|
|
28
|
-
s.add_dependency "rails", '>=
|
28
|
+
s.add_dependency "rails", '>= 7.0', '< 9'
|
29
29
|
s.add_dependency "globalid"
|
30
30
|
s.add_dependency "jbuilder", '~> 2.7'
|
31
31
|
s.add_dependency "kaminari", ">= 0.15" # the pagination (page 1,2,3, etc..) of our search results
|
32
32
|
s.add_dependency "i18n", '>= 1.7.0' # added named parameters
|
33
33
|
s.add_dependency "ostruct", '>= 0.3.2'
|
34
|
-
s.add_dependency "view_component", '
|
34
|
+
s.add_dependency "view_component", '~> 3.9'
|
35
35
|
s.add_dependency "zeitwerk"
|
36
36
|
|
37
37
|
s.add_development_dependency "rsolr", ">= 1.0.6", "< 3" # Library for interacting with rSolr.
|
38
|
-
s.add_development_dependency "rspec-rails", "
|
38
|
+
s.add_development_dependency "rspec-rails", "~> 7.0"
|
39
39
|
s.add_development_dependency "rspec-collection_matchers", ">= 1.0"
|
40
40
|
s.add_development_dependency 'axe-core-rspec'
|
41
41
|
s.add_development_dependency "capybara", '~> 3'
|
data/config/importmap.rb
CHANGED
@@ -102,7 +102,7 @@ ar:
|
|
102
102
|
close: إخفاء الأوجه
|
103
103
|
open: عرض الأوجه
|
104
104
|
missing: "[غير موجود]"
|
105
|
-
more_html: المزيد <span class="
|
105
|
+
more_html: المزيد <span class="visually-hidden">%{field_name}</span> »
|
106
106
|
pivot:
|
107
107
|
hide: إغلاق
|
108
108
|
show: فتح
|
@@ -112,8 +112,8 @@ ar:
|
|
112
112
|
count: ترتيب رقمي
|
113
113
|
index: ترتيب أبجدي
|
114
114
|
suggest:
|
115
|
-
label:
|
116
|
-
placeholder:
|
115
|
+
label: Filter %{field_label}
|
116
|
+
placeholder: Filter...
|
117
117
|
title: تحديد نطاق البحث
|
118
118
|
filters:
|
119
119
|
label: "%{label}:"
|
@@ -155,7 +155,7 @@ ar:
|
|
155
155
|
aria_label: تصفح النتائج
|
156
156
|
button_label: "%{count} لكل صفحة"
|
157
157
|
button_label_html: '%{count}<span class="d-none d-sm-inline"> لكل صفحة</span>'
|
158
|
-
label: '%{count}<span class="
|
158
|
+
label: '%{count}<span class="visually-hidden"> لكل صفحة</span>'
|
159
159
|
submit: تحديث
|
160
160
|
title: عدد النتائج المعروضة في الصفحة
|
161
161
|
rss_feed: خلاصات RSS للنتائج
|