From 17314c68cb836dc8236398039ee727767d05e762 Mon Sep 17 00:00:00 2001 From: Owen Leonard 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. Signed-off-by: Matt Blenkinsop --- .../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 9b1534fdbdb..68dec5883ef 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -2452,7 +2452,6 @@ td.bundle { } } - .field_hint { color: #808080; font-style: italic; @@ -2467,23 +2466,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 f966029aa61..ab9ffcb0da8 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 @@ -
- + [% END # /WRAPPER tabs_nav %] -
+ [% WRAPPER tab_panels %] [% FOREACH advsearchloo IN advancedsearchesloop %] -
+ [% WRAPPER tab_panel tabname="advsearch-tab-${advsearchloo.advanced_search_type}" %]

Limit to any of the following:

@@ -257,10 +259,10 @@ [% END # /IF ( loop.last ) %] [% END # /FOREACH itemtypeloo %]
-
+ [% END # tab_panel/#advsearch-... %] [% END # /FOREACH advsearchloo %] -
-
+ [% END # /WRAPPER tab_panels %] + [% END # /WRAPPER tabs %] [% 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 e1295ff5e20..b60866cbde4 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 @@

Search history

-
- -
-
- [% IF ( current_biblio_searches ) %] -

Current session

-
-

- Select all visible rows - | - Clear selection on visible rows - | - - Select searches to: - Delete - -

- - - - - - - - - - - - [% FOREACH s IN current_biblio_searches %] + + [% WRAPPER tabs id= "tabs" %] + [% WRAPPER tabs_nav %] + [% WRAPPER tab_item tabname= "biblio_tab" bt_active= 1 %] Catalog [% END %] + [% WRAPPER tab_item tabname= "authority_tab" %] Authority [% END %] + [% END # /WRAPPER tabs_nav %] + + [% WRAPPER tab_panels %] + [% WRAPPER tab_panel tabname="biblio_tab" bt_active= 1 %] + [% IF ( current_biblio_searches ) %] +

Current session

+ +

+ Select all visible rows + | + Clear selection on visible rows + | + + Select searches to: + Delete + +

+ +
DateSearchResults
+ - - - - + + + + - [% END %] - -
[% s.time |$KohaDates with_hours => 1 %][% s.query_desc | html %][% s.total | html %]DateSearchResults
-
- [% END %] + + + [% FOREACH s IN current_biblio_searches %] + + + [% s.time |$KohaDates with_hours => 1 %] + [% s.query_desc | html %] + [% s.total | html %] + + [% END %] + + + + [% END %] - [% IF ( current_biblio_searches && previous_biblio_searches) %] -
- [% END %] + [% IF ( current_biblio_searches && previous_biblio_searches) %] +
+ [% END %] - [% IF ( previous_biblio_searches ) %] -

Previous sessions

-
-

- Select all visible rows - | - Clear selection on visible rows - | - - Select searches to: - Delete - -

- - - - - - - - - - - - [% FOREACH s IN previous_biblio_searches %] + [% IF ( previous_biblio_searches ) %] +

Previous sessions

+ +

+ Select all visible rows + | + Clear selection on visible rows + | + + Select searches to: + Delete + +

+ +
DateSearchResults
+ - - - - + + + + - [% END %] - -
[% s.time |$KohaDates with_hours => 1 %][% s.query_desc | html %][% s.total | html %]DateSearchResults
-
- [% END %] + + + [% FOREACH s IN previous_biblio_searches %] + + + [% s.time |$KohaDates with_hours => 1 %] + [% s.query_desc | html %] + [% s.total | html %] + + [% END %] + + + + [% END %] - [% IF !current_biblio_searches && !previous_biblio_searches %] -

Your catalog search history is empty.

- [% END %] -
+ [% IF !current_biblio_searches && !previous_biblio_searches %] +

Your catalog search history is empty.

+ [% END %] + [% END # /tab_panel#biblio_tab %] -
- [% IF ( current_authority_searches ) %] -

Current session

-
-

- Select all visible rows - | - Clear selection on visible rows - | - - Select searches to: - Delete - -

- - - - - - - - - - - - [% FOREACH s IN current_authority_searches %] + [% WRAPPER tab_panel tabname="authority_tab" %] + [% IF ( current_authority_searches ) %] +

Current session

+ +

+ Select all visible rows + | + Clear selection on visible rows + | + + Select searches to: + Delete + +

+ +
DateSearchResults
+ - - - - + + + + - [% END %] - -
[% s.time |$KohaDates with_hours => 1 %][% s.query_desc | html %][% s.total | html %]DateSearchResults
-
- [% END %] + + + [% FOREACH s IN current_authority_searches %] + + + [% s.time |$KohaDates with_hours => 1 %] + [% s.query_desc | html %] + [% s.total | html %] + + [% END %] + + + + [% END %] - [% IF ( current_authority_searches && previous_authority_searches) %] -
- [% END %] + [% IF ( current_authority_searches && previous_authority_searches) %] +
+ [% END %] - [% IF ( previous_authority_searches ) %] -

Previous sessions

-
-

- Select all visible rows - | - Clear selection on visible rows - | - - Select searches to: - Delete - -

- - - - - - - - - - - - [% FOREACH s IN previous_authority_searches %] + [% IF ( previous_authority_searches ) %] +

Previous sessions

+ +

+ Select all visible rows + | + Clear selection on visible rows + | + + Select searches to: + Delete + +

+ +
DateSearchResults
+ - - - - + + + + - [% END %] - -
[% s.time |$KohaDates with_hours => 1 %][% s.query_desc | html %][% s.total | html %]DateSearchResults
-
- [% END %] + + + [% FOREACH s IN previous_authority_searches %] + + + [% s.time |$KohaDates with_hours => 1 %] + [% s.query_desc | html %] + [% s.total | html %] + + [% END %] + + + + [% END %] + + [% IF !current_authority_searches && !previous_authority_searches %] +

Your authority search history is empty.

+ [% END %] + [% END # /tab_panel#authority_tab %] + [% END # /WRAPPER tab_panels %] + [% END # /WRAPPER tabs %] - [% IF !current_authority_searches && !previous_authority_searches %] -

Your authority search history is empty.

- [% END %] -
[% # /authority_tab %] -
-
[% # /tabs %]
[% # /div.col-md-8 %] [% # /div.row %] -- 2.37.1 (Apple Git-137.1)