Bug 20035: Switch single-column templates to Bootstrap grid: Patron clubs
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / clubs / templates-add-modify.tt
1 [% USE Branches %]
2 [% USE AuthorisedValues %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Tools &rsaquo; Patron clubs &rsaquo;
5     [% IF club_template %]
6         Modify club template [% club_template.name %]
7     [% ELSE %]
8         Create a new club template
9     [% END %]
10 </title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 <style type="text/css">
13     .club-field,
14     .enrollment-field {
15         border-top: 1px solid #DDD;
16     }
17 </style>
18 </head>
19
20 <body id="clubs_templates_add_modify" class="clubs">
21 [% INCLUDE 'header.inc' %]
22 [% INCLUDE 'cat-search.inc' %]
23 <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="clubs.pl">Patron clubs</a> &rsaquo;
24     [% IF club_template %]
25         Modify club template <i>[% club_template.name %]</i>
26     [% ELSE %]
27         Create a new club template
28     [% END %]
29 </div>
30
31 <div class="main container-fluid">
32     <div class="row">
33         <div class="col-md-8 col-md-offset-2">
34
35             <form method="post" class="validated">
36                 <input type="hidden" name="id" value="[% club_template.id %]" />
37
38                 <h2>
39                     [% IF club_template %]
40                         Modify club template <i>[% club_template.name %]</i>
41                     [% ELSE %]
42                         Create a new club template
43                     [% END %]
44                 </h2>
45
46
47                 <fieldset class="rows">
48                     <ol>
49                         <li>
50                             <label class="required" for="name">Name:</label>
51                             <input id="club-template-name" name="name" type="text" value="[% club_template.name %]" required="required"/>
52                             <span class="required">Required</span>
53                         </li>
54
55                         <li>
56                             <label for="club-template-description">Description:</label>
57                             <input id="club-template-description" name="description" type="text" value="[% club_template.description %]" />
58                         </li>
59
60                         <li>
61                             <label for="club-template-is-enrollable-from-opac">Allow public enrollment:</label>
62                             [% IF club_template.is_enrollable_from_opac %]
63                                 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" checked="checked" />
64                             [% ELSE %]
65                                 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" />
66                             [% END %]
67                             <span class="hint">If a template allows public enrollment, patrons can enroll in a club based on this template from the public catalog.</span>
68                         </li>
69
70                         <li>
71                             <label for="club-template-is-email-required">Require valid email address:</label>
72                             [% IF club_template.is_email_required %]
73                                 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" checked="checked" />
74                             [% ELSE %]
75                                 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" />
76                             [% END %]
77                             <span class="hint">If set, a club based on this template can only be enrolled in by patrons with a valid email address.</span>
78                         </li>
79
80                         <li>
81                             <label for="club-template-branchcode">Library:</label>
82                             <select name="branchcode" id="club-template-branchcode">
83                                 <option value=""></option>
84                                 [% PROCESS options_for_libraries libraries => Branches.all( selected => club_template.branchcode ) %]
85                             </select>
86                             <div class="hint">If set, only librarians logged in with this branch will be able to modify this club template.</div>
87                         </li>
88
89                     </ol>
90                 </fieldset>
91
92                 <fieldset class="rows">
93                     <legend>Club fields:</legend>
94                     <p><span class="hint">These fields will be used in the creation of clubs based on this template</span></p>
95                     <div id="club-template-fields">
96                         [% FOREACH f IN club_template.club_template_fields %]
97                             <div class="club-field">
98                                 <ol class="clearfix">
99                                     <input type="hidden" name="club_template_field_id" value="[% f.id %]" />
100                                     <li>
101                                         <label for="field-name-[% f.id %]">Name:</label>
102                                         <input name="club_template_field_name" id="field-name-[% f.id %]" value="[% f.name %]" />
103                                     </li>
104
105                                     <li>
106                                         <label for="field-description-[% f.id %]">Description:</label>
107                                         <input name="club_template_field_description" id="field-description-[% f.id %]" value="[% f.description %]" />
108                                     </li>
109
110                                     <li>
111                                         <label for="field-authorised-value-category-[% f.id %]">Authorised value category:</label>
112                                         <select name="club_template_field_authorised_value_category" id="field-authorised-value-category-[% f.id %]">
113                                             <option value=""></option>
114                                             [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
115                                         </select>
116                                     </li>
117
118                                     <li>
119                                         <label for="field-delete-[% f.id %]">Delete field:</label>
120                                         <input type="checkbox" name="club_template_field_delete" id="field-delete-[% f.id %]" value="[% f.id %]" />
121                                     </li>
122                                 </ol>
123                             </div>
124                         [% END %]
125                     </div>
126                     <fieldset class="action">
127                         <a href="#" onclick="$('#new-field-template').clone().attr('id','').show().appendTo('#club-template-fields'); return false;">
128                             <i class="fa fa-plus"></i> Add new field
129                         </a>
130                     </fieldset>
131                 </fieldset>
132
133                 <fieldset class="rows">
134                     <legend>Enrollment fields</legend>
135                     <p><span class="hint">These fields will be used when enrolling a patron in a club based on this template</span></p>
136                     <div id="club-template-enrollment-fields">
137                         [% FOREACH f IN club_template.club_template_enrollment_fields %]
138                             <div class="enrollment-field">
139                                 <ol class="clearfix">
140                                     <li>
141                                         <span class="label">&nbsp;</span>
142                                         <strong>Enrollment field</strong>
143                                     </li>
144                                     <li>
145                                         <input type="hidden" name="club_template_enrollment_field_id" value="[% f.id %]" />
146                                         <label for="enrollment-field-name-[% f.id %]">Name:</label>
147                                         <input name="club_template_enrollment_field_name" id="enrollment-field-name-[% f.id %]" value="[% f.name %]" size="40" />
148                                     </li>
149
150                                     <li>
151                                         <label for="enrollment-field-description-[% f.id %]">Description:</label>
152                                         <input name="club_template_enrollment_field_description" id="enrollment-field-description-[% f.id %]" value="[% f.description %]" size="40" />
153                                     </li>
154
155                                     <li>
156                                         <label for="enrollment-field-authorised-value-category-[% f.id %]">Authorised value category:</label>
157                                         <select name="club_template_enrollment_field_authorised_value_category" id="enrollment-field-authorised-value-category-[% f.id %]">
158                                             <option value=""></option>
159                                             [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
160                                         </select>
161                                     </li>
162
163                                     <li>
164                                         <label for="enrollment-field-delete-[% f.id %]">Delete field:</label>
165                                         <input type="checkbox" name="club_template_enrollment_field_delete" id="enrollment-field-delete-[% f.id %]" value="[% f.id %]" />
166                                     </li>
167                                 </ol>
168                             </div>
169                         [% END %]
170                     </div>
171                     <fieldset class="action">
172                         <a href="#" onclick="$('#new-enrollment-field-template').clone().attr('id','').show().appendTo('#club-template-enrollment-fields'); return false;">
173                             <i class="fa fa-plus"></i> Add new field
174                         </a>
175                     </fieldset>
176                 </fieldset>
177
178                 <fieldset class="action">
179                     <input type="hidden" name="id" value="[% club_template.id %]" />
180                     <input type="submit" value="Save" />
181                     <a href="clubs.pl" class="cancel">Cancel</a>
182                 </fieldset>
183             </form>
184
185         </div> <!-- /.col-md-8 .col-md-offset-2 -->
186     </div> <!-- /.row -->
187
188
189 <div id="new-field-template" class="club-field" style="display:none">
190     <h4 style="margin-left:1em;">New club field</h4>
191     <input type="hidden" name="club_template_field_id" value="" />
192     <ol class="clearfix">
193
194         <li>
195             <label for="club_template_field_name">Name:</label>
196             <input name="club_template_field_name" />
197         </li>
198
199         <li>
200             <label for="club_template_field_description">Description:</label>
201             <input name="club_template_field_description" />
202         </li>
203
204         <li>
205             <label for="club_template_field_authorised_value_category">Authorised value category:</label>
206             <select name="club_template_field_authorised_value_category">
207                 <option value=""></option>
208                 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
209             </select>
210         </li>
211     </ol>
212     <fieldset class="action"><a href="#" onclick="$(this).parent().parent().remove(); return false;"><i class="fa fa-trash"></i> Delete field</a></fieldset>
213     <hr/>
214 </div>
215
216 <div id="new-enrollment-field-template" class="enrollment-field" style="display:none">
217     <h4 style="margin-left:1em;">New enrollment field</h4>
218     <input type="hidden" name="club_template_enrollment_field_id" value="" />
219     <ol class="clearfix">
220
221         <li>
222             <label for="club_template_enrollment_field_name">Name:</label>
223             <input name="club_template_enrollment_field_name" />
224         </li>
225
226         <li>
227             <label for="club_template_enrollment_field_description">Description:</label>
228             <input name="club_template_enrollment_field_description" />
229         </li>
230
231         <li>
232             <label for="club_template_enrollment_field_authorised_value_category">Authorised value category:</label>
233             <select name="club_template_enrollment_field_authorised_value_category">
234                 <option value=""></option>
235                 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
236             </select>
237         </li>
238     </ol>
239     <fieldset class="action"><a href="#" onclick="$(this).parent().parent().remove(); return false;"><i class="fa fa-trash"></i> Delete field</a></fieldset>
240 </div>
241
242 [% INCLUDE 'intranet-bottom.inc' %]