blacklight 7.17.2 → 7.19.2
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/VERSION +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +1 -2
- data/app/assets/stylesheets/blacklight/_balanced_list.scss +2 -2
- data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +1 -1
- data/app/assets/stylesheets/blacklight/_constraints.scss +2 -2
- data/app/assets/stylesheets/blacklight/_controls.scss +2 -1
- data/app/assets/stylesheets/blacklight/_facets.scss +3 -1
- data/app/assets/stylesheets/blacklight/_header.scss +6 -1
- data/app/components/blacklight/constraint_layout_component.html.erb +1 -1
- data/app/components/blacklight/constraints_component.html.erb +2 -2
- data/app/components/blacklight/content_areas_shim.rb +2 -1
- data/app/components/blacklight/document/thumbnail_component.html.erb +3 -3
- data/app/components/blacklight/document/thumbnail_component.rb +11 -3
- data/app/components/blacklight/document_component.rb +7 -7
- data/app/components/blacklight/facet_field_component.html.erb +3 -1
- data/app/components/blacklight/facet_field_no_layout_component.rb +1 -1
- 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/metadata_field_layout_component.rb +1 -1
- data/app/components/blacklight/response/facet_group_component.html.erb +2 -0
- data/app/components/blacklight/response/view_type_component.html.erb +1 -1
- data/app/components/blacklight/search_bar_component.html.erb +3 -3
- data/app/components/blacklight/system/dropdown_component.rb +1 -1
- data/app/components/blacklight/system/flash_message_component.html.erb +1 -1
- data/app/components/blacklight/system/modal_component.html.erb +1 -1
- data/app/helpers/blacklight/component_helper_behavior.rb +1 -1
- data/app/helpers/blacklight/render_partials_helper_behavior.rb +5 -1
- data/app/javascript/blacklight/modal.js +1 -1
- data/app/views/blacklight/nav/_bookmark.html.erb +1 -1
- data/app/views/bookmarks/index.html.erb +1 -1
- data/app/views/catalog/_constraints.html.erb +2 -2
- data/app/views/catalog/_document.html.erb +4 -3
- data/app/views/catalog/_document_list.html.erb +3 -2
- data/app/views/catalog/_home_text.html.erb +1 -1
- data/app/views/catalog/_per_page_widget.html.erb +1 -1
- data/app/views/catalog/_search_results.html.erb +2 -2
- data/app/views/search_history/index.html.erb +1 -1
- data/app/views/shared/_header_navbar.html.erb +1 -1
- data/config/locales/blacklight.ar.yml +2 -2
- data/config/locales/blacklight.ca.yml +2 -2
- data/config/locales/blacklight.de.yml +2 -2
- data/config/locales/blacklight.en.yml +2 -2
- data/config/locales/blacklight.es.yml +2 -2
- data/config/locales/blacklight.fr.yml +2 -2
- data/config/locales/blacklight.hu.yml +2 -2
- data/config/locales/blacklight.it.yml +2 -2
- data/config/locales/blacklight.nl.yml +2 -2
- data/config/locales/blacklight.pt-BR.yml +1 -1
- data/config/locales/blacklight.sq.yml +2 -2
- data/config/locales/blacklight.zh.yml +2 -2
- data/lib/blacklight/configuration.rb +7 -1
- data/lib/blacklight/configuration/view_config.rb +3 -1
- data/lib/blacklight/nested_open_struct_with_hash_access.rb +33 -14
- data/lib/blacklight/open_struct_with_hash_access.rb +1 -1
- data/lib/blacklight/search_builder.rb +1 -0
- data/lib/blacklight/solr/request.rb +10 -7
- data/lib/blacklight/solr/search_builder_behavior.rb +28 -16
- data/lib/generators/blacklight/install_generator.rb +5 -5
- data/lib/generators/blacklight/solr_generator.rb +4 -2
- data/lib/generators/blacklight/user_generator.rb +4 -2
- data/spec/components/blacklight/constraint_layout_component_spec.rb +3 -7
- data/spec/components/blacklight/facet_field_checkboxes_component_spec.rb +3 -7
- data/spec/components/blacklight/facet_field_list_component_spec.rb +3 -7
- data/spec/components/blacklight/facet_item_component_spec.rb +2 -6
- data/spec/components/blacklight/facet_item_pivot_component_spec.rb +3 -7
- data/spec/components/blacklight/hidden_search_state_component_spec.rb +7 -8
- data/spec/components/blacklight/metadata_field_component_spec.rb +4 -8
- data/spec/features/facets_spec.rb +2 -2
- data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +9 -10
- data/spec/helpers/blacklight_helper_spec.rb +20 -2
- data/spec/helpers/catalog_helper_spec.rb +1 -1
- data/spec/lib/blacklight/nested_open_struct_with_hash_access_spec.rb +36 -0
- data/spec/models/blacklight/configuration_spec.rb +10 -0
- data/spec/models/blacklight/solr/request_spec.rb +0 -1
- data/spec/models/blacklight/solr/search_builder_spec.rb +23 -1
- data/spec/services/blacklight/search_service_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/support/view_component_capybara_test_helpers.rb +8 -0
- data/spec/views/catalog/_constraints.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_document.html.erb_spec.rb +9 -0
- data/spec/views/catalog/_document_list.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_facet_layout.html.erb_spec.rb +2 -2
- data/spec/views/catalog/_view_type_group.html.erb_spec.rb +5 -5
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9f48da02e969e0c163d09760d711066ce9c0b4d5078636c8f50e19699ec58e8e
|
|
4
|
+
data.tar.gz: 77da2b86854e93f08a79ba9e28c86c7c91116b9f6934229eb6936cc6872bfdc6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a42155551ab05fa25e433a7aad6e40078ce7cbc2918de03f6ede94aef53ade03b4b16f4411a915b737b1233a631d9cb2baddc9d560aa70b67df237776c01e7f6
|
|
7
|
+
data.tar.gz: 6430192899c4db45277e988217aecc04e954d856645941773176e36ecefd3ddda3c2a9988caffb7bde50f8aa76702a10cd00da67216f17c6fb49a2802a678dfe
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
7.
|
|
1
|
+
7.19.2
|
|
@@ -352,7 +352,7 @@ Blacklight.modal.modalCloseSelector = '[data-blacklight-modal~=close]'; // Calle
|
|
|
352
352
|
|
|
353
353
|
Blacklight.modal.onFailure = function (jqXHR, textStatus, errorThrown) {
|
|
354
354
|
console.error('Server error:', this.url, jqXHR.status, errorThrown);
|
|
355
|
-
var contents = '<div class="modal-header">' + '<div class="modal-title">There was a problem with your request.</div>' + '<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="Close">' + ' <span aria-hidden="true">×</span>' + '</button></div>' + ' <div class="modal-body"><p>Expected a successful response from the server, but got an error</p>' + '<pre>' + this.type + ' ' + this.url + "\n" + jqXHR.status + ': ' + errorThrown + '</pre></div>';
|
|
355
|
+
var contents = '<div class="modal-header">' + '<div class="modal-title">There was a problem with your request.</div>' + '<button type="button" class="blacklight-modal-close btn-close close" data-dismiss="modal" aria-label="Close">' + ' <span aria-hidden="true">×</span>' + '</button></div>' + ' <div class="modal-body"><p>Expected a successful response from the server, but got an error</p>' + '<pre>' + this.type + ' ' + this.url + "\n" + jqXHR.status + ': ' + errorThrown + '</pre></div>';
|
|
356
356
|
$(Blacklight.modal.modalSelector).find('.modal-content').html(contents);
|
|
357
357
|
$(Blacklight.modal.modalSelector).modal('show');
|
|
358
358
|
};
|
|
@@ -495,4 +495,3 @@ Blacklight.handleSearchContextMethod = function (event) {
|
|
|
495
495
|
Blacklight.onLoad(function () {
|
|
496
496
|
Blacklight.doSearchContextBehavior();
|
|
497
497
|
});
|
|
498
|
-
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
dt {
|
|
3
3
|
font-weight: normal;
|
|
4
4
|
color: $field_name_color;
|
|
5
|
-
@media (max-width: breakpoint-
|
|
5
|
+
@media (max-width: breakpoint-min(md)) {
|
|
6
6
|
text-align: left;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
@media (min-width: breakpoint-
|
|
9
|
+
@media (min-width: breakpoint-min(md)) {
|
|
10
10
|
text-align: right;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
text-overflow: ellipsis;
|
|
9
9
|
overflow: hidden;
|
|
10
10
|
|
|
11
|
-
@media (max-width: breakpoint-
|
|
12
|
-
max-width: breakpoint-
|
|
11
|
+
@media (max-width: breakpoint-min(sm)) {
|
|
12
|
+
max-width: breakpoint-min(sm) / 2;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
@media (min-width: breakpoint-min(sm)) and (max-width: breakpoint-max(sm)) {
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
border-color: $navbar-light-toggler-border-color;
|
|
4
4
|
color: $navbar-light-active-color;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
&:hover,
|
|
7
|
+
&:focus {
|
|
7
8
|
color: $navbar-light-active-color;
|
|
8
9
|
}
|
|
9
10
|
}
|
|
@@ -83,6 +84,7 @@
|
|
|
83
84
|
color: $text-muted;
|
|
84
85
|
font-weight: bold;
|
|
85
86
|
padding-left: $spacer / 2;
|
|
87
|
+
text-decoration: none;
|
|
86
88
|
|
|
87
89
|
&:hover {
|
|
88
90
|
color: theme-color("danger");
|
|
@@ -44,7 +44,12 @@
|
|
|
44
44
|
.submit-search-text {
|
|
45
45
|
// hide 'search' label at very small screens
|
|
46
46
|
@media screen and (max-width: breakpoint-max(xs)) {
|
|
47
|
-
@
|
|
47
|
+
@if mixin-exists(sr-only) {
|
|
48
|
+
@include sr-only();
|
|
49
|
+
}
|
|
50
|
+
@if mixin-exists(visually-hidden) {
|
|
51
|
+
@include visually-hidden();
|
|
52
|
+
}
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
55
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<% if @remove_path.present? %>
|
|
11
11
|
<%= link_to(@remove_path, class: 'btn btn-outline-secondary remove') do %>
|
|
12
12
|
<span class="remove-icon" aria-hidden="true">✖</span>
|
|
13
|
-
<span class="sr-only">
|
|
13
|
+
<span class="sr-only visually-hidden">
|
|
14
14
|
<%= if @label.blank?
|
|
15
15
|
t('blacklight.search.filters.remove.value', value: @value)
|
|
16
16
|
else
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<%= content_tag :div, id: @id, class: @classes do %>
|
|
2
|
-
<h2 class="sr-only"><%= t('blacklight.search.search_constraints_header') %></h2>
|
|
2
|
+
<h2 class="sr-only visually-hidden"><%= t('blacklight.search.search_constraints_header') %></h2>
|
|
3
3
|
|
|
4
4
|
<%= link_to t('blacklight.search.start_over'), start_over_path, class: "catalog_startOverLink btn btn-primary" %>
|
|
5
5
|
|
|
6
|
-
<span class="constraints-label sr-only"><%= t('blacklight.search.filters.title') %></span>
|
|
6
|
+
<span class="constraints-label sr-only visually-hidden"><%= t('blacklight.search.filters.title') %></span>
|
|
7
7
|
<% if query_constraints_area.present? %>
|
|
8
8
|
<% query_constraints_area.each do |constraint| %>
|
|
9
9
|
<%= constraint %>
|
|
@@ -5,7 +5,8 @@ module Blacklight
|
|
|
5
5
|
module ContentAreasShim
|
|
6
6
|
# Shim the `with` helper to write content into slots instead
|
|
7
7
|
def with(slot_name, *args, **kwargs, &block)
|
|
8
|
-
Deprecation.warn(
|
|
8
|
+
Deprecation.warn(Blacklight::ContentAreasShim,
|
|
9
|
+
'ViewComponents deprecated `with` and it will be removed in ViewComponents 3.0. content_areas. Use slots (https://viewcomponent.org/guide/slots.html) instead.')
|
|
9
10
|
public_send(slot_name, *args, **kwargs, &block)
|
|
10
11
|
end
|
|
11
12
|
end
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<% value =
|
|
1
|
+
<% value = use_thumbnail_tag_behavior? ? presenter.thumbnail.thumbnail_tag(@image_options, 'aria-hidden': true, tabindex: -1, counter: @counter) : presenter.thumbnail.render(@image_options) %>
|
|
2
2
|
|
|
3
3
|
<% if value %>
|
|
4
4
|
<div class="document-thumbnail">
|
|
5
|
-
<% if
|
|
5
|
+
<% if use_thumbnail_tag_behavior? %>
|
|
6
6
|
<% warn_about_deprecated_behavior %>
|
|
7
7
|
<%= value %>
|
|
8
8
|
<% else %>
|
|
9
|
-
<%= helpers.link_to_document(
|
|
9
|
+
<%= helpers.link_to_document(presenter.document, value, 'aria-hidden': true, tabindex: -1, counter: @counter) %>
|
|
10
10
|
<% end %>
|
|
11
11
|
</div>
|
|
12
12
|
<% end %>
|
|
@@ -9,20 +9,28 @@ module Blacklight
|
|
|
9
9
|
# @param [Blacklight::DocumentPresenter] presenter
|
|
10
10
|
# @param [Integer] counter
|
|
11
11
|
# @param [Hash] image_options options for the thumbnail presenter's image tag
|
|
12
|
-
def initialize(presenter
|
|
12
|
+
def initialize(presenter: nil, document: nil, counter:, image_options: {})
|
|
13
13
|
@presenter = presenter
|
|
14
|
+
@document = presenter&.document || document
|
|
14
15
|
@counter = counter
|
|
15
16
|
@image_options = { alt: '' }.merge(image_options)
|
|
16
|
-
@use_thumbnail_tag = !@presenter.thumbnail.instance_of?(Blacklight::ThumbnailPresenter)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def render?
|
|
20
|
-
|
|
20
|
+
presenter.thumbnail.exists?
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def use_thumbnail_tag_behavior?
|
|
24
|
+
!presenter.thumbnail.instance_of?(Blacklight::ThumbnailPresenter)
|
|
21
25
|
end
|
|
22
26
|
|
|
23
27
|
def warn_about_deprecated_behavior
|
|
24
28
|
Deprecation.warn(Blacklight::Document::ThumbnailComponent, 'Detected as custom thumbnail presenter; make sure it has a #render method that returns just the thumbnail image tag')
|
|
25
29
|
end
|
|
30
|
+
|
|
31
|
+
def presenter
|
|
32
|
+
@presenter ||= @view_context.document_presenter(@document)
|
|
33
|
+
end
|
|
26
34
|
end
|
|
27
35
|
end
|
|
28
36
|
end
|
|
@@ -25,7 +25,7 @@ module Blacklight
|
|
|
25
25
|
next static_content if static_content.present?
|
|
26
26
|
next unless component
|
|
27
27
|
|
|
28
|
-
Deprecation.warn('Pass the presenter to the DocumentComponent') if @presenter.nil?
|
|
28
|
+
Deprecation.warn(Blacklight::DocumentComponent, 'Pass the presenter to the DocumentComponent') if @presenter.nil?
|
|
29
29
|
|
|
30
30
|
component.new(*args, document: @document, presenter: @presenter, document_counter: @document_counter, **kwargs)
|
|
31
31
|
end)
|
|
@@ -34,7 +34,7 @@ module Blacklight
|
|
|
34
34
|
renders_one :metadata, (lambda do |static_content = nil, *args, component: nil, fields: nil, **kwargs|
|
|
35
35
|
next static_content if static_content.present?
|
|
36
36
|
|
|
37
|
-
Deprecation.warn('Pass the presenter to the DocumentComponent') if !fields && @presenter.nil?
|
|
37
|
+
Deprecation.warn(Blacklight::DocumentComponent, 'Pass the presenter to the DocumentComponent') if !fields && @presenter.nil?
|
|
38
38
|
|
|
39
39
|
component ||= Blacklight::DocumentMetadataComponent
|
|
40
40
|
|
|
@@ -48,9 +48,9 @@ module Blacklight
|
|
|
48
48
|
next image_options_or_static_content if image_options_or_static_content.is_a? String
|
|
49
49
|
|
|
50
50
|
component ||= @presenter&.view_config&.thumbnail_component || Blacklight::Document::ThumbnailComponent
|
|
51
|
-
Deprecation.warn('Pass the presenter to the DocumentComponent') if !component && @presenter.nil?
|
|
51
|
+
Deprecation.warn(Blacklight::DocumentComponent, 'Pass the presenter to the DocumentComponent') if !component && @presenter.nil?
|
|
52
52
|
|
|
53
|
-
component.new(*args, presenter: @presenter, counter: @counter, image_options: image_options_or_static_content, **kwargs)
|
|
53
|
+
component.new(*args, document: @document, presenter: @presenter, counter: @counter, image_options: image_options_or_static_content, **kwargs)
|
|
54
54
|
end)
|
|
55
55
|
|
|
56
56
|
# A container for partials rendered using the view config partials configuration. Its use is discouraged, but necessary until
|
|
@@ -93,13 +93,13 @@ module Blacklight
|
|
|
93
93
|
@id = id || ('document' if show)
|
|
94
94
|
@classes = classes
|
|
95
95
|
|
|
96
|
-
Deprecation.warn('Passing embed_component is deprecated') if @embed_component.present?
|
|
96
|
+
Deprecation.warn(Blacklight::DocumentComponent, 'Passing embed_component is deprecated') if @embed_component.present?
|
|
97
97
|
@embed_component = embed_component
|
|
98
98
|
|
|
99
|
-
Deprecation.warn('Passing metadata_component is deprecated') if @metadata_component.present?
|
|
99
|
+
Deprecation.warn(Blacklight::DocumentComponent, 'Passing metadata_component is deprecated') if @metadata_component.present?
|
|
100
100
|
@metadata_component = metadata_component || Blacklight::DocumentMetadataComponent
|
|
101
101
|
|
|
102
|
-
Deprecation.warn('Passing thumbnail_component is deprecated') if @thumbnail_component.present?
|
|
102
|
+
Deprecation.warn(Blacklight::DocumentComponent, 'Passing thumbnail_component is deprecated') if @thumbnail_component.present?
|
|
103
103
|
@thumbnail_component = thumbnail_component || Blacklight::Document::ThumbnailComponent
|
|
104
104
|
|
|
105
105
|
@document_counter = document_counter
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
<h3 class="card-header p-0 facet-field-heading" id="<%= @facet_field.html_id %>-header">
|
|
3
3
|
<button
|
|
4
4
|
type="button"
|
|
5
|
-
class="btn btn-block p-2 text-left collapse-toggle <%= "collapsed" if @facet_field.collapsed? %>"
|
|
5
|
+
class="btn w-100 d-block btn-block p-2 text-start text-left collapse-toggle <%= "collapsed" if @facet_field.collapsed? %>"
|
|
6
6
|
data-toggle="collapse"
|
|
7
|
+
data-bs-toggle="collapse"
|
|
7
8
|
data-target="#<%= @facet_field.html_id %>"
|
|
9
|
+
data-bs-target="#<%= @facet_field.html_id %>"
|
|
8
10
|
aria-expanded="<%= @facet_field.collapsed? ? 'false' : 'true' %>"
|
|
9
11
|
>
|
|
10
12
|
<%= label %>
|
|
@@ -27,7 +27,7 @@ module Blacklight
|
|
|
27
27
|
render_facet_value
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
return if content.blank?
|
|
30
|
+
return '' if content.blank?
|
|
31
31
|
return content unless @wrapping_element
|
|
32
32
|
|
|
33
33
|
content_tag @wrapping_element, content
|
|
@@ -87,7 +87,7 @@ module Blacklight
|
|
|
87
87
|
# remove link
|
|
88
88
|
link_to(@href, class: "remove") do
|
|
89
89
|
tag.span('✖', class: "remove-icon", aria: { hidden: true }) +
|
|
90
|
-
tag.span(@view_context.t(:'blacklight.search.facets.selected.remove'), class: 'sr-only')
|
|
90
|
+
tag.span(@view_context.t(:'blacklight.search.facets.selected.remove'), class: 'sr-only visually-hidden')
|
|
91
91
|
end
|
|
92
92
|
end + render_facet_count(classes: ["selected"])
|
|
93
93
|
end
|
|
@@ -56,7 +56,7 @@ module Blacklight
|
|
|
56
56
|
|
|
57
57
|
def facet_toggle_button(id)
|
|
58
58
|
content_tag 'button', class: 'btn facet-toggle-handle collapsed',
|
|
59
|
-
data: { toggle: 'collapse', target: "##{id}" },
|
|
59
|
+
data: { toggle: 'collapse', 'bs-toggle': 'collapse', target: "##{id}", 'bs-target': "##{id}" },
|
|
60
60
|
aria: { expanded: false, controls: id, describedby: "#{id}_label" } do
|
|
61
61
|
concat toggle_icon(:show)
|
|
62
62
|
concat toggle_icon(:hide)
|
|
@@ -66,7 +66,7 @@ module Blacklight
|
|
|
66
66
|
def toggle_icon(type)
|
|
67
67
|
content_tag 'span', class: type do
|
|
68
68
|
concat @icons[type]
|
|
69
|
-
concat content_tag('span', t(type, scope: 'blacklight.search.facets.pivot'), class: 'sr-only')
|
|
69
|
+
concat content_tag('span', t(type, scope: 'blacklight.search.facets.pivot'), class: 'sr-only visually-hidden')
|
|
70
70
|
end
|
|
71
71
|
end
|
|
72
72
|
|
|
@@ -25,7 +25,7 @@ module Blacklight
|
|
|
25
25
|
def value(*args, **kwargs, &block)
|
|
26
26
|
return set_slot(:values, *args, **kwargs, &block) if block_given?
|
|
27
27
|
|
|
28
|
-
Deprecation.warn('The `value` content area is deprecated; render from the values slot instead')
|
|
28
|
+
Deprecation.warn(Blacklight::MetadataFieldLayoutComponent, 'The `value` content area is deprecated; render from the values slot instead')
|
|
29
29
|
|
|
30
30
|
values.first
|
|
31
31
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%= form_tag @url, method: @method, class: @classes.join(' '), role: 'search', 'aria-label' => scoped_t('submit') do %>
|
|
2
2
|
<%= render_hash_as_hidden_fields(@params) %>
|
|
3
3
|
<% if @search_fields.length > 1 %>
|
|
4
|
-
<label for="search_field" class="sr-only"><%= scoped_t('search_field.label') %></label>
|
|
4
|
+
<label for="search_field" class="sr-only visually-hidden"><%= scoped_t('search_field.label') %></label>
|
|
5
5
|
<% end %>
|
|
6
6
|
<div class="input-group">
|
|
7
7
|
<%= prepend %>
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
options_for_select(@search_fields, h(@search_field)),
|
|
12
12
|
title: scoped_t('search_field.title'),
|
|
13
13
|
id: "#{@prefix}search_field",
|
|
14
|
-
class: "custom-select search-field") %>
|
|
14
|
+
class: "custom-select form-select search-field") %>
|
|
15
15
|
<% elsif @search_fields.length == 1 %>
|
|
16
16
|
<%= hidden_field_tag :search_field, @search_fields.first.last %>
|
|
17
17
|
<% end %>
|
|
18
18
|
|
|
19
|
-
<label for="<%= @prefix %><%= @query_param %>" class="sr-only"><%= scoped_t('search.label') %></label>
|
|
19
|
+
<label for="<%= @prefix %><%= @query_param %>" class="sr-only visually-hidden"><%= scoped_t('search.label') %></label>
|
|
20
20
|
<%= text_field_tag @query_param, @q, placeholder: scoped_t('search.placeholder'), class: "search-q q form-control rounded-#{@search_fields.length > 1 ? '0' : 'left'}", id: "#{@prefix}q", autocomplete: autocomplete_path.present? ? "off" : "", autofocus: @autofocus, data: { autocomplete_enabled: autocomplete_path.present?, autocomplete_path: autocomplete_path } %>
|
|
21
21
|
|
|
22
22
|
<span class="input-group-append">
|
|
@@ -4,7 +4,7 @@ module Blacklight
|
|
|
4
4
|
module System
|
|
5
5
|
class DropdownComponent < ViewComponent::Base
|
|
6
6
|
renders_one :button, (lambda do |classes:, label:|
|
|
7
|
-
button_tag class: classes, aria: { expanded: false }, data: { toggle: 'dropdown' } do
|
|
7
|
+
button_tag class: classes, aria: { expanded: false }, data: { toggle: 'dropdown', 'bs-toggle': 'dropdown' } do
|
|
8
8
|
safe_join([label, content_tag(:span, '', class: 'caret')])
|
|
9
9
|
end
|
|
10
10
|
end)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<h1 class="modal-title"><%= title %></h1>
|
|
7
7
|
<% end) %>
|
|
8
8
|
|
|
9
|
-
<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
|
|
9
|
+
<button type="button" class="blacklight-modal-close btn-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
|
|
10
10
|
<span aria-hidden="true">×</span>
|
|
11
11
|
</button>
|
|
12
12
|
</div>
|
|
@@ -14,7 +14,7 @@ module Blacklight
|
|
|
14
14
|
if action_opts.path
|
|
15
15
|
send(action_opts.path, url_opts)
|
|
16
16
|
elsif url_opts[:id].class.respond_to?(:model_name)
|
|
17
|
-
url_for([action_opts.key, url_opts[:id]])
|
|
17
|
+
url_for([action_opts.key.to_sym, url_opts[:id]])
|
|
18
18
|
else
|
|
19
19
|
send("#{action_opts.key}_#{controller_name}_path", url_opts)
|
|
20
20
|
end
|
|
@@ -84,12 +84,16 @@ module Blacklight::RenderPartialsHelperBehavior
|
|
|
84
84
|
# @param [Hash] locals to pass to the render call
|
|
85
85
|
# @return [String]
|
|
86
86
|
def render_document_index_with_view view, documents, locals = {}
|
|
87
|
+
view_config = blacklight_config&.view_config(view)
|
|
88
|
+
|
|
89
|
+
return render partial: view_config.template, locals: locals.merge(documents: documents, view_config: view_config) if view_config&.template
|
|
90
|
+
|
|
87
91
|
template = cached_view ['index', view].join('_') do
|
|
88
92
|
find_document_index_template_with_view(view, locals)
|
|
89
93
|
end
|
|
90
94
|
|
|
91
95
|
if template
|
|
92
|
-
template.render(self, locals.merge(documents: documents))
|
|
96
|
+
template.render(self, locals.merge(documents: documents, view_config: view_config))
|
|
93
97
|
else
|
|
94
98
|
''
|
|
95
99
|
end
|
|
@@ -106,7 +106,7 @@ Blacklight.modal.onFailure = function(jqXHR, textStatus, errorThrown) {
|
|
|
106
106
|
|
|
107
107
|
var contents = '<div class="modal-header">' +
|
|
108
108
|
'<div class="modal-title">There was a problem with your request.</div>' +
|
|
109
|
-
'<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="Close">' +
|
|
109
|
+
'<button type="button" class="blacklight-modal-close btn-close close" data-dismiss="modal" aria-label="Close">' +
|
|
110
110
|
' <span aria-hidden="true">×</span>' +
|
|
111
111
|
'</button></div>' +
|
|
112
112
|
' <div class="modal-body"><p>Expected a successful response from the server, but got an error</p>' +
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<%= link_to bookmarks_path, id:'bookmarks_nav', class: 'nav-link' do %>
|
|
2
2
|
<%= t('blacklight.header_links.bookmarks') %>
|
|
3
|
-
<span class="badge badge-secondary" data-role='bookmark-counter'><%= current_or_guest_user.bookmarks.count %></span>
|
|
3
|
+
<span class="badge badge-secondary bg-secondary" data-role='bookmark-counter'><%= current_or_guest_user.bookmarks.count %></span>
|
|
4
4
|
<% end %>
|
|
@@ -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 sr-only'><%= t('blacklight.bookmarks.list_title') %></h2>
|
|
16
|
+
<h2 class='section-heading sr-only visually-hidden'><%= t('blacklight.bookmarks.list_title') %></h2>
|
|
17
17
|
<%= render_document_index %>
|
|
18
18
|
<%= render 'results_pagination' %>
|
|
19
19
|
<% end %>
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
<% Deprecation.warn(Blacklight::RenderConstraintsHelperBehavior, 'Constraints helpers or partials were overridden; not using components') %>
|
|
5
5
|
<% if Deprecation.silence(Blacklight::RenderConstraintsHelperBehavior) { query_has_constraints? } %>
|
|
6
6
|
<div id="appliedParams" class="clearfix constraints-container">
|
|
7
|
-
<h2 class="sr-only"><%= t('blacklight.search.search_constraints_header') %></h2>
|
|
7
|
+
<h2 class="sr-only visually-hidden"><%= t('blacklight.search.search_constraints_header') %></h2>
|
|
8
8
|
|
|
9
9
|
<%= render 'start_over' %>
|
|
10
|
-
<span class="constraints-label sr-only"><%= t('blacklight.search.filters.title') %></span>
|
|
10
|
+
<span class="constraints-label sr-only visually-hidden"><%= t('blacklight.search.filters.title') %></span>
|
|
11
11
|
<%= render_constraints(controller.params != params ? params : search_state) %>
|
|
12
12
|
</div>
|
|
13
13
|
<% end %>
|