Bug 34188: Require Library Branch Selection when Logging in
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / rotating_collections / editCollections.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% PROCESS 'i18n.inc' %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>[% FILTER collapse %]
7     [% IF ( action == "new" ) %]
8         [% t("Add a new collection") | html %]
9     [% ELSIF ( action == "delete" ) %]
10         [% t("Collection deleted") | html %]
11     [% ELSE %]
12         [% t("Edit collection") | html %] &rsaquo;
13         [% tx("Collection '{collection_title}'", { collection_title = editColTitle }) | html %]
14     [% END %] &rsaquo;
15     [% t("Rotating collections") | html %] &rsaquo;
16     [% t("Tools") | html %] &rsaquo;
17     [% t("Koha") | html %]
18 [% END %]</title>
19 [% INCLUDE 'doc-head-close.inc' %]
20 </head>
21 <body id="rcoll_editCollections" class="tools rcoll">
22 [% WRAPPER 'header.inc' %]
23     [% INCLUDE 'cat-search.inc' %]
24 [% END %]
25
26 [% WRAPPER 'sub-header.inc' %]
27     [% WRAPPER breadcrumbs %]
28         [% WRAPPER breadcrumb_item %]
29             <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
30         [% END %]
31         [% WRAPPER breadcrumb_item %]
32             <a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Rotating collections</a>
33         [% END %]
34
35         [%- IF ( action == "new" ) %]
36             [% WRAPPER breadcrumb_item bc_active= 1 %]
37                 <span>Add a new collection</span>
38             [% END %]
39         [% ELSIF ( action == "delete" ) %]
40             [% WRAPPER breadcrumb_item bc_active= 1 %]
41                 <span>Collection deleted</span>
42             [% END %]
43         [% ELSE %]
44             [% WRAPPER breadcrumb_item %]
45                 <a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% editColId | uri %]">[% tx("Collection '{collection_title}'", { collection_title = editColTitle }) | html %]</em></a>
46             [% END %]
47             [% WRAPPER breadcrumb_item bc_active= 1 %]
48                 [% t("Edit collection") | html %]
49             [% END %]
50         [% END -%]
51     [% END #/ WRAPPER breadcrumbs %]
52 [% END #/ WRAPPER sub-header.inc %]
53
54 <div class="main container-fluid">
55     <div class="row">
56         <div class="col-sm-10 col-sm-push-2">
57             <main>
58
59               [% IF ( previousActionCreate ) %]
60                 [% IF ( createSuccess ) %]
61                     <div class="dialog message">
62                         <p>Collection <em>[% createdTitle | html %]</em> added successfully</p>
63                         <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
64                     </div>
65                 [% ELSE %]
66                   <div class="dialog alert">
67                     <p>Collection <em>[% createdTitle | html %]</em> failed to be added</p>
68                     <p>
69                         [% IF failureMessage == "NO_TITLE" %]
70                             <span>No title entered.</span>
71                         [% ELSIF failureMessage == "DUPLICATE_TITLE" %]
72                             <span>Title already in use.</span>
73                         [% ELSIF failureMessage == "NO_DESCRIPTION" %]
74                             <span>No description entered.</span>
75                         [% ELSE %]
76                             [% failureMessage | html %]
77                         [% END %]
78                     </p>
79                   </div>
80                 [% END %]
81               [% END %]
82
83               [% IF ( previousActionDelete ) %]
84                 [% IF ( deleteSuccess ) %]
85                   <div class="dialog message">
86                     <p>Collection deleted successfully</p>
87                     <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
88                   </div>
89                 [% ELSE %]
90                   <div class="dialog alert">Collection failed to be deleted</div>
91                 [% END %]
92               [% END %]
93
94               [% IF ( previousActionUpdate ) %]
95                 [% IF ( updateSuccess ) %]
96                   <div class="dialog message">
97                       <p>Collection <em>[% updatedTitle | html %]</em> updated successfully</p>
98                       <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
99                   </div>
100                 [% ELSE %]
101                   <div class="dialog alert">
102                     <p>Collection <em>[% updatedTitle | html %]</em> failed to be updated</p>
103                     <p>
104                         [% IF failureMessage == "NO_ID" %]
105                             No collection id given.
106                         [% ELSIF failureMessage == "DUPLICATE_TITLE" %]
107                             Title already in use.
108                         [% ELSE %]
109                             [% failureMessage | html %]
110                         [% END %]
111                     </p>
112                 </div>
113                 [% END %]
114               [% END %]
115
116               <div>
117
118                 [% IF action == "new" || action == "edit" %]
119                     [% IF ( previousActionEdit ) %]
120                       <h1>Edit collection <em>[% editColTitle | html %]</em></h1>
121                     [% ELSE %]
122                       <h1>Add new collection</h1>
123                     [% END %]
124
125                     <form action="editCollections.pl" method="post" class="validated">
126                         [% IF ( previousActionEdit ) %]
127                             <input type="hidden" name="action" value="update" />
128                             <input type="hidden" name="colId" value="[% editColId | html %]" />
129                         [% ELSE %]
130                             <input type="hidden" name="action" value="create" />
131                         [% END %]
132
133                         <fieldset class="rows">
134                             <ol>
135                                 <li>
136                                     <label class="required" for="title">Title: </label>
137                                     [% IF ( editColTitle ) %]
138                                         <input type="text" name="title" value="[% editColTitle | html %]" required="required" />
139                                         <span class="required">Required</span>
140                                     [% ELSE %]
141                                         <input type="text" name="title" required="required" />
142                                         <span class="required">Required</span>
143                                     [% END %]
144                                 </li>
145                                 <li>
146                                     <label for="description">Description: </label>
147                                     [% IF (editColDescription ) %]
148                                         <input type="text" size="50" name="description" value="[% editColDescription | html %]" />
149                                     [% ELSE %]
150                                         <input type="text" size="50" name="description" />
151                                     [% END %]
152                                 </li>
153                             </ol>
154                         </fieldset>
155                         <fieldset class="action">
156                             <p><input type="submit" class="btn btn-primary" value="Submit" /> <a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl" class="cancel">Cancel</a></p>
157                         </fieldset>
158                     </form>
159                 [% END %]
160               </div>
161
162             </main>
163         </div> <!-- /.col-sm-10.col-sm-push-2 -->
164
165         <div class="col-sm-2 col-sm-pull-10">
166             <aside>
167                 [% INCLUDE 'tools-menu.inc' %]
168             </aside>
169         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
170      </div> <!-- /.row -->
171
172 [% MACRO jsinclude BLOCK %]
173     [% Asset.js("js/tools-menu.js") | $raw %]
174     [% Asset.js("js/rotating-collections.js") | $raw %]
175 [% END %]
176
177 [% INCLUDE 'intranet-bottom.inc' %]