Bugzilla – Attachment 152255 Details for
Bug 33894
Use template wrapper for tabs: OPAC search history
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33894: Restructuring: Use BLOCKs for biblio and authority sections
Bug-33894-Restructuring-Use-BLOCKs-for-biblio-and-.patch (text/plain), 27.62 KB, created by
Owen Leonard
on 2023-06-09 15:19:46 UTC
(
hide
)
Description:
Bug 33894: Restructuring: Use BLOCKs for biblio and authority sections
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-06-09 15:19:46 UTC
Size:
27.62 KB
patch
obsolete
>From 9720fe52490d52afd581957409769ff8906e463b Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 1 Jun 2023 13:33:38 +0000 >Subject: [PATCH] Bug 33894: Restructuring: Use BLOCKs for biblio and authority > sections > >In order to make the conversion to the tab wrapper markup easier I'm >putting the biblio search history and authority search history sections >into blocks. This will make it easier to include or not include the >sections using template logic. > >To test, apply the patch and, if necessary, perform some searches for >bibliographic and authority records. The OPAC search history page should >be unchanged, with the correct information showing under each tab and in >each section for current and previous searches. > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../en/modules/opac-search-history.tt | 397 +++++++++--------- > 1 file changed, 203 insertions(+), 194 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt >index 135d9c2ebf..93377259f9 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt >@@ -49,6 +49,7 @@ > > <div id="searchhistory" class="maincontent"> > <h1>Search history</h1> >+ > [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %] > <div id="tabs" class="toptabs"> > <ul class="nav nav-tabs" role="tablist"> >@@ -59,207 +60,215 @@ > <a class="nav-link" id="authority-tab-link" href="#authority_tab" aria-controls="authority_tab" role="tab" data-toggle="tab" aria-selected="false">Authority</a> > </li> > </ul> >- <div class="tab-content"> >- [% END %] >- <div id="biblio_tab" role="tabpanel" class="tab-pane active" aria-labelledby="biblio-tab-link"> >- <div id="current_biblio"> >- [% IF ( current_biblio_searches ) %] >- <h2>Current session</h2> >- <form action="/cgi-bin/koha/opac-search-history.pl" method="post"> >- <legend class="sr-only">Toolbar control</legend> >- >- [% INCLUDE 'toolbar_controls' %] >- <input type="hidden" name="action" value="delete" /> >- <table class="historyt table table-bordered table-striped"> >- <caption class="sr-only">Current session</caption> >- <thead> >- <tr> >- <th></th> >- <th>Date</th> >- <th>Search</th> >- <th>Results</th> >- <th></th> >- </tr> >- </thead> >- <tbody> >- [% FOREACH s IN current_biblio_searches %] >- <tr> >- <td class="selectcol"> >- <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" /> >- </td> >- <td data-order="[% s.time | html %]"> >- <label for="result[% s.id | html %]"> >- [% s.time |$KohaDates with_hours => 1 %] >- </label> >- </td> >- <td> >- <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&[% s.query_cgi | $raw %]&count=[% countrss | uri %]&sort_by=acqdate_dsc&format=rss" aria-label="Subscribe to this search" class="rsssearchlink"> >- <i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this search"></i> >- </a> >- <a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a> >- </td> >- <td>[% s.total | html %]</td> >- <td></td> >- </tr> >- [% END %] >- </tbody> >- </table> >- <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches"> >- </form> >- [% END # IF ( current_biblio_searches ) %] >- </div> <!-- / #current_biblio --> >- <hr /> >- <div id="previous_biblio"> >- [% IF ( previous_biblio_searches ) %] >- <h2>Previous sessions</h2> >- <form action="/cgi-bin/koha/opac-search-history.pl" method="post"> >- <legend class="sr-only">Toolbar control</legend> >- [% INCLUDE 'toolbar_controls' %] >- >- <input type="hidden" name="action" value="delete" /> >- <table class="historyt table table-bordered table-striped"> >- <caption class="sr-only">Previous sessions</caption> >- <thead> >- <tr> >- <th></th> >- <th>Date</th> >- <th>Search</th> >- <th>Results</th> >- <th></th> >- </tr> >- </thead> >- <tbody> >- [% FOREACH s IN previous_biblio_searches %] >- <tr> >- <td class="selectcol"> >- <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" /> >- </td> >- <td data-order="[% s.time | html %]"> >- <label for="result[% s.id | html %]"> >- [% s.time |$KohaDates with_hours => 1 %] >- </label> >- </td> >- <td> >- <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&[% s.query_cgi | $raw %]&count=[% countrss | uri %]&sort_by=acqdate_dsc&format=rss" aria-label="Subscribe to this search" class="rsssearchlink"> >- <i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this search"></i> >- </a> >- <a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi | $raw %]"> >- [% s.query_desc | html %] >- </a> >- </td> >- <td>[% s.total | html %]</td> >- <td></td> >- </tr> >- [% END %] >- </tbody> >- </table> >- <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches"> >- </form> >- [% END # IF ( previous_biblio_searches ) %] >- </div> <!-- / #previous_biblio --> >- >- [% IF !current_biblio_searches && !previous_biblio_searches %] >- <p>Your catalog search history is empty.</p> >- [% END %] >- </div> <!-- / #biblio_tab --> >+ <div class="tab-content"> >+ <div id="biblio_tab" role="tabpanel" class="tab-pane active" aria-labelledby="biblio-tab-link"> >+ [% PROCESS catalog_search_history %] >+ </div> <!-- / #biblio_tab --> > >- [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %] >- <div id="authority_tab" role="tabpanel" class="tab-pane" aria-labelledby="authority-tab-link"> >- <div id="current_authority"> >- [% IF ( current_authority_searches ) %] >- <h2>Current session</h2> >- <form action="/cgi-bin/koha/opac-search-history.pl" method="post"> >- <legend class="sr-only">Toolbar control</legend> >- [% INCLUDE 'toolbar_controls' %] >- <input type="hidden" name="action" value="delete" /> >- <table class="historyt table table-bordered table-striped"> >- <caption class="sr-only">Current session</caption> >- <thead> >- <tr> >- <th></th> >- <th>Date</th> >- <th>Search</th> >- <th>Results</th> >- <th></th> >- </tr> >- </thead> >- <tbody> >- [% FOREACH s IN current_authority_searches %] >- <tr> >- <td class="selectcol"> >- <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" /> >- </td> >- <td data-order="[% s.time | html %]"> >- <label for="result[% s.id | html %]"> >- [% s.time |$KohaDates with_hours => 1 %] >- </label> >- </td> >- <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td> >- <td>[% s.total | html %]</td> >- <td></td> >- </tr> >- [% END %] >- </tbody> >- </table> >- <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches"> >- </form> >- [% END # / IF ( current_authority_searches ) %] >- </div> <!-- / #current_authority --> >- <hr /> >- <div id="previous_authority"> >- [% IF ( previous_authority_searches ) %] >- <h2>Previous sessions</h2> >- <form action="/cgi-bin/koha/opac-search-history.pl" method="post"> >- <legend class="sr-only">Toolbar control</legend> >- [% INCLUDE 'toolbar_controls' %] >- <input type="hidden" name="action" value="delete" /> >- <table class="historyt table table-bordered table-striped"> >- <caption class="sr-only">Previous sessions</caption> >- <thead> >- <tr> >- <th></th> >- <th>Date</th> >- <th>Search</th> >- <th>Results</th> >- <th></th> >- </tr> >- </thead> >- <tbody> >- [% FOREACH s IN previous_authority_searches %] >- <tr> >- <td class="selectcol"> >- <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" /> >- </td> >- <td data-order="[% s.time | html %]"> >- <label for="result[% s.id | html %]"> >- [% s.time |$KohaDates with_hours => 1 %] >- </label> >- </td> >- <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td> >- <td>[% s.total | html %]</td> >- <td></td> >- </tr> >- [% END %] >- </tbody> >- </table> >- <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches"> >- </form> >- [% END # / IF ( previous_authority_searches )%] >- </div> >- >- [% IF !current_authority_searches && !previous_authority_searches %] >- <p>Your authority search history is empty.</p> >- [% END %] >- </div> <!-- / #authority_tab --> >- </div> <!-- /.tab-content --> >- [% END # / IF Koha.Preference( 'OpacAuthorities' ) %] >- </div> <!-- / #tabs --> >+ <div id="authority_tab" role="tabpanel" class="tab-pane" aria-labelledby="authority-tab-link"> >+ [% PROCESS authority_search_history %] >+ </div> <!-- / #authority_tab --> >+ </div> <!-- /.tab-content --> >+ </div> <!-- / #tabs --> >+ [% ELSE %] >+ [% PROCESS catalog_search_history %] >+ [% END %] > </div> <!-- / #searchhistory --> > </div> <!-- / .col-lg-10/12 --> > </div> <!-- / .row --> > </div> <!-- / .container-fluid --> > </div> <!-- / #main --> > >+[% BLOCK catalog_search_history %] >+ <div id="current_biblio"> >+ [% IF ( current_biblio_searches ) %] >+ <h2>Current session</h2> >+ <form action="/cgi-bin/koha/opac-search-history.pl" method="post"> >+ <legend class="sr-only">Toolbar control</legend> >+ >+ [% INCLUDE 'toolbar_controls' %] >+ <input type="hidden" name="action" value="delete" /> >+ <table class="historyt table table-bordered table-striped"> >+ <caption class="sr-only">Current session</caption> >+ <thead> >+ <tr> >+ <th></th> >+ <th>Date</th> >+ <th>Search</th> >+ <th>Results</th> >+ <th></th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH s IN current_biblio_searches %] >+ <tr> >+ <td class="selectcol"> >+ <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" /> >+ </td> >+ <td data-order="[% s.time | html %]"> >+ <label for="result[% s.id | html %]"> >+ [% s.time |$KohaDates with_hours => 1 %] >+ </label> >+ </td> >+ <td> >+ <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&[% s.query_cgi | $raw %]&count=[% countrss | uri %]&sort_by=acqdate_dsc&format=rss" aria-label="Subscribe to this search" class="rsssearchlink"> >+ <i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this search"></i> >+ </a> >+ <a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a> >+ </td> >+ <td>[% s.total | html %]</td> >+ <td></td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches"> >+ </form> >+ [% END # IF ( current_biblio_searches ) %] >+ </div> <!-- / #current_biblio --> >+ <hr /> >+ <div id="previous_biblio"> >+ [% IF ( previous_biblio_searches ) %] >+ <h2>Previous sessions</h2> >+ <form action="/cgi-bin/koha/opac-search-history.pl" method="post"> >+ <legend class="sr-only">Toolbar control</legend> >+ [% INCLUDE 'toolbar_controls' %] >+ >+ <input type="hidden" name="action" value="delete" /> >+ <table class="historyt table table-bordered table-striped"> >+ <caption class="sr-only">Previous sessions</caption> >+ <thead> >+ <tr> >+ <th></th> >+ <th>Date</th> >+ <th>Search</th> >+ <th>Results</th> >+ <th></th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH s IN previous_biblio_searches %] >+ <tr> >+ <td class="selectcol"> >+ <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" /> >+ </td> >+ <td data-order="[% s.time | html %]"> >+ <label for="result[% s.id | html %]"> >+ [% s.time |$KohaDates with_hours => 1 %] >+ </label> >+ </td> >+ <td> >+ <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&[% s.query_cgi | $raw %]&count=[% countrss | uri %]&sort_by=acqdate_dsc&format=rss" aria-label="Subscribe to this search" class="rsssearchlink"> >+ <i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this search"></i> >+ </a> >+ <a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi | $raw %]"> >+ [% s.query_desc | html %] >+ </a> >+ </td> >+ <td>[% s.total | html %]</td> >+ <td></td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches"> >+ </form> >+ [% END # IF ( previous_biblio_searches ) %] >+ </div> <!-- / #previous_biblio --> >+ >+ [% IF !current_biblio_searches && !previous_biblio_searches %] >+ <p>Your catalog search history is empty.</p> >+ [% END %] >+[% END %] >+ >+[% BLOCK authority_search_history %] >+ <div id="current_authority"> >+ [% IF ( current_authority_searches ) %] >+ <h2>Current session</h2> >+ <form action="/cgi-bin/koha/opac-search-history.pl" method="post"> >+ <legend class="sr-only">Toolbar control</legend> >+ [% INCLUDE 'toolbar_controls' %] >+ <input type="hidden" name="action" value="delete" /> >+ <table class="historyt table table-bordered table-striped"> >+ <caption class="sr-only">Current session</caption> >+ <thead> >+ <tr> >+ <th></th> >+ <th>Date</th> >+ <th>Search</th> >+ <th>Results</th> >+ <th></th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH s IN current_authority_searches %] >+ <tr> >+ <td class="selectcol"> >+ <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" /> >+ </td> >+ <td data-order="[% s.time | html %]"> >+ <label for="result[% s.id | html %]"> >+ [% s.time |$KohaDates with_hours => 1 %] >+ </label> >+ </td> >+ <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td> >+ <td>[% s.total | html %]</td> >+ <td></td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches"> >+ </form> >+ [% END # / IF ( current_authority_searches ) %] >+ </div> <!-- / #current_authority --> >+ <hr /> >+ <div id="previous_authority"> >+ [% IF ( previous_authority_searches ) %] >+ <h2>Previous sessions</h2> >+ <form action="/cgi-bin/koha/opac-search-history.pl" method="post"> >+ <legend class="sr-only">Toolbar control</legend> >+ [% INCLUDE 'toolbar_controls' %] >+ <input type="hidden" name="action" value="delete" /> >+ <table class="historyt table table-bordered table-striped"> >+ <caption class="sr-only">Previous sessions</caption> >+ <thead> >+ <tr> >+ <th></th> >+ <th>Date</th> >+ <th>Search</th> >+ <th>Results</th> >+ <th></th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH s IN previous_authority_searches %] >+ <tr> >+ <td class="selectcol"> >+ <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" /> >+ </td> >+ <td data-order="[% s.time | html %]"> >+ <label for="result[% s.id | html %]"> >+ [% s.time |$KohaDates with_hours => 1 %] >+ </label> >+ </td> >+ <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td> >+ <td>[% s.total | html %]</td> >+ <td></td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches"> >+ </form> >+ [% END # / IF ( previous_authority_searches )%] >+ </div> >+ >+ [% IF !current_authority_searches && !previous_authority_searches %] >+ <p>Your authority search history is empty.</p> >+ [% END %] >+[% END %] >+ > [% INCLUDE 'opac-bottom.inc' %] > > [% BLOCK toolbar_controls %] >-- >2.30.2
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 33894
:
152000
|
152001
|
152018
|
152019
|
152255
|
152256
|
152598
|
152599