Koha/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt
Jonathan Druart a3c0c92508
Bug 34478: Add missing CSRF token to POST forms
This is the result of
  % perl csrf_add_missing_csrf.pl

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2024-03-01 10:55:57 +01:00

179 lines
7.8 KiB
Text

[% USE raw %]
[% USE Asset %]
[% PROCESS 'i18n.inc' %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% FILTER collapse %]
[% IF ( action == "new" ) %]
[% t("Add a new collection") | html %]
[% ELSIF ( action == "delete" ) %]
[% t("Collection deleted") | html %]
[% ELSE %]
[% t("Edit collection") | html %] &rsaquo;
[% tx("Collection '{collection_title}'", { collection_title = editColTitle }) | html %]
[% END %] &rsaquo;
[% t("Rotating collections") | html %] &rsaquo;
[% t("Tools") | html %] &rsaquo;
[% t("Koha") | html %]
[% END %]</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 %]">[% tx("Collection '{collection_title}'", { collection_title = editColTitle }) | html %]</em></a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% t("Edit collection") | html %]
[% 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>
[% INCLUDE 'messages.inc' %]
[% 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">
[% INCLUDE 'csrf-token.inc' %]
[% 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' %]