From 0c41e05f25e4a9385ad26cdaed68f9c037909931 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Wed, 27 Sep 2023 11:26:15 -1000 Subject: [PATCH] Bug 34940: Highlight logged-in library in facets Like in patron searches Bug 10902, use class 'currentlibrary' to highlight logged-in library in facets Test plan : 1) Set system preference 'DisplayLibraryFacets' to 'both home and holding libraries' 2) Perform a seach that will find items of your logged-in library. In KTD, search for 'branch:CPL' 3) Check the facet (home and holding libraries) of your logged-in library is highlighted Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc index 31e5de73b5..2fcce67e7d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc @@ -1,5 +1,6 @@ [% USE raw %] [% USE AuthorisedValues %] +[% USE Branches %] [% USE Languages %] [% IF ( opacfacets ) %] @@ -103,13 +104,15 @@ [% ELSE %]
  • [% END %] + [% SET facet_is_current_library = ( facets_loo.type_label_HomeLibrary || facets_loo.type_label_HoldingLibrary ) && !singleBranchMode && facet.facet_title_value == Branches.GetLoggedInBranchcode %] + [% SET facet_label_class = facet_is_current_library ? 'facet-label currentlibrary' : 'facet-label' %] [% IF facet.active %] [% local_url = BLOCK %][% url | $raw %][% "&nolimit=" _ facet.type_link_value _ ":" _ facet.facet_link_value | url %][% END %] - [% facet.facet_label_value | html %] + [% facet.facet_label_value | html %] [x] [% ELSE %] [% local_url = BLOCK %][% url | $raw %][% "&limit=" _ facet.type_link_value _ ":" _ facet.facet_link_value | url %][% END %] - [% facet.facet_label_value | html %] + [% facet.facet_label_value | html %] [% IF ( displayFacetCount ) %] ([% facet.facet_count | html %]) [% END %] -- 2.39.5