Bugzilla – Attachment 40339 Details for
Bug 14419
Expanding facets (Show more) performs a new search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14419 - Expanding facets (Show more) performs a new search
Bug-14419---Expanding-facets-Show-more-performs-a-.patch (text/plain), 4.47 KB, created by
Nick Clemens (kidclamp)
on 2015-06-18 22:10:35 UTC
(
hide
)
Description:
Bug 14419 - Expanding facets (Show more) performs a new search
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2015-06-18 22:10:35 UTC
Size:
4.47 KB
patch
obsolete
>From f01a8cc5a831b48ff4185d87c012401f7d0e103f Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@quecheelibrary.org> >Date: Thu, 18 Jun 2015 18:05:42 -0400 >Subject: [PATCH] Bug 14419 - Expanding facets (Show more) performs a new > search > >This is a proof of concept patch, it is for discussion/demonstration and only affects the OPAC. > >To test: >1 - Perform an OPAC search that returns more than 5 of any given facet type >2 - Click the "Show more" link on the facets and see that the search is reloaded >3 - Apply patch >4 - Repeat search >5 - Note that you can click "Show more" without reloading page >6 - Test that page load is not greatly affected >7 - Ensure that all facet links function normally >8 - Ensure that facets are the same a prior to patch >9 - Tell me to make this a valid patch or do so yourself :-) >--- > C4/Search.pm | 2 +- > .../opac-tmpl/bootstrap/en/includes/opac-facets.inc | 15 +++++++++------ > .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 7 +++++++ > 3 files changed, 17 insertions(+), 7 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 990ed39..d632ca3 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -525,7 +525,7 @@ sub getRecords { > $number_of_facets++; > if ( ( $number_of_facets <= 5 ) > || ( $expanded_facet eq $link_value ) >- || ( $facets_info->{$link_value}->{'expanded'} ) >+ || ( $facets_info->{$link_value}->{'expanded'} ) || 1 > ) > { > >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 958d571..f05ec04 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >@@ -30,8 +30,12 @@ > [% END %] > [% IF facets_loo.type_label_Location %]<h5 id="facet-locations">Locations</h5>[% END %] > <ul> >- [% FOREACH facet IN facets_loo.facets %] >+ [% FOREACH facet IN facets_loo.facets %] >+ [% IF loop.count > 5 %] >+ <li class="collapsible-facet" style='display:none'> >+ [% ELSE %] > <li> >+ [% END %] > [% SET url = "/cgi-bin/koha/opac-search.pl?" _ query_cgi _ limit_cgi %] > [% IF ( sort_by ) %] > [% url = BLOCK %][% url %][% "&sort_by=" _ sort_by |url %][% END %] >@@ -50,11 +54,10 @@ > </li> > [% END %] > [% IF ( facets_loo.expandable ) %] >- <li class="showmore"> >- <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi |url %][% IF ( sort_by ) %]&sort_by=[% sort_by |url %][% END %][% IF ( offset ) %] >- &offset=[% offset |url %][% END %]&expand=[% facets_loo.expand |url %]#[% facets_loo.type_id |url %]">Show more</a> >- </li> >- [% END %] >+ <li class="showmore"> >+ Show more >+ </li> >+ [% END %] > </ul> > </li> > [% END # / IF facets_loo.facets.size > 0 %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index d905f13..cb65e28 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -691,13 +691,20 @@ function highlightOn() { > $(".highlight_toggle").toggle(); > } > [% END %] >+ > $(document).ready(function(){ >+ > [% IF ( OpacHighlightedWords ) %] > $('a.title').each(function() { > $(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc | uri %]"); > }); > [% END %] > >+$(".showmore").click(function(){ >+ $(this).siblings(".collapsible-facet").toggle(); >+}); >+ >+ > $(".cb").click(function(){ > enableCheckboxActions(); > }); >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14419
:
40339
|
40425
|
91185
|
91234
|
91241
|
91242
|
96355