Bugzilla – Attachment 166193 Details for
Bug 36750
OPAC - some facet heading labels are not displayed in search results when using Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36750: Fix aria-label for show more/less links
Bug-36750-Fix-aria-label-for-show-moreless-links.patch (text/plain), 9.38 KB, created by
Jonathan Druart
on 2024-05-06 09:57:18 UTC
(
hide
)
Description:
Bug 36750: Fix aria-label for show more/less links
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-05-06 09:57:18 UTC
Size:
9.38 KB
patch
obsolete
>From 6c54aa012fab944433d72d5e0d9498c2f55b5a5c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 6 May 2024 11:55:28 +0200 >Subject: [PATCH] Bug 36750: Fix aria-label for show more/less links > >Didn't manage to keep the more_less_labels because of the space in the >key names >--- > .../bootstrap/en/includes/opac-facets.inc | 76 ++++++++++++++----- > t/db_dependent/Search.t | 10 +-- > 2 files changed, 61 insertions(+), 25 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >index 2a556263fd8..fb9dbeed753 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >@@ -39,18 +39,6 @@ > [% IF ( related ) %] <li>(related searches: [% FOREACH relate IN related %][% relate.related_search | html %][% END %])</li>[% END %] > </li> > >- [% SET more_less_labels = {} %] >- [% more_less_labels.Authors = { more = t("Show more authors"), less = t("Show fewer authors") } %] >- [% more_less_labels.Titles = { more = t("Show more titles"), less = t("Show fewer titles") } %] >- [% more_less_labels.Topics = { more = t("Show more topics"), less = t("Show fewer topics") } %] >- [% more_less_labels.Places = { more = t("Show more places"), less = t("Show fewer places") } %] >- [% more_less_labels.Series = { more = t("Show more series"), less = t("Show fewer series") } %] >- [% more_less_labels.ItemTypes = { more = t("Show more item types"), less = t("Show fewer item types") } %] >- [% more_less_labels.CollectionCodes = { more = t("Show more collections"), less = t("Show fewer collections") } %] >- [% more_less_labels.Language = { more = t("Show more languages"), less = t("Show fewer languages") } %] >- [% more_less_labels.HomeLibrary = { more = t("Show more home libraries"), less = t("Show fewer home libraries") } %] >- [% more_less_labels.HoldingLibrary = { more = t("Show more holding libraries"), less = t("Show fewer holding libraries") } %] >- [% more_less_labels.Location = { more = t("Show more locations"), less = t("Show fewer locations") } %] > [% FOREACH facets_loo IN facets_loop %] > [% IF facets_loo.facets.size > 0 %] > <li id="[% facets_loo.type_id | html %]"> >@@ -114,17 +102,65 @@ > [% END %] > [% IF facets_loo.facets.size > 5 %] > <li class="moretoggle"> >- [% FOR label IN more_less_labels.keys %] >- [% IF facets_loo.item('type_label_' _ label) %] >- <a href="#" aria-label="[% more_less_labels.item(label).more | html | trim %]"><strong>Show more</strong></a> >- [% END %] >+ [% SET aria_label = '' %] >+ [% SWITCH facets_loo.label %] >+ [% CASE 'Authors' %] >+ [% aria_label = t("Show more authors") %] >+ [% CASE 'Titles' %] >+ [% aria_label = t("Show more titles") %] >+ [% CASE 'Topics' %] >+ [% aria_label = t("Show more topics") %] >+ [% CASE 'Places' %] >+ [% aria_label = t("Show more places") %] >+ [% CASE 'Series' %] >+ [% aria_label = t("Show more series") %] >+ [% CASE 'ItemTypes' %] >+ [% aria_label = t("Show more item types") %] >+ [% CASE 'Home libraries' %] >+ [% aria_label = t("Show more home libraries") %] >+ [% CASE 'Holding libraries' %] >+ [% aria_label = t("Show more holding libraries") %] >+ [% CASE 'Location' %] >+ [% aria_label = t("Show more home locations") %] >+ [% CASE 'Collections' %] >+ [% aria_label = t("Show more home collections") %] >+ [% CASE 'Languages' %] >+ [% aria_label = t("Show more home languages") %] >+ [% END %] >+ >+ [% IF aria_label %] >+ <a href="#" aria-label="[% aria_label | html | trim %]"><strong>Show more</strong></a> > [% END %] > </li> > <li class="moretoggle" style="display:none"> >- [% FOR label IN more_less_labels.keys %] >- [% IF facets_loo.item('type_label_' _ label) %] >- <a href="#" aria-label="[% more_less_labels.item(label).less | html | trim %]"><strong>Show less</strong></a> >- [% END %] >+ [% SET aria_label = '' %] >+ [% SWITCH facets_loo.label %] >+ [% CASE 'Authors' %] >+ [% aria_label = t("Show fewer authors") %] >+ [% CASE 'Titles' %] >+ [% aria_label = t("Show fewer titles") %] >+ [% CASE 'Topics' %] >+ [% aria_label = t("Show fewer topics") %] >+ [% CASE 'Places' %] >+ [% aria_label = t("Show fewer places") %] >+ [% CASE 'Series' %] >+ [% aria_label = t("Show fewer series") %] >+ [% CASE 'ItemTypes' %] >+ [% aria_label = t("Show fewer item types") %] >+ [% CASE 'Home libraries' %] >+ [% aria_label = t("Show fewer home libraries") %] >+ [% CASE 'Holding libraries' %] >+ [% aria_label = t("Show fewer holding libraries") %] >+ [% CASE 'Location' %] >+ [% aria_label = t("Show fewer home locations") %] >+ [% CASE 'Collections' %] >+ [% aria_label = t("Show fewer home collections") %] >+ [% CASE 'Languages' %] >+ [% aria_label = t("Show fewer home languages") %] >+ [% END %] >+ >+ [% IF aria_label %] >+ <a href="#" aria-label="[% aria_label | html | trim %]"><strong>Show less</strong></a> > [% END %] > </li> > [% END %] >diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t >index b3e1c77de66..4939b846fed 100755 >--- a/t/db_dependent/Search.t >+++ b/t/db_dependent/Search.t >@@ -825,9 +825,9 @@ ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' > my $facets_info = C4::Search::_get_facets_info( $facets ); > my $expected_facets_info_marc21 = { > 'au' => { 'label_value' => "Authors" }, >- 'ccode' => { 'label_value' => "CollectionCodes" }, >- 'holdingbranch' => { 'label_value' => "HoldingLibrary" }, >- 'itype' => { 'label_value' => "ItemTypes" }, >+ 'ccode' => { 'label_value' => "Collections" }, >+ 'holdingbranch' => { 'label_value' => "Holding libraries" }, >+ 'itype' => { 'label_value' => "Item types" }, > 'location' => { 'label_value' => "Location" }, > 'se' => { 'label_value' => "Series" }, > 'su-geo' => { 'label_value' => "Places" }, >@@ -925,8 +925,8 @@ sub run_unimarc_search_tests { > my $facets_info = C4::Search::_get_facets_info( $facets ); > my $expected_facets_info_unimarc = { > 'au' => { 'label_value' => "Authors" }, >- 'ccode' => { 'label_value' => "CollectionCodes" }, >- 'holdingbranch' => { 'label_value' => "HoldingLibrary" }, >+ 'ccode' => { 'label_value' => "Collections" }, >+ 'holdingbranch' => { 'label_value' => "Holding libraries" }, > 'location' => { 'label_value' => "Location" }, > 'se' => { 'label_value' => "Series" }, > 'su-geo' => { 'label_value' => "Places" }, >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36750
:
166031
|
166032
|
166083
|
166084
|
166187
|
166191
|
166192
|
166193
|
166194
|
166281
|
166282
|
166283
|
166284
|
166286
|
166288
|
166289
|
166290
|
166291
|
166292