Bug 19656: Move rotating collections templates JS to the footer
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / rotating_collections / editCollections.tt
blobcb0e7297b92bd5152d805bef910656a042c24aee
1 [% SET footerjs = 1 %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Tools &rsaquo; Rotating collections &rsaquo;
4     [%- IF ( action == "new" ) %]
5         Add a new collection
6     [% ELSE %]
7         Edit collection [% editColTitle %]
8     [% END -%]
9 </title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 </head>
12 <body id="rcoll_editCollections" class="tools rcoll">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'cat-search.inc' %]
16 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Rotating collections</a> &rsaquo;
17     [%- IF ( action == "new" ) %]
18         Add a new collection
19     [% ELSE %]
20         <a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% editColId %]">Collection <i>[% editColTitle %]</i></a> &rsaquo; Edit
21     [% END -%]
22 </div>
24 <div id="doc3" class="yui-t2">
25     <div id="bd">
26         <div id="yui-main">
27             <div class="yui-b">
29               [% IF ( previousActionCreate ) %]
30                 [% IF ( createSuccess ) %]
31                     <div class="dialog message">
32                         <p>Collection <i>[% createdTitle %]</i> added successfully</p>
33                         <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
34                     </div>
35                 [% ELSE %]
36                   <div class="dialog alert">
37                     <p>Collection <i>[% createdTitle %]</i> failed to be added</p>
38                     <p>
39                         [% IF failureMessage == "NO_TITLE" %]
40                             No title entered.
41                         [% ELSIF failureMessage == "DUPLICATE_TITLE" %]
42                             Title already in use.
43                         [% ELSIF failureMessage == "NO_DESCRIPTION" %]
44                             No description entered.
45                         [% ELSE %]
46                             [% failureMessage %]
47                         [% END %]
48                     </p>
49                   </div>
50                 [% END %]
51               [% END %]
53               [% IF ( previousActionDelete ) %]
54                 [% IF ( deleteSuccess ) %]
55                   <div class="dialog message">
56                     <p>Collection deleted successfully</p>
57                     <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
58                   </div>
59                 [% ELSE %]
60                   <div class="dialog alert">Collection failed to be deleted</div>
61                 [% END %]
62               [% END %]
64               [% IF ( previousActionUpdate ) %]
65                 [% IF ( updateSuccess ) %]
66                   <div class="dialog message">
67                       <p>Collection <i>[% updatedTitle %]</i> updated successfully</p>
68                       <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
69                   </div>
70                 [% ELSE %]
71                   <div class="dialog alert">
72                     <p>Collection <i>[% updatedTitle %]</i> failed to be updated</p>
73                     <p>
74                         [% IF failureMessage == "NO_ID" %]
75                             No collection id given.
76                         [% ELSIF failureMessage == "DUPLICATE_TITLE" %]
77                             Title already in use.
78                         [% ELSE %]
79                             [% failureMessage %]
80                         [% END %]
81                     </p>
82                 </div>
83                 [% END %]
84               [% END %]
86               <div>
88                 [% IF action == "new" || action == "edit" %]
89                     [% IF ( previousActionEdit ) %]
90                       <h1>Edit collection <i>[% editColTitle %]</i></h1>
91                     [% ELSE %]
92                       <h1>Add new collection</h1>
93                     [% END %]
95                     <form action="editCollections.pl" method="post" class="validated">
96                         [% IF ( previousActionEdit ) %]
97                             <input type="hidden" name="action" value="update" />
98                             <input type="hidden" name="colId" value="[% editColId %]" />
99                         [% ELSE %]
100                             <input type="hidden" name="action" value="create" />
101                         [% END %]
103                         <fieldset class="rows">
104                             <ol>
105                                 <li>
106                                     <label class="required" for="title">Title: </label>
107                                     [% IF ( editColTitle ) %]
108                                         <input type="text" name="title" value="[% editColTitle %]" required="required" />
109                                         <span class="required">Required</span>
110                                     [% ELSE %]
111                                         <input type="text" name="title" required="required" />
112                                         <span class="required">Required</span>
113                                     [% END %]
114                                 </li>
115                                 <li>
116                                     <label for="description">Description: </label>
117                                     [% IF (editColDescription ) %]
118                                         <input type="text" size="50" name="description" value="[% editColDescription %]" />
119                                     [% ELSE %]
120                                         <input type="text" size="50" name="description" />
121                                     [% END %]
122                                 </li>
123                             </ol>
124                         </fieldset>
125                         <fieldset class="action">
126                             <p><input type="submit" value="Submit" /> <a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl" class="cancel">Cancel</a></p>
127                         </fieldset>
128                     </form>
129                 [% END %]
130               </div>
132             </div> <!-- /.yui-b -->
133         </div> <!-- /#yui-main -->
134         <div class="yui-b">
135             [% INCLUDE 'tools-menu.inc' %]
136         </div>
137     </div> <!-- /#bd -->
139 [% MACRO jsinclude BLOCK %]
140     <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script>
141     <script type="text/javascript" src="[% interface %]/[% theme %]/js/rotating-collections.js"></script>
142 [% END %]
144 [% INCLUDE 'intranet-bottom.inc' %]