From 5a188651e484517f28367e44183b680fa77ad77b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 7 Jul 2023 09:44:21 +0200 Subject: [PATCH] Bug 33809: Centralize duplicated code Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- .../bootstrap/en/includes/opac-facets.inc | 45 +++++++++---------- 1 file changed, 21 insertions(+), 24 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 304d9f7d4f..e66a89b45c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc @@ -1,6 +1,7 @@ [% USE raw %] [% USE AuthorisedValues %] [% USE Languages %] +[% PROCESS 'i18n.inc' %] [% IF ( opacfacets && facets_loop && total ) %]

Refine your search

@@ -36,6 +37,18 @@ [% IF ( related ) %]
  • (related searches: [% FOREACH relate IN related %][% relate.related_search | html %][% END %])
  • [% END %] + [% 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 types"), less = t("Show fewer types") } %] + [% more_less_labels.CollectionCodes = { more = t("Show more collection codes"), less = t("Show fewer collection codes") } %] + [% 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 %]
  • @@ -86,34 +99,18 @@ [% END %] [% IF facets_loo.facets.size > 5 %]
  • - [% IF facets_loo.type_label_Authors %]Show more[% END %] - [% IF facets_loo.type_label_Titles %]Show more[% END %] - [% IF facets_loo.type_label_Topics %]Show more[% END %] - [% IF facets_loo.type_label_Places %]Show more[% END %] - [% IF facets_loo.type_label_Series %]Show more[% END %] - [% IF facets_loo.type_label_ItemTypes %]Show more[% END %] - [% IF facets_loo.type_label_CollectionCodes %]Show more[% END %] - [% IF facets_loo.type_label_Language %]Show more[% END %] - [% UNLESS singleBranchMode %] - [% IF ( facets_loo.type_label_HomeLibrary ) %]Show more[% END %] - [% IF ( facets_loo.type_label_HoldingLibrary ) %]Show more[% END %] + [% FOR label IN more_less_labels.keys %] + [% IF facets_loo.item('type_label_' _ label) %] + Show more + [% END %] [% END %] - [% IF facets_loo.type_label_Location %]Show more[% END %]
  • [% END %] -- 2.39.5