Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_field.tt
Owen Leonard d10ce467f5
Bug 34401: Fix inconsistencies in Item search fields page titles, breadcrumbs, and headers
This patch fixes some inconsistencies in the item search fields
administration page, making sure the page title, breadcrumb navigation,
and page headers are consistent with each other.

The patch makes some changes to the way new item search fields are added
in order to keep the display consistent with other similar interfaces:
The "add" form is no longer shown dynamically from the page listing item
search fields. Clicking the "New search field" toolbar button will now
take you to the same template used for editing existing search fields.
This allows us to put the correct context into page title, breadcrumbs,
and headings.

To test, apply the patch and go to Administration -> Item search fields.
Test the process of adding a new search field and editing an existing
search field.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-17 14:45:29 -03:00

90 lines
3.3 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE AuthorisedValues %]
[% PROCESS 'i18n.inc' %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% FILTER collapse %]
[% IF (field) %]
[% tx("Modify search field '{field}'", { field = field.name }) | html %]
[% ELSE %]
[% t("New search field") | html %]
[% END %] &rsaquo;
[% t("Item search fields") | html %] &rsaquo;
[% t("Administration") | html %] &rsaquo;
[% t("Koha") | html %]
[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="admin_itemssearchfields" class="admin">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'prefs-admin-search.inc' %]
[% END %]
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
[% END %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/items_search_fields.pl">Item search fields</a>
[% END %]
[% IF (field) %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% tx("Modify search field '{field}'", { field = field.name }) | html %]
[% END %]
[% ELSE %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>New search field</span>
[% END %]
[% END %]
[% END #/ WRAPPER breadcrumbs %]
[% END #/ WRAPPER sub-header.inc %]
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
<h1>
[% IF (field) %]
[% tx("Modify search field '{field}'", { field = field.name }) | html %]
[% ELSE %]
[% t("New search field") | html %]
[% END %]
</h1>
<form action="/cgi-bin/koha/admin/items_search_field.pl" method="POST" id="search_fields">
<fieldset class="rows">
[% INCLUDE 'admin-items-search-field-form.inc' field=field %]
[% IF (field) %]
<input type="hidden" name="op" value="mod" />
[% ELSE %]
<input type="hidden" name="op" value="add" />
[% END %]
</fieldset>
<fieldset class="action">
<input type="submit" class="btn btn-primary" value="Submit" />
<a class="cancel" href="/cgi-bin/koha/admin/items_search_fields.pl">Cancel</a>
</fieldset>
</form>
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'admin-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/admin-menu.js") | $raw %]
[% Asset.js("js/item_search_fields.js") | $raw %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]