Bug 27846: (follow-up) Add id back to breadcrumbs container
[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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
19     <ol>
20         <li>
21             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
22         </li>
23         <li>
24             <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
25         </li>
26         <li>
27             <a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Rotating collections</a>
28         </li>
29
30         [%- IF ( action == "new" ) %]
31             <li>
32                 <a href="#" aria-current="page">
33                     Add a new collection
34                 </a>
35             </li>
36         [% ELSE %]
37             <li>
38                 <a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% editColId | uri %]">Collection <em>[% editColTitle | html %]</em></a>
39             </li>
40             <li>
41                 <a href="#" aria-current="page">
42                     Edit
43                 </a>
44             </li>
45         [% END -%]
46     </ol>
47 </nav>
48
49 <div class="main container-fluid">
50     <div class="row">
51         <div class="col-sm-10 col-sm-push-2">
52             <main>
53
54               [% IF ( previousActionCreate ) %]
55                 [% IF ( createSuccess ) %]
56                     <div class="dialog message">
57                         <p>Collection <em>[% createdTitle | html %]</em> added successfully</p>
58                         <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
59                     </div>
60                 [% ELSE %]
61                   <div class="dialog alert">
62                     <p>Collection <em>[% createdTitle | html %]</em> failed to be added</p>
63                     <p>
64                         [% IF failureMessage == "NO_TITLE" %]
65                             No title entered.
66                         [% ELSIF failureMessage == "DUPLICATE_TITLE" %]
67                             Title already in use.
68                         [% ELSIF failureMessage == "NO_DESCRIPTION" %]
69                             No description entered.
70                         [% ELSE %]
71                             [% failureMessage | html %]
72                         [% END %]
73                     </p>
74                   </div>
75                 [% END %]
76               [% END %]
77
78               [% IF ( previousActionDelete ) %]
79                 [% IF ( deleteSuccess ) %]
80                   <div class="dialog message">
81                     <p>Collection deleted successfully</p>
82                     <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
83                   </div>
84                 [% ELSE %]
85                   <div class="dialog alert">Collection failed to be deleted</div>
86                 [% END %]
87               [% END %]
88
89               [% IF ( previousActionUpdate ) %]
90                 [% IF ( updateSuccess ) %]
91                   <div class="dialog message">
92                       <p>Collection <em>[% updatedTitle | html %]</em> updated successfully</p>
93                       <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
94                   </div>
95                 [% ELSE %]
96                   <div class="dialog alert">
97                     <p>Collection <em>[% updatedTitle | html %]</em> failed to be updated</p>
98                     <p>
99                         [% IF failureMessage == "NO_ID" %]
100                             No collection id given.
101                         [% ELSIF failureMessage == "DUPLICATE_TITLE" %]
102                             Title already in use.
103                         [% ELSE %]
104                             [% failureMessage | html %]
105                         [% END %]
106                     </p>
107                 </div>
108                 [% END %]
109               [% END %]
110
111               <div>
112
113                 [% IF action == "new" || action == "edit" %]
114                     [% IF ( previousActionEdit ) %]
115                       <h1>Edit collection <em>[% editColTitle | html %]</em></h1>
116                     [% ELSE %]
117                       <h1>Add new collection</h1>
118                     [% END %]
119
120                     <form action="editCollections.pl" method="post" class="validated">
121                         [% IF ( previousActionEdit ) %]
122                             <input type="hidden" name="action" value="update" />
123                             <input type="hidden" name="colId" value="[% editColId | html %]" />
124                         [% ELSE %]
125                             <input type="hidden" name="action" value="create" />
126                         [% END %]
127
128                         <fieldset class="rows">
129                             <ol>
130                                 <li>
131                                     <label class="required" for="title">Title: </label>
132                                     [% IF ( editColTitle ) %]
133                                         <input type="text" name="title" value="[% editColTitle | html %]" required="required" />
134                                         <span class="required">Required</span>
135                                     [% ELSE %]
136                                         <input type="text" name="title" required="required" />
137                                         <span class="required">Required</span>
138                                     [% END %]
139                                 </li>
140                                 <li>
141                                     <label for="description">Description: </label>
142                                     [% IF (editColDescription ) %]
143                                         <input type="text" size="50" name="description" value="[% editColDescription | html %]" />
144                                     [% ELSE %]
145                                         <input type="text" size="50" name="description" />
146                                     [% END %]
147                                 </li>
148                             </ol>
149                         </fieldset>
150                         <fieldset class="action">
151                             <p><input type="submit" value="Submit" /> <a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl" class="cancel">Cancel</a></p>
152                         </fieldset>
153                     </form>
154                 [% END %]
155               </div>
156
157             </main>
158         </div> <!-- /.col-sm-10.col-sm-push-2 -->
159
160         <div class="col-sm-2 col-sm-pull-10">
161             <aside>
162                 [% INCLUDE 'tools-menu.inc' %]
163             </aside>
164         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
165      </div> <!-- /.row -->
166
167 [% MACRO jsinclude BLOCK %]
168     [% Asset.js("js/tools-menu.js") | $raw %]
169     [% Asset.js("js/rotating-collections.js") | $raw %]
170 [% END %]
171
172 [% INCLUDE 'intranet-bottom.inc' %]