From 799c2df874adaefe8f765d425229a75a99417ceb Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 9 Mar 2023 15:20:21 +0000 Subject: [PATCH] Bug 33180: Use template wrapper for tabs: Budgets and Search engine configuration This patch updates two administration templates so that they use the new WRAPPER directive to build tabbed navigation: Budgets and Search engine configuration. Note: this patch includes indentation changes, so check the diff accordingly. To test, apply the patch and check the updated pages: - Administration -> Budgets - Administration -> Search engine configuration On both pages tabs should look correct and work correctly. --- .../prog/en/modules/admin/aqbudgetperiods.tt | 164 ++--- .../searchengine/elasticsearch/mappings.tt | 558 +++++++++--------- 2 files changed, 360 insertions(+), 362 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt index 78ef29164a..4c4c3aad78 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt @@ -474,89 +474,89 @@
Failed to delete budget because funds exist.
[% END %] - [% INCLUDE 'budgets-active-currency.inc' %] + [% INCLUDE 'budgets-active-currency.inc' %] + + [% WRAPPER tabs id= "budgetsTabs" %] + + [% WRAPPER tabs_nav %] + [% WRAPPER tab_item tabname= "active" bt_active= 1 %] Active budgets [% END %] + [% WRAPPER tab_item tabname= "inactive" %] Inactive budgets [% END %] + [% END # /WRAPPER tabs_nav %] + + [% WRAPPER tab_panels %] + [% WRAPPER tab_panel tabname="active" bt_active= 1 %] + [% IF ( period_active_loop ) %] + + + + + + + + + + + + + [% FOREACH period_active IN period_active_loop %] + + + + + + + + + [% END # /FOREACH period_active %] + +
Budget nameStart dateEnd dateLockedTotalActions
[% period_active.budget_period_description | html %][% period_active.budget_period_startdate | $KohaDates %][% period_active.budget_period_enddate | $KohaDates %] + [% IF ( period_active.budget_period_locked ) %] + Locked + [% END %] + [% period_active.budget_period_total | $Price %] + [% PROCESS action_menu block_budget=period_active %] +
+ [% ELSE %] + No active budgets + [% END # /IF period_active_loop %] + [% END # /WRAPPER tab_panel#active %] + + [% WRAPPER tab_panel tabname="inactive" %] + [% IF ( period_inactive_loop ) %] + + + + + + + + + + + + + [% FOREACH period_loo IN period_inactive_loop %] + + + + + + + + + [% END # /FOREACH period_loo %] + +
Budget nameStart dateEnd dateLockedTotalActions
[% period_loo.budget_period_description | html %][% period_loo.budget_period_startdate | $KohaDates %][% period_loo.budget_period_enddate | $KohaDates %][% IF ( period_loo.budget_period_locked ) %] Locked[% END %][% period_loo.budget_period_total | $Price %] + [% PROCESS action_menu block_budget=period_loo %] +
+ [% ELSE %] + No inactive budgets + [% END # /IF inactiveperiodst %] + [% END # /WRAPPER tab_panel#inactive %] + [% END # /WRAPPER tab_panels %] + [% END # /WRAPPER tabs %] -
- -
-
- [% IF ( period_active_loop ) %] - - - - - - - - - - - - - [% FOREACH period_active IN period_active_loop %] - - - - - - - - - [% END %] - -
Budget nameStart dateEnd dateLockedTotalActions
[% period_active.budget_period_description | html %][% period_active.budget_period_startdate | $KohaDates %][% period_active.budget_period_enddate | $KohaDates %] - [% IF ( period_active.budget_period_locked ) %] - Locked - [% END %] - [% period_active.budget_period_total | $Price %] - [% PROCESS action_menu block_budget=period_active %] -
- [% ELSE %] - No active budgets - [% END %] -
-
- [% IF ( period_inactive_loop ) %] - - - - - - - - - - - - - [% FOREACH period_loo IN period_inactive_loop %] - - - - - - - - - [% END %] - -
Budget nameStart dateEnd dateLockedTotalActions
[% period_loo.budget_period_description | html %][% period_loo.budget_period_startdate | $KohaDates %][% period_loo.budget_period_enddate | $KohaDates %][% IF ( period_loo.budget_period_locked ) %] Locked[% END %][% period_loo.budget_period_total | $Price %] - [% PROCESS action_menu block_budget=period_loo %] -
- [% ELSE %] - No inactive budgets - [% END %] -
-
-
-[% END %] +[% END # /IF else %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt index b0ec83750f..f0eabe5779 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt @@ -118,317 +118,314 @@ a.add, a.delete {
-
- -
-
+ [% END # /WRAPPER tabs_nav %] + + [% WRAPPER tab_panels %] + [% WRAPPER tab_panel tabname="search_fields" bt_active= 1 %] - - - - - - - - - - - - - - - - [% FOREACH search_field IN all_search_fields %] - - - - - - - + + + + + + - [% END %] - -
NameAliasesLabelTypeWeightSearchable
 Staff interfaceOPAC
- [% IF search_field.mandatory %] - - [% ELSE %] - - [% END %] - - [% search_field.aliases.join(', ') | html %] - - [% IF search_field.mandatory %] - - [% ELSE %] - - [% END %] - - [% IF search_field.mandatory %] - - - [% END %] - - [% IF search_field.type == "string" %] - - [% ELSE %] - - [% END %] - [% IF search_field.type == "date" %] - - [% ELSE %] - - [% END %] - [% IF search_field.type == "year" %] - - [% ELSE %] - - [% END %] - [% IF search_field.type == "number" %] - - [% ELSE %] - - [% END %] - [% IF search_field.type == "boolean" %] - - [% ELSE %] - - [% END %] - [% IF search_field.type == "sum" %] - - [% ELSE %] - - [% END %] - [% IF search_field.type == "isbn" %] - - [% ELSE %] - - [% END %] - [% IF search_field.type == "stdno" %] - - [% ELSE %] - - [% END %] - [% IF search_field.type == "callnumber" %] - - [% ELSE %] - - [% END %] - - - [% IF search_field.mapped_biblios %] - - [% ELSE %] - - [% END %] - - - - - NameAliasesLabelTypeWeightSearchable
-
- [% FOREACH index IN indexes %] -
- - - - - - - - - - + + + + - [% FOREACH mapping IN index.mappings %] - [% IF mapping.search_field_mandatory && mapping.search_field_label != loop.next.search_field_label && mapping.search_field_label != loop.prev.search_field_label %] + [% FOREACH search_field IN all_search_fields %] - - - + - - - [% ELSE %] - + [% END %] + +
Search fieldSortableFacetableSuggestibleSearchableMapping 
 Staff interfaceOPAC
- - - [% mapping.search_field_label | html %] + + [% IF search_field.mandatory %] + + [% ELSE %] + + [% END %] - [% IF mapping.sort == 0 %] - No - [% ELSE %] - Yes - [% END %] + [% search_field.aliases.join(', ') | html %] - [% IF mapping.facet == 1 %]Yes[% ELSE %]No[% END %] + + [% IF search_field.mandatory %] + + [% ELSE %] + + [% END %] - [% IF mapping.suggestible == 1 %]Yes[% ELSE %]No[% END %] + + [% IF search_field.mandatory %] + + + [% END %] + + [% IF search_field.type == "string" %] + + [% ELSE %] + + [% END %] + [% IF search_field.type == "date" %] + + [% ELSE %] + + [% END %] + [% IF search_field.type == "year" %] + + [% ELSE %] + + [% END %] + [% IF search_field.type == "number" %] + + [% ELSE %] + + [% END %] + [% IF search_field.type == "boolean" %] + + [% ELSE %] + + [% END %] + [% IF search_field.type == "sum" %] + + [% ELSE %] + + [% END %] + [% IF search_field.type == "isbn" %] + + [% ELSE %] + + [% END %] + [% IF search_field.type == "stdno" %] + + [% ELSE %] + + [% END %] + [% IF search_field.type == "callnumber" %] + + [% ELSE %] + + [% END %] + + [% IF search_field.mapped_biblios %] + + [% ELSE %] + + [% END %] + - [% IF mapping.search == 1 %]Yes[% ELSE %]No[% END %] + - + +  
+ [% END %] + [% FOREACH index IN indexes %] + [% WRAPPER tab_panel tabname="mapping_${ index.index_name }" %] + + + + + + + + + + + + + + [% FOREACH mapping IN index.mappings %] + [% IF mapping.search_field_mandatory && mapping.search_field_label != loop.next.search_field_label && mapping.search_field_label != loop.prev.search_field_label %] + + + + + + + + + + [% ELSE %] + + + + + + + + [% IF mapping.search_field_mandatory %] + + [% ELSE %] + + [% END %] + + [% END %] + [% END %] + + + - - [% IF mapping.search_field_mandatory %] - - [% ELSE %] - - [% END %] + + - [% END %] - [% END %] - - - - - - - - - - - - +
Search fieldSortableFacetableSuggestibleSearchableMapping 
+ + + [% mapping.search_field_label | html %] + + [% IF mapping.sort == 0 %] + No + [% ELSE %] + Yes + [% END %] + + [% IF mapping.facet == 1 %]Yes[% ELSE %]No[% END %] + + [% IF mapping.suggestible == 1 %]Yes[% ELSE %]No[% END %] + + [% IF mapping.search == 1 %]Yes[% ELSE %]No[% END %] + + +  
+ + + [% mapping.search_field_label | html %] + + + + [% IF mapping.is_facetable %] + + [% ELSE %] + + No + [% END %] + + + + + + + Delete Delete
- - - [% mapping.search_field_label | html %] + + - + - [% IF mapping.is_facetable %] - + [% IF mapping.facet %] + + + [% ELSE %] + + + [% END %] - [% ELSE %] - - No - [% END %] - + - - - + Delete Delete Add
- - - - - - - - - - - Add
[% IF index.index_name == 'biblios' %] @@ -476,10 +473,11 @@ a.add, a.delete {
[% END %] -
- [% END %] -
- + [% END # /WRAPPER tab_panel#mapping_{ index.index_name} %] + [% END # /FOREACH index %] + [% END # /WRAPPER tab_panels %] + [% END # /WRAPPER tabs %] +
-- 2.30.2