Description
Ivan Dziuba
2020-11-16 16:18:24 UTC
Comment hidden (obsolete)
Created attachment 113670 [details] Bug 27035: Shows the number of results in a facets. Test: 1. Apply the patch. 2. The number of results is displayed for each facet after searching. Created attachment 113675 [details] Bug 27035: Shows the number of results in a facets. Test: 1. Apply the patch. 2. The number of results is displayed for each facet after searching. Comment on attachment 113670 [details] Bug 27035: Shows the number of results in a facets. Test: 1. Apply the patch. 2. The number of results is displayed for each facet after searching. obsolete Comment on attachment 113670 [details] Bug 27035: Shows the number of results in a facets. Test: 1. Apply the patch. 2. The number of results is displayed for each facet after searching. 0 of attachment 113670 [details]: ----------------------------------------------------------------- obsolete Comment on attachment 113670 [details] Bug 27035: Shows the number of results in a facets. Test: 1. Apply the patch. 2. The number of results is displayed for each facet after searching. >From 959186a3bb4fc82f49e703a107f636007217000b Mon Sep 17 00:00:00 2001 >From: Ivan Dziuba <ivan.dziuba@inlibro.com> >Date: Mon, 16 Nov 2020 11:26:29 -0500 >Subject: [PATCH] Bug 27035: Shows the number of results in a facets. Test: 1. > Apply the patch. 2. The number of results is displayed for each facet after > searching. > >--- > koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc | 4 ++-- > 1 file changed, 2 insertions(+), 2 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 dad168a4ef..0f20cb37fa 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >@@ -52,11 +52,11 @@ > [% END %] > [% 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">[% facet.facet_label_value | html %]</span> <strong>([% facet.facet_count | html %])</strong> > [<a href="[% local_url | $raw %]" title="Remove facet [% facet.facet_link_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"><a href="[% local_url | $raw %]" title="[% facet.facet_title_value | html %]">[% facet.facet_label_value | html %] <strong>([% facet.facet_count | html %])</strong></a></span> > [% IF ( displayFacetCount ) %] > <span class="facet-count"> ([% facet.facet_count | html %])</span> > [% END %] >-- >2.17.1 Created attachment 113678 [details] [review] Bug 27035: Shows the number of results in a facets after facet selection System preferences: displayFacetCount - Show; Before, When we select a facet the number of results is not displayed, after searching Ex. Marriage -- Fiction [x] After, When we select a facet the number of results is displayed, after searching Ex. Marriage -- Fiction (2) [x] Created attachment 113680 [details] [review] Bug 27035: Shows the number of results in a facets after facet selection System preferences: displayFacetCount - Show; 1. Let's search 2. Near to each of the facets, we see the number of results (n) 3. Click on any of the facets and filter the result 4. Opposite the selected facets, the number of results is not displayed Ex. Marriage Fiction [x] Apply the patch 1. Let's search 2. Near to each of the facets, we see the number of results (n) 3. Click on any of the facets and filter the result 4. Now, opposite the selected facets, the number of results is displayed Ex. Marriage Fiction (2) [x] Hi Ivan, This works for me but it is a bit confusing when you attempt to apply 2 or more filters at a time. -I apply your patch and do an OPAC search. -Then I filter to only show Centerville results. (210 results) -I see 210 appear in bold next to the Centerville filter -Now I filter to only show Non-Fiction results, while maintaining the Centerville filter. -There are 4 results that are Non-Fiction items from Centerville. -Now both filters (Centerville and Non-fiction) show the number 4 in bold. I understand this might be correct as we now have 4 search results but it is confusing to me. Indeed, number of results are useful before selecting a facet. After, it may be confusing and not really useful. Would you have suggestion on how this could be improved? This is an upgrade to the current status, as such it could move forward. Your points are valid, though, so if you have an idea on how the logic should work, we're very much listening. I put it back in Need Signoff to wake things up. (In reply to Blou from comment #10) > Would you have suggestion on how this could be improved? > > This is an upgrade to the current status, as such it could move forward. > Your points are valid, though, so if you have an idea on how the logic > should work, we're very much listening. > > I put it back in Need Signoff to wake things up. I am assuming many libraries are going to want to hide this from display. Can we get a distinct class the number wrapped in parenthesis? I know we could hide it by targeting the <strong> element but I would much rather see a distinct class here. Created attachment 132077 [details] [review] Bug 27035: Shows the number of results in a facets after facet selection System preferences: displayFacetCount - Show; 1. Let's search 2. Near to each of the facets, we see the number of results (n) 3. Click on any of the facets and filter the result 4. Opposite the selected facets, the number of results is not displayed Ex. Marriage Fiction [x] Apply the patch 1. Let's search 2. Near to each of the facets, we see the number of results (n) 3. Click on any of the facets and filter the result 4. Now, opposite the selected facets, the number of results is displayed Ex. Marriage Fiction (2) [x] Created attachment 132195 [details] [review] Bug 27035: Shows the number of results in a facets after facet selection System preferences: displayFacetCount - Show; 1. Let's search 2. Near to each of the facets, we see the number of results (n) 3. Click on any of the facets and filter the result 4. Opposite the selected facets, the number of results is not displayed Ex. Marriage Fiction [x] Apply the patch 1. Let's search 2. Near to each of the facets, we see the number of results (n) 3. Click on any of the facets and filter the result 4. Now, opposite the selected facets, the number of results is displayed Ex. Marriage Fiction (2) [x] Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 132807 [details] [review] Bug 27035: Shows the number of results in a facets after facet selection System preferences: displayFacetCount - Show; 1. Let's search 2. Near to each of the facets, we see the number of results (n) 3. Click on any of the facets and filter the result 4. Opposite the selected facets, the number of results is not displayed Ex. Marriage Fiction [x] Apply the patch 1. Let's search 2. Near to each of the facets, we see the number of results (n) 3. Click on any of the facets and filter the result 4. Now, opposite the selected facets, the number of results is displayed Ex. Marriage Fiction (2) [x] Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Pushed to master for 22.05, thanks to everybody involved [U+1F984] Filed bug 32252 - this does not appear to be resolved in 22.05 |