Bugzilla – Attachment 148026 Details for
Bug 33186
Use template wrapper for tabs on search history and advanced search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33186: Use template wrapper for tabs on search history and advanced search
Bug-33186-Use-template-wrapper-for-tabs-on-search-.patch (text/plain), 29.04 KB, created by
Owen Leonard
on 2023-03-09 18:59:24 UTC
(
hide
)
Description:
Bug 33186: Use template wrapper for tabs on search history and advanced search
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-03-09 18:59:24 UTC
Size:
29.04 KB
patch
obsolete
>From 7a856ff4f4b15a367a0e715a32f6d3d58b405bbc Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 9 Mar 2023 18:47:04 +0000 >Subject: [PATCH] Bug 33186: Use template wrapper for tabs on search history > and advanced search > >This patch updates the search history and advanced search templates in >the staff interface so that they use the new WRAPPER directive for >building tabs. > >The patch also makes a minor change to CSS in order to accommodate the >different markup. > >To test, apply the patch and rebuild the staff interface CSS. > >- Go to the catalog's advanced search page. You should see tabs for each > of the selections defined in the AdvancedSearchTypes system > preference. >- The tabs should look correct and work correctly. >- If necessary, enable the EnableSearchHistory system preference. >- Click the logged-in user name in the header menu and choose "Search > history." >- On this page you should see two tabs, catalog and authority. Both tabs > should look correct and work correctly. >--- > .../prog/css/src/staff-global.scss | 29 +- > .../prog/en/modules/catalogue/advsearch.tt | 36 +- > .../en/modules/catalogue/search-history.tt | 323 +++++++++--------- > 3 files changed, 196 insertions(+), 192 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >index fd0b6531b3..e537dd03b6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >@@ -2451,7 +2451,6 @@ td.bundle { > } > } > >- > .field_hint { > color: #808080; > font-style: italic; >@@ -2466,23 +2465,23 @@ td.bundle { > width: 50%; > } > >-.advsearch { >- margin: 0 1em 1em 0; >+#advsearches { >+ margin-bottom: 1em; > >- table { >- border-collapse: separate; >- border-spacing: 5px; >- border-width: 0; >- } >+ .tab-pane { >+ margin: 0 1em 1em 0; > >- td { >- border: 1px solid #EEE; >- padding: .3em .4em; >- } >-} >+ table { >+ border-collapse: separate; >+ border-spacing: 5px; >+ border-width: 0; >+ } > >-#advsearches { >- margin-bottom: 1em; >+ td { >+ border: 1px solid #EEE; >+ padding: .3em .4em; >+ } >+ } > } > > #circ_circulation_issue { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >index f966029aa6..ab9ffcb0da 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >@@ -207,24 +207,26 @@ > </div> <!-- /#advanced-search --> > > <!-- MC-TYPE LIMITS --> >- <div id="advsearches" class="toptabs"> >- <ul class="nav nav-tabs" role="tablist"> >+ [% WRAPPER tabs id= "advsearches" %] >+ [% WRAPPER tabs_nav %] > [% FOREACH advsearchloo IN advancedsearchesloop %] >- <li role="presentation" id="advsearch-tab-[% advsearchloo.advanced_search_type | html %]"> >- <a href="#advsearch-[% advsearchloo.advanced_search_type | uri %]" aria-controls="advsearch-[% advsearchloo.advanced_search_type | uri %]" role="tab" data-toggle="tab"> >- [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]<span>Item type</span> >- [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]<span>Collection</span> >- [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]<span>Shelving location</span> >- [% ELSE %]<span>Something else</span> >- [% END %] >- </a> >- </li> >+ [% WRAPPER tab_item tabname= "advsearch-tab-${advsearchloo.advanced_search_type}" %] >+ [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %] >+ <span>Item type</span> >+ [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %] >+ <span>Collection</span> >+ [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %] >+ <span>Shelving location</span> >+ [% ELSE %] >+ <span>Something else</span> >+ [% END %] >+ [% END # /tab_item#advsearch-tab-... %] > [% END # /FOREACH advsearchloo %] >- </ul> >+ [% END # /WRAPPER tabs_nav %] > >- <div class="tab-content"> >+ [% WRAPPER tab_panels %] > [% FOREACH advsearchloo IN advancedsearchesloop %] >- <div id="advsearch-[% advsearchloo.advanced_search_type | html %]" role="tabpanel" class="tab-pane advsearch"> >+ [% WRAPPER tab_panel tabname="advsearch-tab-${advsearchloo.advanced_search_type}" %] > <h4>Limit to any of the following:</h4> > <table> > <tr> >@@ -257,10 +259,10 @@ > [% END # /IF ( loop.last ) %] > [% END # /FOREACH itemtypeloo %] > </table> >- </div> <!-- /#advsearch-[% advsearchloo.advanced_search_type | html %] --> >+ [% END # tab_panel/#advsearch-... %] > [% END # /FOREACH advsearchloo %] >- </div> <!-- /.tab-content --> >- </div> <!-- /#advsearches --> >+ [% END # /WRAPPER tab_panels %] >+ [% END # /WRAPPER tabs %] > <!-- /MC-TYPE LIMIT --> > > [% IF ( expanded_options ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt >index e1295ff5e2..b60866cbde 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt >@@ -37,181 +37,184 @@ > <div class="col-sm-12 col-md-8 col-md-offset-2"> > > <h1>Search history</h1> >- <div id="tabs" class="toptabs"> >- <ul class="nav nav-tabs" role="tablist"> >- <li role="presentation" class="active"><a href="#biblio_tab" aria-controls="biblio_tab" role="tab" data-toggle="tab">Catalog</a></li> >- <li role="presentation"><a href="#authority_tab" aria-controls="authority_tab" role="tab" data-toggle="tab">Authority</a></li> >- </ul> >- <div class="tab-content"> >- <div role="tabpanel" class="tab-pane active" id="biblio_tab"> >- [% IF ( current_biblio_searches ) %] >- <h2>Current session</h2> >- <form id="current_cat" action="/cgi-bin/koha/catalogue/search-history.pl" method="post"> >- <p class="selections-toolbar"> >- <a class="CheckAll" data-form="current_cat" href="#"><i class="fa fa-check"></i> Select all visible rows</a> >- <span class="sep">|</span> >- <a class="CheckNone" data-form="current_cat" href="#"><i class="fa fa-remove"></i> Clear selection on visible rows</a> >- <span class="sep">|</span> >- <span class="links"> >- <span class="selections">Select searches to: </span> >- <a href="#" class="btn btn-default btn-xs action_delete disabled"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a> >- </span> >- </p> >- <input type="hidden" name="action" value="delete" /> >- <table class="historyt"> >- <thead> >- <tr> >- <th></th> >- <th>Date</th> >- <th>Search</th> >- <th>Results</th> >- </tr> >- </thead> >- <tbody> >- [% FOREACH s IN current_biblio_searches %] >+ >+ [% WRAPPER tabs id= "tabs" %] >+ [% WRAPPER tabs_nav %] >+ [% WRAPPER tab_item tabname= "biblio_tab" bt_active= 1 %] <span>Catalog</span> [% END %] >+ [% WRAPPER tab_item tabname= "authority_tab" %] <span>Authority</span> [% END %] >+ [% END # /WRAPPER tabs_nav %] >+ >+ [% WRAPPER tab_panels %] >+ [% WRAPPER tab_panel tabname="biblio_tab" bt_active= 1 %] >+ [% IF ( current_biblio_searches ) %] >+ <h2>Current session</h2> >+ <form id="current_cat" action="/cgi-bin/koha/catalogue/search-history.pl" method="post"> >+ <p class="selections-toolbar"> >+ <a class="CheckAll" data-form="current_cat" href="#"><i class="fa fa-check"></i> Select all visible rows</a> >+ <span class="sep">|</span> >+ <a class="CheckNone" data-form="current_cat" href="#"><i class="fa fa-remove"></i> Clear selection on visible rows</a> >+ <span class="sep">|</span> >+ <span class="links"> >+ <span class="selections">Select searches to: </span> >+ <a href="#" class="btn btn-default btn-xs action_delete disabled"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a> >+ </span> >+ </p> >+ <input type="hidden" name="action" value="delete" /> >+ <table class="historyt"> >+ <thead> > <tr> >- <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td> >- <td data-order="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</td> >- <td><a href="/cgi-bin/koha/catalogue/search.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td> >- <td>[% s.total | html %]</td> >+ <th></th> >+ <th>Date</th> >+ <th>Search</th> >+ <th>Results</th> > </tr> >- [% END %] >- </tbody> >- </table> >- </form> >- [% END %] >+ </thead> >+ <tbody> >+ [% FOREACH s IN current_biblio_searches %] >+ <tr> >+ <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td> >+ <td data-order="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</td> >+ <td><a href="/cgi-bin/koha/catalogue/search.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td> >+ <td>[% s.total | html %]</td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ </form> >+ [% END %] > >- [% IF ( current_biblio_searches && previous_biblio_searches) %] >- <hr /> >- [% END %] >+ [% IF ( current_biblio_searches && previous_biblio_searches) %] >+ <hr /> >+ [% END %] > >- [% IF ( previous_biblio_searches ) %] >- <h2>Previous sessions</h2> >- <form id="previous_cat" action="/cgi-bin/koha/catalogue/search-history.pl" method="post"> >- <p class="selections-toolbar"> >- <a class="CheckAll" data-form="previous_cat" href="#"><i class="fa fa-check"></i> Select all visible rows</a> >- <span class="sep">|</span> >- <a class="CheckNone" data-form="previous_cat" href="#"><i class="fa fa-remove"></i> Clear selection on visible rows</a> >- <span class="sep">|</span> >- <span class="links"> >- <span class="selections">Select searches to: </span> >- <a href="#" class="btn btn-default btn-xs action_delete disabled"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a> >- </span> >- </p> >- <input type="hidden" name="action" value="delete" /> >- <table class="historyt"> >- <thead> >- <tr> >- <th></th> >- <th>Date</th> >- <th>Search</th> >- <th>Results</th> >- </tr> >- </thead> >- <tbody> >- [% FOREACH s IN previous_biblio_searches %] >+ [% IF ( previous_biblio_searches ) %] >+ <h2>Previous sessions</h2> >+ <form id="previous_cat" action="/cgi-bin/koha/catalogue/search-history.pl" method="post"> >+ <p class="selections-toolbar"> >+ <a class="CheckAll" data-form="previous_cat" href="#"><i class="fa fa-check"></i> Select all visible rows</a> >+ <span class="sep">|</span> >+ <a class="CheckNone" data-form="previous_cat" href="#"><i class="fa fa-remove"></i> Clear selection on visible rows</a> >+ <span class="sep">|</span> >+ <span class="links"> >+ <span class="selections">Select searches to: </span> >+ <a href="#" class="btn btn-default btn-xs action_delete disabled"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a> >+ </span> >+ </p> >+ <input type="hidden" name="action" value="delete" /> >+ <table class="historyt"> >+ <thead> > <tr> >- <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td> >- <td data-order="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</td> >- <td><a href="/cgi-bin/koha/catalogue/search.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td> >- <td>[% s.total | html %]</td> >+ <th></th> >+ <th>Date</th> >+ <th>Search</th> >+ <th>Results</th> > </tr> >- [% END %] >- </tbody> >- </table> >- </form> >- [% END %] >+ </thead> >+ <tbody> >+ [% FOREACH s IN previous_biblio_searches %] >+ <tr> >+ <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td> >+ <td data-order="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</td> >+ <td><a href="/cgi-bin/koha/catalogue/search.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td> >+ <td>[% s.total | html %]</td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ </form> >+ [% END %] > >- [% IF !current_biblio_searches && !previous_biblio_searches %] >- <p>Your catalog search history is empty.</p> >- [% END %] >- </div> <!-- /#biblio_tab --> >+ [% IF !current_biblio_searches && !previous_biblio_searches %] >+ <p>Your catalog search history is empty.</p> >+ [% END %] >+ [% END # /tab_panel#biblio_tab %] > >- <div id="authority_tab" role="tabpanel" class="tab-pane"> >- [% IF ( current_authority_searches ) %] >- <h2>Current session</h2> >- <form id="current_auth" action="/cgi-bin/koha/catalogue/search-history.pl" method="post"> >- <p class="selections-toolbar"> >- <a class="CheckAll" data-form="current_auth" href="#"><i class="fa fa-check"></i> Select all visible rows</a> >- <span class="sep">|</span> >- <a class="CheckNone" data-form="current_auth" href="#"><i class="fa fa-remove"></i> Clear selection on visible rows</a> >- <span class="sep">|</span> >- <span class="links"> >- <span class="selections">Select searches to: </span> >- <a href="#" class="btn btn-default btn-xs action_delete disabled"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a> >- </span> >- </p> >- <input type="hidden" name="action" value="delete" /> >- <table class="historyt"> >- <thead> >- <tr> >- <th></th> >- <th>Date</th> >- <th>Search</th> >- <th>Results</th> >- </tr> >- </thead> >- <tbody> >- [% FOREACH s IN current_authority_searches %] >+ [% WRAPPER tab_panel tabname="authority_tab" %] >+ [% IF ( current_authority_searches ) %] >+ <h2>Current session</h2> >+ <form id="current_auth" action="/cgi-bin/koha/catalogue/search-history.pl" method="post"> >+ <p class="selections-toolbar"> >+ <a class="CheckAll" data-form="current_auth" href="#"><i class="fa fa-check"></i> Select all visible rows</a> >+ <span class="sep">|</span> >+ <a class="CheckNone" data-form="current_auth" href="#"><i class="fa fa-remove"></i> Clear selection on visible rows</a> >+ <span class="sep">|</span> >+ <span class="links"> >+ <span class="selections">Select searches to: </span> >+ <a href="#" class="btn btn-default btn-xs action_delete disabled"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a> >+ </span> >+ </p> >+ <input type="hidden" name="action" value="delete" /> >+ <table class="historyt"> >+ <thead> > <tr> >- <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td> >- <td data-order="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</td> >- <td><a href="/cgi-bin/koha/authorities/authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td> >- <td>[% s.total | html %]</td> >+ <th></th> >+ <th>Date</th> >+ <th>Search</th> >+ <th>Results</th> > </tr> >- [% END %] >- </tbody> >- </table> >- </form> >- [% END %] >+ </thead> >+ <tbody> >+ [% FOREACH s IN current_authority_searches %] >+ <tr> >+ <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td> >+ <td data-order="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</td> >+ <td><a href="/cgi-bin/koha/authorities/authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td> >+ <td>[% s.total | html %]</td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ </form> >+ [% END %] > >- [% IF ( current_authority_searches && previous_authority_searches) %] >- <hr /> >- [% END %] >+ [% IF ( current_authority_searches && previous_authority_searches) %] >+ <hr /> >+ [% END %] > >- [% IF ( previous_authority_searches ) %] >- <h2>Previous sessions</h2> >- <form id="previous_auth" action="/cgi-bin/koha/catalogue/search-history.pl" method="post"> >- <p class="selections-toolbar"> >- <a class="CheckAll" data-form="previous_auth" href="#"><i class="fa fa-check"></i> Select all visible rows</a> >- <span class="sep">|</span> >- <a class="CheckNone" data-form="previous_auth" href="#"><i class="fa fa-remove"></i> Clear selection on visible rows</a> >- <span class="sep">|</span> >- <span class="links"> >- <span class="selections">Select searches to: </span> >- <a href="#" class="btn btn-default btn-xs action_delete disabled"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a> >- </span> >- </p> >- <input type="hidden" name="action" value="delete" /> >- <table class="historyt"> >- <thead> >- <tr> >- <th></th> >- <th>Date</th> >- <th>Search</th> >- <th>Results</th> >- </tr> >- </thead> >- <tbody> >- [% FOREACH s IN previous_authority_searches %] >+ [% IF ( previous_authority_searches ) %] >+ <h2>Previous sessions</h2> >+ <form id="previous_auth" action="/cgi-bin/koha/catalogue/search-history.pl" method="post"> >+ <p class="selections-toolbar"> >+ <a class="CheckAll" data-form="previous_auth" href="#"><i class="fa fa-check"></i> Select all visible rows</a> >+ <span class="sep">|</span> >+ <a class="CheckNone" data-form="previous_auth" href="#"><i class="fa fa-remove"></i> Clear selection on visible rows</a> >+ <span class="sep">|</span> >+ <span class="links"> >+ <span class="selections">Select searches to: </span> >+ <a href="#" class="btn btn-default btn-xs action_delete disabled"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a> >+ </span> >+ </p> >+ <input type="hidden" name="action" value="delete" /> >+ <table class="historyt"> >+ <thead> > <tr> >- <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td> >- <td data-order="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</td> >- <td><a href="/cgi-bin/koha/authorities/authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td> >- <td>[% s.total | html %]</td> >+ <th></th> >+ <th>Date</th> >+ <th>Search</th> >+ <th>Results</th> > </tr> >- [% END %] >- </tbody> >- </table> >- </form> >- [% END %] >+ </thead> >+ <tbody> >+ [% FOREACH s IN previous_authority_searches %] >+ <tr> >+ <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td> >+ <td data-order="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</td> >+ <td><a href="/cgi-bin/koha/authorities/authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td> >+ <td>[% s.total | html %]</td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ </form> >+ [% END %] >+ >+ [% IF !current_authority_searches && !previous_authority_searches %] >+ <p>Your authority search history is empty.</p> >+ [% END %] >+ [% END # /tab_panel#authority_tab %] >+ [% END # /WRAPPER tab_panels %] >+ [% END # /WRAPPER tabs %] > >- [% IF !current_authority_searches && !previous_authority_searches %] >- <p>Your authority search history is empty.</p> >- [% END %] >- </div> [% # /authority_tab %] >- </div> <!-- /.tab-content --> >- </div> [% # /tabs %] > </div> [% # /div.col-md-8 %] > </div> [% # /div.row %] > >-- >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 33186
:
148026
|
148127
|
149322