From cf0a6eb1ab0cdcf7d622ee1938bcd7d5555e14e5 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. Signed-off-by: Matt Blenkinsop Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit c74696b33313097fec9bcee92c8e4f072a9ed611) Signed-off-by: Jacob O'Mara --- .../prog/en/modules/admin/aqbudgetperiods.tt | 164 ++--- .../searchengine/elasticsearch/mappings.tt | 562 +++++++++--------- 2 files changed, 362 insertions(+), 364 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 658223345f..283334f2db 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,319 +118,316 @@ 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_name | html %] - [% IF mapping.search_field_label != mapping.search_field_name %] ([% mapping.search_field_label | html %])[% END %] + + [% 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_name | html %] + [% IF mapping.search_field_label != mapping.search_field_name %] ([% mapping.search_field_label | html %])[% END %] + + [% 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_name | html %] + [% IF mapping.search_field_label != mapping.search_field_name %] ([% mapping.search_field_label | html %])[% END %] + + + + [% IF mapping.is_facetable %] + + [% ELSE %] + + No + [% END %] + + + + + + + Delete Delete
- - - [% mapping.search_field_name | html %] - [% IF mapping.search_field_label != mapping.search_field_name %] ([% mapping.search_field_label | html %])[% END %] + + - + - [% IF mapping.is_facetable %] - + [% IF mapping.facet %] + + + [% ELSE %] + + + [% END %] - [% ELSE %] - - No - [% END %] - + - - - + Delete Delete Add
- - - - - - - - - - - Add
[% IF index.index_name == 'biblios' %] @@ -478,10 +475,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.39.5