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 <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Fridolin Somers 2023-09-27 11:26:15 -10:00 committed by Tomas Cohen Arazi
parent 1508e81505
commit 0c41e05f25
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -1,5 +1,6 @@
[% USE raw %]
[% USE AuthorisedValues %]
[% USE Branches %]
[% USE Languages %]
[% IF ( opacfacets ) %]
@ -103,13 +104,15 @@
[% ELSE %]
<li>
[% 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 %]
<span class="facet-label">[% facet.facet_label_value | html %]</span>
<span class="[% facet_label_class | html %]">[% facet.facet_label_value | html %]</span>
[<a href="[% local_url | $raw %]" title="Remove facet [% facet.facet_label_value | html %]">x</a>]
[% ELSE %]
[% local_url = BLOCK %][% url | $raw %][% "&limit=" _ facet.type_link_value _ ":" _ facet.facet_link_value | url %][% END %]
<span class="facet-label"><a href="[% local_url | $raw %]" title="[% facet.facet_title_value | html %]">[% facet.facet_label_value | html %]</a></span>
<span class="[% facet_label_class | html %]"><a href="[% local_url | $raw %]" title="[% facet.facet_title_value | html %]">[% facet.facet_label_value | html %]</a></span>
[% IF ( displayFacetCount ) %]
<span class="facet-count"> ([% facet.facet_count | html %])</span>
[% END %]