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 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
4ffaa07a40
commit
a654faf72e
2 changed files with 59 additions and 25 deletions
|
@ -39,18 +39,6 @@
|
||||||
[% IF ( related ) %] <li>(related searches: [% FOREACH relate IN related %][% relate.related_search | html %][% END %])</li>[% END %]
|
[% IF ( related ) %] <li>(related searches: [% FOREACH relate IN related %][% relate.related_search | html %][% END %])</li>[% END %]
|
||||||
</li>
|
</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 %]
|
[% FOREACH facets_loo IN facets_loop %]
|
||||||
[% IF facets_loo.facets.size > 0 %]
|
[% IF facets_loo.facets.size > 0 %]
|
||||||
<li id="[% facets_loo.type_id | html %]">
|
<li id="[% facets_loo.type_id | html %]">
|
||||||
|
@ -114,17 +102,63 @@
|
||||||
[% END %]
|
[% END %]
|
||||||
[% IF facets_loo.facets.size > 5 %]
|
[% IF facets_loo.facets.size > 5 %]
|
||||||
<li class="moretoggle">
|
<li class="moretoggle">
|
||||||
[% FOR label IN more_less_labels.keys %]
|
[% SET aria_label = t("Show more") %]
|
||||||
[% IF facets_loo.item('type_label_' _ label) %]
|
[% SWITCH facets_loo.label %]
|
||||||
<a href="#" aria-label="[% more_less_labels.item(label).more || t('Show more') | html | trim %]"><strong>Show more</strong></a>
|
[% CASE 'Authors' %]
|
||||||
[% END %]
|
[% 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 %]
|
[% END %]
|
||||||
|
|
||||||
|
<a href="#" aria-label="[% aria_label | html | trim %]"><strong>Show more</strong></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="moretoggle" style="display:none">
|
<li class="moretoggle" style="display:none">
|
||||||
[% FOR label IN more_less_labels.keys %]
|
[% SET aria_label = t("Show more") %]
|
||||||
[% IF facets_loo.item('type_label_' _ label) %]
|
[% SWITCH facets_loo.label %]
|
||||||
<a href="#" aria-label="[% more_less_labels.item(label).less || t('Show less') | html | trim %]"><strong>Show less</strong></a>
|
[% 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 %]
|
[% END %]
|
||||||
|
|
||||||
|
[% IF aria_label %]
|
||||||
|
<a href="#" aria-label="[% aria_label | html | trim %]"><strong>Show less</strong></a>
|
||||||
[% END %]
|
[% END %]
|
||||||
</li>
|
</li>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
|
@ -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 $facets_info = C4::Search::_get_facets_info( $facets );
|
||||||
my $expected_facets_info_marc21 = {
|
my $expected_facets_info_marc21 = {
|
||||||
'au' => { 'label_value' => "Authors" },
|
'au' => { 'label_value' => "Authors" },
|
||||||
'ccode' => { 'label_value' => "CollectionCodes" },
|
'ccode' => { 'label_value' => "Collections" },
|
||||||
'holdingbranch' => { 'label_value' => "HoldingLibrary" },
|
'holdingbranch' => { 'label_value' => "Holding libraries" },
|
||||||
'itype' => { 'label_value' => "ItemTypes" },
|
'itype' => { 'label_value' => "Item types" },
|
||||||
'location' => { 'label_value' => "Location" },
|
'location' => { 'label_value' => "Location" },
|
||||||
'se' => { 'label_value' => "Series" },
|
'se' => { 'label_value' => "Series" },
|
||||||
'su-geo' => { 'label_value' => "Places" },
|
'su-geo' => { 'label_value' => "Places" },
|
||||||
|
@ -925,8 +925,8 @@ sub run_unimarc_search_tests {
|
||||||
my $facets_info = C4::Search::_get_facets_info( $facets );
|
my $facets_info = C4::Search::_get_facets_info( $facets );
|
||||||
my $expected_facets_info_unimarc = {
|
my $expected_facets_info_unimarc = {
|
||||||
'au' => { 'label_value' => "Authors" },
|
'au' => { 'label_value' => "Authors" },
|
||||||
'ccode' => { 'label_value' => "CollectionCodes" },
|
'ccode' => { 'label_value' => "Collections" },
|
||||||
'holdingbranch' => { 'label_value' => "HoldingLibrary" },
|
'holdingbranch' => { 'label_value' => "Holding libraries" },
|
||||||
'location' => { 'label_value' => "Location" },
|
'location' => { 'label_value' => "Location" },
|
||||||
'se' => { 'label_value' => "Series" },
|
'se' => { 'label_value' => "Series" },
|
||||||
'su-geo' => { 'label_value' => "Places" },
|
'su-geo' => { 'label_value' => "Places" },
|
||||||
|
|
Loading…
Reference in a new issue