From 78f037382ddb111e707b42d0c1b2c125fff81c1e 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 Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../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 b7d756e723..ab0a8f9e3e 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -2457,7 +2457,6 @@ td.bundle { } } - .field_hint { color: #808080; font-style: italic; @@ -2472,23 +2471,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 394b527964..547f5b1794 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt @@ -200,24 +200,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:

@@ -250,10 +252,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 6ca01c54e0..0ca1846784 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 @@ -30,181 +30,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.39.5