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