From 152fb44d4ac11a4cf81bedff3bf8102387e85487 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 --- 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 0dc74bbe9f..addc25ee9c 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 ) %] @@ -60,13 +61,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.30.2