Koha/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt
Owen Leonard 29387c09aa
Bug 33555: Use template wrapper for breadcrumbs: Rotating collections
This patch updates rotating collections templates so that they use the
new WRAPPER for displaying breadcrumbs.

To test, apply the patch and test each page and its variations.
Breadcrumbs should look correct, and each link should be correct.

- Tools ->
  - Rotating collections
    - New rotating collection
    - Edit collection
    - Delete collection
    - Manage items
    - Transfer collection

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-21 10:36:22 -03:00

170 lines
7.3 KiB
Text

[% USE raw %]
[% USE Asset %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>
[%- IF ( action == "new" ) %]
Add a new collection
[% ELSE %]
Edit collection [% editColTitle | html %]
[% END -%] &rsaquo; Rotating collections &rsaquo; Tools &rsaquo; Koha
</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="rcoll_editCollections" class="tools rcoll">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% END %]
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
[% END %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Rotating collections</a>
[% END %]
[%- IF ( action == "new" ) %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Add a new collection</span>
[% END %]
[% ELSIF ( action == "delete" ) %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Collection deleted</span>
[% END %]
[% ELSE %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% editColId | uri %]">Collection <em>[% editColTitle | html %]</em></a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Edit collection</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>
[% IF ( previousActionCreate ) %]
[% IF ( createSuccess ) %]
<div class="dialog message">
<p>Collection <em>[% createdTitle | html %]</em> added successfully</p>
<p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
</div>
[% ELSE %]
<div class="dialog alert">
<p>Collection <em>[% createdTitle | html %]</em> failed to be added</p>
<p>
[% IF failureMessage == "NO_TITLE" %]
<span>No title entered.</span>
[% ELSIF failureMessage == "DUPLICATE_TITLE" %]
<span>Title already in use.</span>
[% ELSIF failureMessage == "NO_DESCRIPTION" %]
<span>No description entered.</span>
[% ELSE %]
[% failureMessage | html %]
[% END %]
</p>
</div>
[% END %]
[% END %]
[% IF ( previousActionDelete ) %]
[% IF ( deleteSuccess ) %]
<div class="dialog message">
<p>Collection deleted successfully</p>
<p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
</div>
[% ELSE %]
<div class="dialog alert">Collection failed to be deleted</div>
[% END %]
[% END %]
[% IF ( previousActionUpdate ) %]
[% IF ( updateSuccess ) %]
<div class="dialog message">
<p>Collection <em>[% updatedTitle | html %]</em> updated successfully</p>
<p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
</div>
[% ELSE %]
<div class="dialog alert">
<p>Collection <em>[% updatedTitle | html %]</em> failed to be updated</p>
<p>
[% IF failureMessage == "NO_ID" %]
No collection id given.
[% ELSIF failureMessage == "DUPLICATE_TITLE" %]
Title already in use.
[% ELSE %]
[% failureMessage | html %]
[% END %]
</p>
</div>
[% END %]
[% END %]
<div>
[% IF action == "new" || action == "edit" %]
[% IF ( previousActionEdit ) %]
<h1>Edit collection <em>[% editColTitle | html %]</em></h1>
[% ELSE %]
<h1>Add new collection</h1>
[% END %]
<form action="editCollections.pl" method="post" class="validated">
[% IF ( previousActionEdit ) %]
<input type="hidden" name="action" value="update" />
<input type="hidden" name="colId" value="[% editColId | html %]" />
[% ELSE %]
<input type="hidden" name="action" value="create" />
[% END %]
<fieldset class="rows">
<ol>
<li>
<label class="required" for="title">Title: </label>
[% IF ( editColTitle ) %]
<input type="text" name="title" value="[% editColTitle | html %]" required="required" />
<span class="required">Required</span>
[% ELSE %]
<input type="text" name="title" required="required" />
<span class="required">Required</span>
[% END %]
</li>
<li>
<label for="description">Description: </label>
[% IF (editColDescription ) %]
<input type="text" size="50" name="description" value="[% editColDescription | html %]" />
[% ELSE %]
<input type="text" size="50" name="description" />
[% END %]
</li>
</ol>
</fieldset>
<fieldset class="action">
<p><input type="submit" class="btn btn-primary" value="Submit" /> <a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl" class="cancel">Cancel</a></p>
</fieldset>
</form>
[% END %]
</div>
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'tools-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/tools-menu.js") | $raw %]
[% Asset.js("js/rotating-collections.js") | $raw %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]