blacklight 8.2.2 → 8.4.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 +1 -1
- data/.github/workflows/ruby.yml +60 -62
- data/.rubocop.yml +229 -21
- data/.rubocop_todo.yml +22 -55
- data/Gemfile +2 -10
- data/README.md +2 -2
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/blacklight.esm.js +5 -1
- data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +5 -1
- data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
- data/app/assets/stylesheets/blacklight/_balanced_list.scss +1 -1
- data/app/assets/stylesheets/blacklight/_bookmark.scss +30 -0
- data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +0 -4
- data/app/assets/stylesheets/blacklight/_constraints.scss +15 -9
- data/app/assets/stylesheets/blacklight/_controls.scss +0 -1
- data/app/assets/stylesheets/blacklight/_facets.scss +33 -37
- data/app/assets/stylesheets/blacklight/_header.scss +2 -35
- data/app/assets/stylesheets/blacklight/_icons.scss +3 -2
- data/app/assets/stylesheets/blacklight/_layout.scss +3 -0
- data/app/assets/stylesheets/blacklight/_mixins.scss +6 -21
- data/app/assets/stylesheets/blacklight/_search_form.scss +3 -8
- data/app/assets/stylesheets/blacklight/_search_history.scss +5 -5
- data/app/assets/stylesheets/blacklight/_search_results.scss +5 -2
- data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +16 -10
- data/app/components/blacklight/advanced_search_form_component.html.erb +1 -1
- data/app/components/blacklight/advanced_search_form_component.rb +6 -0
- data/app/components/blacklight/constraint_layout_component.html.erb +2 -9
- data/app/components/blacklight/constraint_layout_component.rb +8 -0
- data/app/components/blacklight/constraints_component.rb +3 -3
- data/app/components/blacklight/document/action_component.rb +2 -1
- data/app/components/blacklight/document/bookmark_component.html.erb +2 -1
- data/app/components/blacklight/document/bookmark_component.rb +6 -0
- data/app/components/blacklight/document/page_header_component.html.erb +7 -0
- data/app/components/blacklight/document/page_header_component.rb +85 -0
- data/app/components/blacklight/document_component.rb +1 -1
- data/app/components/blacklight/facet_component.rb +1 -1
- data/app/components/blacklight/facet_field_checkboxes_component.html.erb +1 -1
- data/app/components/blacklight/facet_field_checkboxes_component.rb +1 -1
- data/app/components/blacklight/facet_field_inclusive_constraint_component.html.erb +1 -1
- data/app/components/blacklight/facet_field_list_component.html.erb +1 -1
- data/app/components/blacklight/facet_item_component.rb +1 -1
- data/app/components/blacklight/facet_item_pivot_component.rb +2 -2
- data/app/components/blacklight/icons/bookmark_icon_component.rb +17 -0
- data/app/components/blacklight/icons/icon_component.rb +9 -4
- data/app/components/blacklight/icons/remove_component.rb +16 -0
- data/app/components/blacklight/metadata_field_component.html.erb +1 -1
- data/app/components/blacklight/metadata_field_component.rb +5 -0
- data/app/components/blacklight/response/facet_group_component.rb +1 -1
- data/app/components/blacklight/response/pagination_component.html.erb +1 -1
- data/app/components/blacklight/response/sort_component.html.erb +1 -6
- data/app/components/blacklight/response/sort_component.rb +15 -0
- data/app/components/blacklight/search/per_page_component.html.erb +2 -0
- data/app/components/blacklight/search/per_page_component.rb +50 -0
- data/app/components/blacklight/search_bar_component.html.erb +1 -1
- data/app/components/blacklight/search_context/server_item_pagination_component.html.erb +4 -7
- data/app/components/blacklight/skip_link_component.html.erb +7 -0
- data/app/components/blacklight/skip_link_component.rb +17 -0
- data/app/components/blacklight/system/dropdown_button_component.rb +18 -0
- data/app/components/blacklight/system/dropdown_component.rb +4 -7
- data/app/components/blacklight/system/flash_message_component.html.erb +1 -1
- data/app/components/blacklight/top_navbar_component.html.erb +2 -2
- data/app/components/blacklight/top_navbar_component.rb +4 -0
- data/app/helpers/blacklight/catalog_helper_behavior.rb +3 -5
- data/app/helpers/blacklight/component_helper_behavior.rb +4 -4
- data/app/helpers/blacklight/configuration_helper_behavior.rb +2 -0
- data/app/helpers/blacklight/layout_helper_behavior.rb +3 -3
- data/app/javascript/blacklight/checkbox_submit.js +5 -1
- data/app/models/concerns/blacklight/document/semantic_fields.rb +1 -1
- data/app/presenters/blacklight/facet_checkbox_item_presenter.rb +11 -0
- data/app/presenters/blacklight/facet_field_presenter.rb +9 -1
- data/app/services/blacklight/search_service.rb +9 -1
- data/app/views/catalog/_per_page_widget.html.erb +1 -10
- data/app/views/catalog/_search_results.html.erb +1 -1
- data/app/views/catalog/_show_main_content.html.erb +1 -1
- data/app/views/catalog/show.html.erb +0 -2
- data/app/views/catalog/suggest.html.erb +1 -1
- data/app/views/kaminari/blacklight/_page.html.erb +14 -8
- data/app/views/layouts/blacklight/base.html.erb +3 -4
- data/app/views/shared/_flash_messages.html.erb +1 -1
- data/blacklight.gemspec +4 -0
- data/{docker-compose.yml → compose.yaml} +1 -1
- data/config/locales/blacklight.ar.yml +3 -0
- data/config/locales/blacklight.de.yml +3 -0
- data/config/locales/blacklight.en.yml +216 -229
- data/config/locales/blacklight.es.yml +3 -0
- data/config/locales/blacklight.fr.yml +3 -0
- data/config/locales/blacklight.hu.yml +3 -0
- data/config/locales/blacklight.it.yml +3 -0
- data/config/locales/blacklight.nl.yml +3 -0
- data/config/locales/blacklight.pt-BR.yml +3 -0
- data/config/locales/blacklight.sq.yml +3 -0
- data/config/locales/blacklight.zh.yml +3 -0
- data/lib/blacklight/abstract_repository.rb +6 -0
- data/lib/blacklight/configuration.rb +33 -19
- data/lib/blacklight/nested_open_struct_with_hash_access.rb +2 -2
- data/lib/blacklight/parameters.rb +1 -1
- data/lib/blacklight/solr/repository.rb +11 -4
- data/lib/blacklight/solr/request.rb +1 -1
- data/lib/blacklight/solr/response/facets.rb +1 -1
- data/lib/blacklight/solr/response/params.rb +1 -1
- data/lib/blacklight/solr/response.rb +0 -12
- data/lib/blacklight/solr/search_builder_behavior.rb +2 -2
- data/lib/blacklight/solr.rb +0 -6
- data/lib/blacklight.rb +4 -14
- data/lib/generators/blacklight/assets/propshaft_generator.rb +2 -2
- data/lib/generators/blacklight/models_generator.rb +1 -1
- data/package.json +1 -1
- data/spec/components/blacklight/advanced_search_form_component_spec.rb +2 -2
- data/spec/components/blacklight/constraint_layout_component_spec.rb +11 -11
- data/spec/components/blacklight/constraints_component_spec.rb +9 -9
- data/spec/components/blacklight/document/action_component_spec.rb +1 -1
- data/spec/components/blacklight/document/group_component_spec.rb +3 -3
- data/spec/components/blacklight/document/page_header_component_spec.rb +92 -0
- data/spec/components/blacklight/document/sidebar_component_spec.rb +3 -4
- data/spec/components/blacklight/document_component_spec.rb +41 -25
- data/spec/components/blacklight/facet_component_spec.rb +2 -2
- data/spec/components/blacklight/facet_field_checkboxes_component_spec.rb +5 -5
- data/spec/components/blacklight/facet_field_list_component_spec.rb +13 -13
- data/spec/components/blacklight/facet_item_component_spec.rb +5 -5
- data/spec/components/blacklight/facet_item_pivot_component_spec.rb +6 -6
- data/spec/components/blacklight/header_component_spec.rb +1 -2
- data/spec/components/blacklight/hidden_search_state_component_spec.rb +6 -6
- data/spec/components/blacklight/icons/icon_component_spec.rb +42 -0
- data/spec/components/blacklight/metadata_field_component_spec.rb +3 -3
- data/spec/components/blacklight/response/pagination_component_spec.rb +4 -4
- data/spec/components/blacklight/search_context/server_applied_params_component_spec.rb +1 -1
- data/spec/components/blacklight/search_context/server_item_pagination_component_spec.rb +2 -4
- data/spec/components/blacklight/system/flash_message_component_spec.rb +5 -5
- data/spec/controllers/blacklight/catalog_spec.rb +2 -2
- data/spec/controllers/blacklight/{catalog/component_configuration_spec.rb → configurable_spec.rb} +1 -1
- data/spec/controllers/bookmarks_controller_spec.rb +10 -10
- data/spec/controllers/catalog_controller_spec.rb +29 -31
- data/spec/features/advanced_search_spec.rb +30 -16
- data/spec/features/alternate_controller_spec.rb +9 -9
- data/spec/features/axe_spec.rb +4 -4
- data/spec/features/bookmarks_spec.rb +34 -19
- data/spec/features/citation_spec.rb +1 -1
- data/spec/features/did_you_mean_spec.rb +23 -23
- data/spec/features/facet_missing_spec.rb +9 -9
- data/spec/features/facets_spec.rb +21 -20
- data/spec/features/modal_spec.rb +4 -4
- data/spec/features/record_view_spec.rb +2 -2
- data/spec/features/search_context_spec.rb +6 -6
- data/spec/features/search_crawler_spec.rb +5 -5
- data/spec/features/search_filters_spec.rb +65 -65
- data/spec/features/search_history_spec.rb +12 -12
- data/spec/features/search_pagination_spec.rb +10 -10
- data/spec/features/search_results_spec.rb +1 -1
- data/spec/features/search_sort_spec.rb +4 -4
- data/spec/features/search_spec.rb +25 -25
- data/spec/features/sitelinks_search_box_spec.rb +2 -2
- data/spec/features/sms_spec.rb +1 -1
- data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +2 -2
- data/spec/helpers/blacklight/layout_helper_behavior_spec.rb +20 -3
- data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +2 -1
- data/spec/helpers/blacklight/url_helper_behavior_spec.rb +7 -8
- data/spec/helpers/blacklight_helper_spec.rb +13 -15
- data/spec/helpers/catalog_helper_spec.rb +3 -6
- data/spec/i18n_spec.rb +2 -1
- data/spec/lib/blacklight/nested_open_struct_with_hash_access_spec.rb +1 -1
- data/spec/lib/blacklight/open_struct_with_hash_access_spec.rb +1 -1
- data/spec/lib/blacklight/search_state_spec.rb +4 -4
- data/spec/lib/tasks/blacklight_task_spec.rb +2 -1
- data/spec/models/blacklight/configurable_spec.rb +1 -1
- data/spec/models/blacklight/configuration/context_spec.rb +1 -1
- data/spec/models/blacklight/configuration_spec.rb +14 -14
- data/spec/models/blacklight/document/active_model_shim_spec.rb +1 -1
- data/spec/models/blacklight/document/cache_key_spec.rb +1 -1
- data/spec/models/blacklight/document_spec.rb +1 -1
- data/spec/models/blacklight/facet_paginator_spec.rb +14 -14
- data/spec/models/blacklight/icon_spec.rb +1 -1
- data/spec/models/blacklight/search_builder_spec.rb +1 -1
- data/spec/models/blacklight/solr/document_spec.rb +3 -3
- data/spec/models/blacklight/solr/facet_paginator_spec.rb +1 -1
- data/spec/models/blacklight/solr/repository_spec.rb +33 -15
- data/spec/models/blacklight/solr/request_spec.rb +1 -1
- data/spec/models/blacklight/solr/response/facets_spec.rb +3 -3
- data/spec/models/blacklight/solr/response/group_response_spec.rb +1 -1
- data/spec/models/blacklight/solr/response/group_spec.rb +2 -2
- data/spec/models/blacklight/solr/response_spec.rb +3 -3
- data/spec/models/blacklight/solr/{search_builder_spec.rb → search_builder_behavior_spec.rb} +10 -20
- data/spec/models/blacklight/suggest/response_spec.rb +1 -1
- data/spec/models/blacklight/suggest_search_spec.rb +1 -1
- data/spec/models/blacklight/user_spec.rb +1 -1
- data/spec/models/bookmark_spec.rb +1 -1
- data/spec/models/solr_document_spec.rb +1 -1
- data/spec/presenters/blacklight/document_presenter_spec.rb +3 -4
- data/spec/presenters/blacklight/facet_checkbox_item_presenter_spec.rb +42 -0
- data/spec/presenters/blacklight/facet_field_presenter_spec.rb +14 -0
- data/spec/presenters/blacklight/field_presenter_spec.rb +1 -1
- data/spec/presenters/blacklight/index_presenter_spec.rb +2 -3
- data/spec/presenters/blacklight/json_presenter_spec.rb +1 -1
- data/spec/presenters/{pipeline_spec.rb → blacklight/rendering/pipeline_spec.rb} +1 -1
- data/spec/presenters/blacklight/show_presenter_spec.rb +5 -6
- data/spec/presenters/{thumbnail_presenter_spec.rb → blacklight/thumbnail_presenter_spec.rb} +5 -3
- data/spec/requests/load_suggestions_spec.rb +5 -5
- data/spec/routing/catalog_routing_spec.rb +1 -1
- data/spec/services/blacklight/field_retriever_spec.rb +1 -1
- data/spec/services/blacklight/search_service_spec.rb +11 -11
- data/spec/spec_helper.rb +2 -2
- data/spec/support/features/search_helpers.rb +2 -2
- data/spec/support/features/session_helpers.rb +3 -3
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +3 -3
- data/spec/views/catalog/_document.html.erb_spec.rb +1 -4
- data/spec/views/catalog/_document_list.html.erb_spec.rb +2 -2
- data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +5 -6
- data/spec/views/catalog/_facet_layout.html.erb_spec.rb +7 -7
- data/spec/views/catalog/_paginate_compact.html.erb_spec.rb +4 -4
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +1 -4
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +1 -2
- data/spec/views/catalog/_view_type_group.html.erb_spec.rb +7 -7
- data/spec/views/catalog/email_success.html.erb_spec.rb +1 -1
- data/spec/views/catalog/facet.html.erb_spec.rb +1 -1
- data/spec/views/catalog/facet.json.jbuilder_spec.rb +1 -1
- data/spec/views/catalog/index.atom.builder_spec.rb +18 -19
- data/spec/views/catalog/index.html.erb_spec.rb +2 -4
- data/spec/views/catalog/index.json.jbuilder_spec.rb +5 -8
- data/spec/views/catalog/show.html.erb_spec.rb +3 -5
- data/spec/views/catalog/show.json.jbuilder_spec.rb +1 -2
- data/spec/views/catalog/sms_success.html.erb_spec.rb +1 -1
- data/spec/views/shared/_user_util_links.html.erb_spec.rb +2 -3
- data/tasks/blacklight.rake +5 -5
- metadata +84 -12
@@ -15,24 +15,25 @@
|
|
15
15
|
white-space: nowrap;
|
16
16
|
|
17
17
|
@media (max-width: breakpoint-min(sm)) {
|
18
|
-
max-width: breakpoint-min(sm) * .5;
|
18
|
+
max-width: breakpoint-min(sm) * 0.5;
|
19
19
|
}
|
20
20
|
|
21
21
|
@media (min-width: breakpoint-min(sm)) and (max-width: breakpoint-max(sm)) {
|
22
|
-
max-width: breakpoint-min(sm) * .5;
|
22
|
+
max-width: breakpoint-min(sm) * 0.5;
|
23
23
|
}
|
24
24
|
|
25
25
|
@media (min-width: breakpoint-min(md)) and (max-width: breakpoint-max(md)) {
|
26
|
-
max-width: breakpoint-min(md) * .5;
|
26
|
+
max-width: breakpoint-min(md) * 0.5;
|
27
27
|
}
|
28
28
|
|
29
29
|
@media (min-width: breakpoint-min(lg)) {
|
30
|
-
max-width: breakpoint-min(lg) * .5;
|
30
|
+
max-width: breakpoint-min(lg) * 0.5;
|
31
31
|
}
|
32
32
|
|
33
|
-
&:hover,
|
34
|
-
|
35
|
-
|
33
|
+
&:hover,
|
34
|
+
&:active {
|
35
|
+
background-color: $secondary;
|
36
|
+
border-color: $secondary;
|
36
37
|
box-shadow: none;
|
37
38
|
}
|
38
39
|
}
|
@@ -44,7 +45,12 @@
|
|
44
45
|
padding-left: $caret-width;
|
45
46
|
}
|
46
47
|
|
47
|
-
.remove
|
48
|
-
|
48
|
+
.remove {
|
49
|
+
--bs-btn-hover-bg: var(--bl-constraint-remove-hover-bg);
|
50
|
+
--bs-btn-hover-border-color: var(--bl-constraint-remove-hover-border-color);
|
51
|
+
--bs-btn-active-bg: var(--bl-constraint-remove-hover-bg);
|
52
|
+
--bs-btn-active-border-color: var(
|
53
|
+
--bl-constraint-remove-hover-border-color
|
54
|
+
);
|
49
55
|
}
|
50
56
|
}
|
@@ -1,6 +1,14 @@
|
|
1
1
|
.sidenav {
|
2
|
-
--bl-
|
3
|
-
--bl-
|
2
|
+
--bl-facet-active-bg: #{$facet-active-bg};
|
3
|
+
--bl-facet-active-item-color: #{$facet-active-item-color};
|
4
|
+
--bl-facet-margin-bottom: #{$spacer};
|
5
|
+
--bl-facet-remove-color: var(--bs-secondary-color);
|
6
|
+
|
7
|
+
--bl-facet-limit-body-padding: #{$spacer};
|
8
|
+
|
9
|
+
--bl-facets-smallish-padding: 0.25rem;
|
10
|
+
--bl-facets-smallish-border: var(--bs-border-width) solid
|
11
|
+
var(--bs-border-color);
|
4
12
|
--bl-facets-smallish-margin-bottom: #{$spacer};
|
5
13
|
--bl-facets-smallish-border-radius: #{$border-radius};
|
6
14
|
|
@@ -39,14 +47,12 @@
|
|
39
47
|
$next: breakpoint-next($breakpoint, $grid-breakpoints);
|
40
48
|
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
41
49
|
|
42
|
-
|
43
50
|
&#{$infix} {
|
44
51
|
@include media-breakpoint-down($next) {
|
45
52
|
border: var(--bl-facets-smallish-border);
|
46
53
|
padding: var(--bl-facets-smallish-padding);
|
47
54
|
margin-bottom: var(--bl-facets-smallish-margin-bottom);
|
48
55
|
border-radius: var(--bl-facets-smallish-border-radius);
|
49
|
-
|
50
56
|
}
|
51
57
|
@include media-breakpoint-up($next) {
|
52
58
|
// scss-lint:disable ImportantRule
|
@@ -101,18 +107,18 @@
|
|
101
107
|
}
|
102
108
|
|
103
109
|
.facet-limit {
|
104
|
-
margin-bottom:
|
110
|
+
margin-bottom: var(--bl-facet-margin-bottom);
|
105
111
|
|
106
112
|
.card-body {
|
107
|
-
padding:
|
113
|
+
padding: var(--bl-facet-limit-body-padding);
|
108
114
|
}
|
109
115
|
}
|
110
116
|
|
111
117
|
.facet-limit-active {
|
112
|
-
border-color: $facet-active-border
|
118
|
+
border-color: $facet-active-border;
|
113
119
|
|
114
120
|
.card-header {
|
115
|
-
background-color:
|
121
|
+
background-color: var(--bl-facet-active-bg);
|
116
122
|
|
117
123
|
.btn {
|
118
124
|
@if function-exists(color-contrast) {
|
@@ -143,38 +149,32 @@
|
|
143
149
|
}
|
144
150
|
|
145
151
|
.selected {
|
146
|
-
color:
|
152
|
+
color: var(--bl-facet-active-item-color);
|
147
153
|
}
|
148
154
|
}
|
149
155
|
|
150
156
|
.remove {
|
151
|
-
color:
|
157
|
+
color: var(--bl-facet-remove-color);
|
152
158
|
font-weight: bold;
|
153
|
-
padding-left: $spacer * .5;
|
159
|
+
padding-left: $spacer * 0.5;
|
154
160
|
text-decoration: none;
|
155
161
|
|
156
162
|
&:hover {
|
157
|
-
color:
|
163
|
+
color: $danger;
|
158
164
|
text-decoration: none;
|
159
165
|
}
|
160
166
|
}
|
161
167
|
|
162
|
-
@mixin hyphens-auto {
|
163
|
-
overflow-wrap: break-word;
|
164
|
-
-webkit-hyphens: auto;
|
165
|
-
-o-hyphens: auto;
|
166
|
-
hyphens: auto;
|
167
|
-
}
|
168
|
-
|
169
168
|
.facet-label {
|
169
|
+
hyphens: auto;
|
170
|
+
overflow-wrap: break-word;
|
171
|
+
padding-left: 15px;
|
170
172
|
padding-right: 1em;
|
171
173
|
text-indent: -15px;
|
172
|
-
padding-left: 15px;
|
173
|
-
@include hyphens-auto;
|
174
174
|
}
|
175
175
|
|
176
176
|
.facet-count {
|
177
|
-
margin-left: auto
|
177
|
+
margin-left: auto;
|
178
178
|
}
|
179
179
|
|
180
180
|
.facet-checkbox {
|
@@ -200,7 +200,7 @@
|
|
200
200
|
}
|
201
201
|
|
202
202
|
/* This prevents the contained stretch link from covering the panel body */
|
203
|
-
position: relative
|
203
|
+
position: relative;
|
204
204
|
}
|
205
205
|
|
206
206
|
/* Sidenav
|
@@ -212,15 +212,9 @@
|
|
212
212
|
}
|
213
213
|
}
|
214
214
|
|
215
|
-
/* style for pivot facet's nested list */
|
216
|
-
|
217
|
-
.facet-values {
|
218
|
-
@extend .list-unstyled;
|
219
|
-
}
|
220
|
-
|
221
215
|
.pivot-facet {
|
222
216
|
&.show {
|
223
|
-
|
217
|
+
display: flex;
|
224
218
|
}
|
225
219
|
}
|
226
220
|
|
@@ -230,16 +224,16 @@ $facet-toggle-width: 1em !default;
|
|
230
224
|
$facet-toggle-height: $facet-toggle-width !default;
|
231
225
|
|
232
226
|
.facet-toggle-handle {
|
233
|
-
|
234
|
-
|
235
|
-
|
227
|
+
margin-block: 0;
|
228
|
+
padding-block: 0;
|
229
|
+
padding-inline: 0.5rem;
|
236
230
|
|
237
231
|
// keep the icon span centered in the button, but shift to the left for equal spacing inside row
|
238
|
-
margin-
|
232
|
+
margin-inline-start: -1 * $btn-padding-x;
|
239
233
|
|
240
234
|
.pivot-facet & {
|
241
235
|
// shift pivot values a little more aggressively for better compact display
|
242
|
-
margin-
|
236
|
+
margin-inline-start: -2 * $btn-padding-x;
|
243
237
|
}
|
244
238
|
|
245
239
|
&.collapsed {
|
@@ -268,10 +262,12 @@ $facet-toggle-height: $facet-toggle-width !default;
|
|
268
262
|
}
|
269
263
|
|
270
264
|
.show .icon {
|
271
|
-
background: transparent escape-svg($facet-toggle-show-icon) center /
|
265
|
+
background: transparent escape-svg($facet-toggle-show-icon) center /
|
266
|
+
$facet-toggle-width auto no-repeat;
|
272
267
|
}
|
273
268
|
|
274
269
|
.hide .icon {
|
275
|
-
background: transparent escape-svg($facet-toggle-hide-icon) center /
|
270
|
+
background: transparent escape-svg($facet-toggle-hide-icon) center /
|
271
|
+
$facet-toggle-width auto no-repeat;
|
276
272
|
}
|
277
273
|
}
|
@@ -2,14 +2,8 @@
|
|
2
2
|
Header bar at top (Bootstrap nav-bar)
|
3
3
|
*/
|
4
4
|
|
5
|
-
.
|
6
|
-
|
7
|
-
margin-left: 0;
|
8
|
-
margin-right: 0;
|
9
|
-
}
|
10
|
-
}
|
11
|
-
|
12
|
-
.navbar-logo { /* The main logo image for the Blacklight instance */
|
5
|
+
.navbar-logo {
|
6
|
+
/* The main logo image for the Blacklight instance */
|
13
7
|
@if $logo-image {
|
14
8
|
background: transparent $logo-image no-repeat top left;
|
15
9
|
background-size: $logo-width $logo-height;
|
@@ -36,32 +30,5 @@
|
|
36
30
|
.search-query-form {
|
37
31
|
@extend .col-md-12;
|
38
32
|
@extend .col-lg-8;
|
39
|
-
padding-left: 0;
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
#skip-link {
|
44
|
-
position: absolute;
|
45
|
-
top: 5px;
|
46
|
-
left: 10px;
|
47
|
-
z-index: 1;
|
48
|
-
|
49
|
-
.element-invisible {
|
50
|
-
position: absolute !important;
|
51
|
-
clip: rect(1px, 1px, 1px, 1px);
|
52
|
-
overflow: hidden;
|
53
|
-
height: 1px;
|
54
|
-
}
|
55
|
-
|
56
|
-
.element-invisible.element-focusable:active,
|
57
|
-
.element-invisible.element-focusable:focus {
|
58
|
-
position: static !important;
|
59
|
-
clip: auto;
|
60
|
-
overflow: visible;
|
61
|
-
height: auto;
|
62
|
-
}
|
63
|
-
|
64
|
-
a:focus {
|
65
|
-
background-color: $white;
|
66
33
|
}
|
67
34
|
}
|
@@ -1,32 +1,17 @@
|
|
1
|
-
// Stroke contrast
|
2
|
-
// Ripped off from https://github.com/twbs/bootstrap/commit/c31d52499811d5c68d122db806ce27a112b489bd
|
3
|
-
@mixin fill-yiq($color) {
|
4
|
-
$r: red($color);
|
5
|
-
$g: green($color);
|
6
|
-
$b: blue($color);
|
7
|
-
|
8
|
-
$yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
|
9
|
-
|
10
|
-
@if ($yiq >= 150) {
|
11
|
-
fill: #111;
|
12
|
-
} @else {
|
13
|
-
fill: #fff;
|
14
|
-
}
|
15
|
-
}
|
16
|
-
|
17
1
|
// define a visually-hidden class that applies to a given breakpoint and below
|
18
2
|
// https://getbootstrap.com/docs/5.3/helpers/visually-hidden/
|
19
3
|
@if mixin-exists(visually-hidden) {
|
20
|
-
@each $
|
21
|
-
.visually-hidden-#{$
|
4
|
+
@each $breakpoint in map-keys($grid-breakpoints) {
|
5
|
+
.visually-hidden-#{$breakpoint} {
|
22
6
|
@include media-breakpoint-down($breakpoint) {
|
23
7
|
@include visually-hidden;
|
24
8
|
}
|
25
9
|
}
|
26
10
|
}
|
27
|
-
} @else if mixin-exists(sr-only) {
|
28
|
-
|
29
|
-
|
11
|
+
} @else if mixin-exists(sr-only) {
|
12
|
+
// Bootstrap 4 version
|
13
|
+
@each $breakpoint in map-keys($grid-breakpoints) {
|
14
|
+
.visually-hidden-#{$breakpoint} {
|
30
15
|
@include media-breakpoint-down($breakpoint) {
|
31
16
|
@include sr-only;
|
32
17
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// bootstrap does flex-grow: 1 by default which makes the
|
2
2
|
// text input roughly the same size as the select in many cases
|
3
|
-
.input-group
|
3
|
+
.input-group > .search-q {
|
4
4
|
flex-grow: 4;
|
5
5
|
}
|
6
6
|
|
@@ -10,20 +10,15 @@
|
|
10
10
|
flex-grow: 4;
|
11
11
|
padding: 0;
|
12
12
|
position: relative;
|
13
|
-
|
13
|
+
|
14
14
|
.search-q {
|
15
15
|
border: 0;
|
16
16
|
height: 100%;
|
17
17
|
width: 100%;
|
18
18
|
}
|
19
|
-
|
19
|
+
|
20
20
|
ul {
|
21
|
-
@extend .dropdown-menu;
|
22
21
|
display: block;
|
23
|
-
|
24
|
-
li {
|
25
|
-
@extend .dropdown-item;
|
26
|
-
}
|
27
22
|
}
|
28
23
|
}
|
29
24
|
|
@@ -1,8 +1,9 @@
|
|
1
1
|
/* Search History */
|
2
2
|
.search-history {
|
3
|
+
--bl-history-filter-name-color: var(--bs-secondary-color);
|
3
4
|
|
4
5
|
td {
|
5
|
-
padding: $spacer
|
6
|
+
padding: $spacer;
|
6
7
|
}
|
7
8
|
|
8
9
|
.constraints-container {
|
@@ -10,12 +11,11 @@
|
|
10
11
|
}
|
11
12
|
|
12
13
|
.constraint {
|
13
|
-
|
14
|
+
padding-inline-end: $spacer;
|
14
15
|
display: block;
|
15
|
-
text-indent: -1 * map-get($spacers, 3);
|
16
16
|
}
|
17
17
|
|
18
|
-
.filter-name
|
19
|
-
|
18
|
+
.filter-name {
|
19
|
+
color: var(--bl-history-filter-name-color);
|
20
20
|
}
|
21
21
|
}
|
@@ -1,10 +1,13 @@
|
|
1
1
|
// the search results on the index view of the catalog
|
2
2
|
.documents-list {
|
3
|
+
--bl-results-document-margin-top: #{$spacer};
|
4
|
+
--bl-results-document-padding-top: #{$spacer};
|
5
|
+
|
3
6
|
.document {
|
4
7
|
display: flex;
|
5
8
|
border-bottom: 1px dotted $table-border-color;
|
6
|
-
margin-top:
|
7
|
-
padding-top:
|
9
|
+
margin-top: var(--bl-results-document-margin-top);
|
10
|
+
padding-top: var(--bl-results-document-padding-top);
|
8
11
|
|
9
12
|
.document-title-heading {
|
10
13
|
@extend h5;
|
@@ -1,17 +1,23 @@
|
|
1
1
|
/* Warning! If you want to change these, just copy them into your own theme css. But you want to remove the !default, which only will set them if not already set. */
|
2
2
|
|
3
|
-
$logo-image: image_url(
|
3
|
+
$logo-image: image_url("blacklight/logo.png") !default;
|
4
4
|
$logo-width: 150px !default;
|
5
5
|
$logo-height: 50px !default;
|
6
6
|
|
7
|
-
/* label (field names) */
|
8
|
-
$field_name_color: $text-muted !default;
|
9
|
-
|
10
|
-
// the default bootstrap font-family list includes "Segoe UI Emoji", which, on windows
|
11
|
-
// renders our remove icon as an emoji-sized x instead of what we see on all other platforms...
|
12
|
-
// so, for now (until we replace it with an SVG icon or something), we get to override bootstrap:
|
13
|
-
$remove-icon-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif !default;
|
14
|
-
|
15
7
|
$facet-active-border: $success !default;
|
16
8
|
$facet-active-bg: $success !default;
|
17
|
-
$facet-active-item-color: $success !default;
|
9
|
+
$facet-active-item-color: $success !default;
|
10
|
+
|
11
|
+
/* for compatability with BS < 5.3 */
|
12
|
+
$body-secondary-color: rgba($body-color, 0.75) !default;
|
13
|
+
|
14
|
+
:root {
|
15
|
+
--bs-secondary-color: #{$body-secondary-color}; /* for compatability with BS < 5.3 */
|
16
|
+
|
17
|
+
--bl-main-padding-y: 0.5rem;
|
18
|
+
|
19
|
+
--bl-constraint-remove-hover-bg: #bb2d3b;
|
20
|
+
--bl-constraint-remove-hover-border-color: #bb2d3b;
|
21
|
+
|
22
|
+
--bl-field-name-color: var(--bs-secondary-color);
|
23
|
+
}
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<% end %>
|
9
9
|
|
10
10
|
<%= form_tag @url, method: @method, class: @classes.join(' '), role: 'search', 'aria-label' => t('blacklight.search.form.submit') do %>
|
11
|
-
<%= render Blacklight::HiddenSearchStateComponent.new(params:
|
11
|
+
<%= render Blacklight::HiddenSearchStateComponent.new(params: hidden_search_state_params) %>
|
12
12
|
|
13
13
|
<div class="input-criteria">
|
14
14
|
<div class="query-criteria mb-4">
|
@@ -34,6 +34,12 @@ module Blacklight
|
|
34
34
|
select_tag(:sort, options_for_select(options, params[:sort]), class: "form-select custom-select sort-select w-auto", aria: { labelledby: 'advanced-search-sort-label' })
|
35
35
|
end
|
36
36
|
|
37
|
+
# Filtered params to pass to hidden search fields
|
38
|
+
# @return [ActiveSupport::HashWithIndifferentAccess]
|
39
|
+
def hidden_search_state_params
|
40
|
+
@params.except(:clause, :f_inclusive, :op, :sort)
|
41
|
+
end
|
42
|
+
|
37
43
|
private
|
38
44
|
|
39
45
|
def initialize_search_field_controls
|
@@ -9,15 +9,8 @@
|
|
9
9
|
</span>
|
10
10
|
<% if @remove_path.present? %>
|
11
11
|
<%= link_to(@remove_path, class: 'btn btn-outline-secondary remove') do %>
|
12
|
-
|
13
|
-
<span class="sr-only visually-hidden">
|
14
|
-
<%= if @label.blank?
|
15
|
-
t('blacklight.search.filters.remove.value', value: @value)
|
16
|
-
else
|
17
|
-
t('blacklight.search.filters.remove.label_value', label: @label, value: @value)
|
18
|
-
end
|
19
|
-
%>
|
20
|
-
</span>
|
12
|
+
<%= render Blacklight::Icons::RemoveComponent.new %>
|
13
|
+
<span class="sr-only visually-hidden"><%= remove_aria_label %></span>
|
21
14
|
<% end %>
|
22
15
|
<% end %>
|
23
16
|
</span>
|
@@ -10,6 +10,14 @@ module Blacklight
|
|
10
10
|
@search_state = search_state
|
11
11
|
end
|
12
12
|
|
13
|
+
def remove_aria_label
|
14
|
+
if @label.blank?
|
15
|
+
t('blacklight.search.filters.remove.value', value: @value)
|
16
|
+
else
|
17
|
+
t('blacklight.search.filters.remove.label_value', label: @label, value: @value)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
13
21
|
def render?
|
14
22
|
@value.present?
|
15
23
|
end
|
@@ -41,7 +41,7 @@ module Blacklight
|
|
41
41
|
|
42
42
|
def query_constraints
|
43
43
|
if @search_state.query_param.present?
|
44
|
-
|
44
|
+
render(
|
45
45
|
@query_constraint_component.new(
|
46
46
|
search_state: @search_state,
|
47
47
|
value: @search_state.query_param,
|
@@ -53,7 +53,7 @@ module Blacklight
|
|
53
53
|
)
|
54
54
|
else
|
55
55
|
''.html_safe
|
56
|
-
end +
|
56
|
+
end + render(@facet_constraint_component.with_collection(clause_presenters.to_a, **@facet_constraint_component_options))
|
57
57
|
end
|
58
58
|
|
59
59
|
def remove_path
|
@@ -61,7 +61,7 @@ module Blacklight
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def facet_constraints
|
64
|
-
|
64
|
+
render(@facet_constraint_component.with_collection(facet_item_presenters.to_a, **@facet_constraint_component_options))
|
65
65
|
end
|
66
66
|
|
67
67
|
def render?
|
@@ -35,7 +35,8 @@ module Blacklight
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def render_partial
|
38
|
-
|
38
|
+
render(partial: @action.partial || @action.name.to_s,
|
39
|
+
locals: { document: @document, document_action_config: @action }.merge(@options))
|
39
40
|
end
|
40
41
|
|
41
42
|
def label
|
@@ -10,7 +10,8 @@
|
|
10
10
|
}) do %>
|
11
11
|
<div class="checkbox toggle-bookmark">
|
12
12
|
<label class="toggle-bookmark" data-checkboxsubmit-target="label">
|
13
|
-
<input type="checkbox" class="toggle-bookmark" data-checkboxsubmit-target="checkbox" <%= 'checked="checked"' if bookmarked? %>>
|
13
|
+
<input type="checkbox" class="toggle-bookmark <%= bookmark_icon ? 'd-none' : '' %>" data-checkboxsubmit-target="checkbox" <%= 'checked="checked"' if bookmarked? %>>
|
14
|
+
<%= bookmark_icon %>
|
14
15
|
<span data-checkboxsubmit-target="span"><%= bookmarked? ? t('blacklight.search.bookmarks.present') : t('blacklight.search.bookmarks.absent') %></span>
|
15
16
|
</label>
|
16
17
|
</div>
|
@@ -21,6 +21,12 @@ module Blacklight
|
|
21
21
|
helpers.bookmarked? @document
|
22
22
|
end
|
23
23
|
|
24
|
+
def bookmark_icon
|
25
|
+
return unless helpers.blacklight_config.bookmark_icon_component
|
26
|
+
|
27
|
+
render helpers.blacklight_config.bookmark_icon_component.new(name: 'bookmark')
|
28
|
+
end
|
29
|
+
|
24
30
|
def bookmark_path
|
25
31
|
@bookmark_path || helpers.bookmark_path(@document)
|
26
32
|
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Blacklight
|
4
|
+
module Document
|
5
|
+
# Render the start over and prev/next displays
|
6
|
+
class PageHeaderComponent < Blacklight::Component
|
7
|
+
attr_reader :document, :blacklight_config, :search_context, :search_session
|
8
|
+
|
9
|
+
delegate :blacklight_config, to: :helpers
|
10
|
+
|
11
|
+
def initialize(document:, search_context:, search_session:)
|
12
|
+
super
|
13
|
+
@search_context = search_context
|
14
|
+
@search_session = search_session
|
15
|
+
@document = document
|
16
|
+
end
|
17
|
+
|
18
|
+
def render?
|
19
|
+
search_context.present? || search_session.present? || has_header_tools?
|
20
|
+
end
|
21
|
+
|
22
|
+
def applied_params_component
|
23
|
+
return unless blacklight_config.track_search_session.applied_params_component
|
24
|
+
|
25
|
+
blacklight_config.track_search_session.applied_params_component.new
|
26
|
+
end
|
27
|
+
|
28
|
+
def pagination_component
|
29
|
+
return unless blacklight_config.track_search_session.item_pagination_component
|
30
|
+
|
31
|
+
blacklight_config.track_search_session.item_pagination_component.new(search_context: search_context, search_session: search_session, current_document: document)
|
32
|
+
end
|
33
|
+
|
34
|
+
def has_header_tools?
|
35
|
+
header_actions.any? || show_header_tools_component
|
36
|
+
end
|
37
|
+
|
38
|
+
def pagination_container_classes
|
39
|
+
has_header_tools? ? 'col-12 col-md-6 ms-auto' : ''
|
40
|
+
end
|
41
|
+
|
42
|
+
def header_container_classes
|
43
|
+
has_header_tools? ? 'row pagination-search-widgets pb-2' : 'pagination-search-widgets'
|
44
|
+
end
|
45
|
+
|
46
|
+
def header_actions
|
47
|
+
actions = helpers.filter_partials(blacklight_config.view_config(:show).header_actions, { document: document })
|
48
|
+
actions.map { |_k, v| v }
|
49
|
+
end
|
50
|
+
|
51
|
+
def show_header_tools_component
|
52
|
+
blacklight_config.view_config(:show).show_header_tools_component
|
53
|
+
end
|
54
|
+
|
55
|
+
def default_action_component_render
|
56
|
+
render Blacklight::Document::ActionsComponent.new(document: document,
|
57
|
+
tag: action_component_tag,
|
58
|
+
classes: classes,
|
59
|
+
link_classes: link_classes,
|
60
|
+
actions: header_actions,
|
61
|
+
url_opts: Blacklight::Parameters.sanitize(params.to_unsafe_h))
|
62
|
+
end
|
63
|
+
|
64
|
+
def action_component_tag
|
65
|
+
'div'
|
66
|
+
end
|
67
|
+
|
68
|
+
def classes
|
69
|
+
'd-inline-flex header-tools align-items-center col-12 col-md-6 ms-auto justify-content-md-end'
|
70
|
+
end
|
71
|
+
|
72
|
+
def link_classes
|
73
|
+
'btn btn-outline-primary ms-2'
|
74
|
+
end
|
75
|
+
|
76
|
+
def render_header_tools
|
77
|
+
return unless has_header_tools?
|
78
|
+
|
79
|
+
return render show_header_tools_component.new(document: document) if show_header_tools_component
|
80
|
+
|
81
|
+
default_action_component_render
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -127,7 +127,7 @@ module Blacklight
|
|
127
127
|
def before_render
|
128
128
|
set_slot(:title, nil) unless title
|
129
129
|
set_slot(:thumbnail, nil) unless thumbnail || show?
|
130
|
-
set_slot(:metadata, nil, fields: presenter.field_presenters) unless metadata
|
130
|
+
set_slot(:metadata, nil, fields: presenter.field_presenters, show: @show) unless metadata
|
131
131
|
set_slot(:embed, nil) unless embed
|
132
132
|
if view_partials.present?
|
133
133
|
view_partials.each do |view_partial|
|
@@ -51,7 +51,7 @@ module Blacklight
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def render_partial
|
54
|
-
|
54
|
+
render(@field_config.partial, locals: { field_name: @field_config.field, facet_field: @field_config, display_facet: @display_facet }.merge(@component_args))
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|