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