Bug 18529 - Template cleanup of patron clubs pages
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / clubs / templates-add-modify.tt
blobe90a5dc192c72a34efb15a178f71fd3c76714b6d
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>
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>
31 <div id="doc" class="yui-t7">
32     <div id="bd">
33         <div class="yui-main">
34             <form method="post" class="validated">
35                 <input type="hidden" name="id" value="[% club_template.id %]" />
37                 <h2>
38                     [% IF club_template %]
39                         Modify club template <i>[% club_template.name %]</i>
40                     [% ELSE %]
41                         Create a new club template
42                     [% END %]
43                 </h2>
46                 <fieldset class="rows">
47                     <ol>
48                         <li>
49                             <label class="required" for="name">Name:</label>
50                             <input id="club-template-name" name="name" type="text" value="[% club_template.name %]" required="required"/>
51                             <span class="required">Required</span>
52                         </li>
54                         <li>
55                             <label for="description">Description:</label>
56                             <input id="club-template-description" name="description" type="text" value="[% club_template.description %]" />
57                         </li>
59                         <li>
60                             <label for="is_enrollable_from_opac">Allow public enrollment:</label>
61                             [% IF club_template.is_enrollable_from_opac %]
62                                 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" checked="checked" />
63                             [% ELSE %]
64                                 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" />
65                             [% END %]
66                             <span class="hint">If a template allows public enrollment, patrons can enroll in a club based on this template from the public catalog.</span>
67                         </li>
69                         <li>
70                             <label for="is_email_required">Require valid email address:</label>
71                             [% IF club_template.is_email_required %]
72                                 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" checked="checked" />
73                             [% ELSE %]
74                                 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" />
75                             [% END %]
76                             <span class="hint">If set, a club based on this template can only be enrolled in by patrons with a valid email address.</span>
77                         </li>
79                         <li>
80                             <label for="branchcode">Library:</label>
81                             <select name="branchcode" id="club-template-branchcode">
82                                 <option value=""></option>
83                                 [% PROCESS options_for_libraries libraries => Branches.all( selected => club_template.branchcode ) %]
84                             </select>
85                             <div class="hint">If set, only librarians logged in with this branch will be able to modify this club template.</div>
86                         </li>
88                     </ol>
89                 </fieldset>
91                 <fieldset class="rows">
92                     <legend>Club fields:</legend>
93                     <p><span class="hint">These fields will be used in the creation of clubs based on this template</span></p>
94                     <div id="club-template-fields">
95                         [% FOREACH f IN club_template.club_template_fields %]
96                             <div class="club-field">
97                                 <ol class="clearfix">
98                                     <input type="hidden" name="club_template_field_id" value="[% f.id %]" />
99                                     <li>
100                                         <label for="field-name-[% f.id %]">Name:</label>
101                                         <input name="club_template_field_name" id="field-name-[% f.id %]" value="[% f.name %]" />
102                                     </li>
104                                     <li>
105                                         <label for="field-description-[% f.id %]">Description:</label>
106                                         <input name="club_template_field_description" id="field-description-[% f.id %]" value="[% f.description %]" />
107                                     </li>
109                                     <li>
110                                         <label for="field-description-[% f.id %]">Authorised value category:</label>
111                                         <select name="club_template_field_authorised_value_category" id="field-authorised-value-category-[% f.id %]">
112                                             <option value=""></option>
113                                             [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
114                                         </select>
115                                     </li>
117                                     <li>
118                                         <label for="field-delete-[% f.id %]">Delete field:</label>
119                                         <input type="checkbox" name="club_template_field_delete" id="field-delete-[% f.id %]" value="[% f.id %]" />
120                                     </li>
121                                 </ol>
122                             </div>
123                         [% END %]
124                     </div>
125                     <fieldset class="action">
126                         <a href="#" onclick="$('#new-field-template').clone().attr('id','').show().appendTo('#club-template-fields'); return false;">
127                             <i class="fa fa-plus"></i> Add new field
128                         </a>
129                     </fieldset>
130                 </fieldset>
132                 <fieldset class="rows">
133                     <legend>Enrollment fields</legend>
134                     <p><span class="hint">These fields will be used when enrolling a patron in a club based on this template</span></p>
135                     <div id="club-template-enrollment-fields">
136                         [% FOREACH f IN club_template.club_template_enrollment_fields %]
137                             <div class="enrollment-field">
138                                 <ol class="clearfix">
139                                     <li>
140                                         <span class="label">&nbsp;</span>
141                                         <strong>Enrollment field</strong>
142                                     </li>
143                                     <li>
144                                         <input type="hidden" name="club_template_enrollment_field_id" value="[% f.id %]" />
145                                         <label for="enrollment-field-name-[% f.id %]">Name:</label>
146                                         <input name="club_template_enrollment_field_name" id="enrollment-field-name-[% f.id %]" value="[% f.name %]" size="40" />
147                                     </li>
149                                     <li>
150                                         <label for="enrollment-field-description-[% f.id %]">Description:</label>
151                                         <input name="club_template_enrollment_field_description" id="enrollment-field-description-[% f.id %]" value="[% f.description %]" size="40" />
152                                     </li>
154                                     <li>
155                                         <label for="enrollment-field-description-[% f.id %]">Authorised value category:</label>
156                                         <select name="club_template_enrollment_field_authorised_value_category" id="enrollment-field-authorised-value-category-[% f.id %]">
157                                             <option value=""></option>
158                                             [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
159                                         </select>
160                                     </li>
162                                     <li>
163                                         <label for="enrollment-field-delete-[% f.id %]">Delete field:</label>
164                                         <input type="checkbox" name="club_template_enrollment_field_delete" id="enrollment-field-delete-[% f.id %]" value="[% f.id %]" />
165                                     </li>
166                                 </ol>
167                             </div>
168                         [% END %]
169                     </div>
170                     <fieldset class="action">
171                         <a href="#" onclick="$('#new-enrollment-field-template').clone().attr('id','').show().appendTo('#club-template-enrollment-fields'); return false;">
172                             <i class="fa fa-plus"></i> Add new field
173                         </a>
174                     </fieldset>
175                 </fieldset>
177                 <fieldset class="action">
178                     <input type="hidden" name="id" value="[% club_template.id %]" />
179                     <input type="submit" value="Save" />
180                     <a href="clubs.pl" class="cancel">Cancel</a>
181                 </fieldset>
182             </form>
184         </div> <!-- /#yui-main -->
185     </div> <!-- /#bd -->
188 <div id="new-field-template" class="club-field" style="display:none">
189     <h4 style="margin-left:1em;">New club field</h4>
190     <input type="hidden" name="club_template_field_id" value="" />
191     <ol class="clearfix">
193         <li>
194             <label for="club_template_field_name">Name:</label>
195             <input name="club_template_field_name" />
196         </li>
198         <li>
199             <label for="club_template_field_description">Description:</label>
200             <input name="club_template_field_description" />
201         </li>
203         <li>
204             <label for="club_template_field_authorised_value_category">Authorised value category:</label>
205             <select name="club_template_field_authorised_value_category">
206                 <option value=""></option>
207                 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
208             </select>
209         </li>
210     </ol>
211     <fieldset class="action"><a href="#" onclick="$(this).parent().parent().remove(); return false;"><i class="fa fa-trash"></i> Delete field</a></fieldset>
212     <hr/>
213 </div>
215 <div id="new-enrollment-field-template" class="enrollment-field" style="display:none">
216     <h4 style="margin-left:1em;">New enrollment field</h4>
217     <input type="hidden" name="club_template_enrollment_field_id" value="" />
218     <ol class="clearfix">
220         <li>
221             <label for="club_template_enrollment_field_name">Name:</label>
222             <input name="club_template_enrollment_field_name" />
223         </li>
225         <li>
226             <label for="club_template_enrollment_field_description">Description:</label>
227             <input name="club_template_enrollment_field_description" />
228         </li>
230         <li>
231             <label for="club_template_enrollment_field_authorised_value_category">Authorised value category:</label>
232             <select name="club_template_enrollment_field_authorised_value_category">
233                 <option value=""></option>
234                 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
235             </select>
236         </li>
237     </ol>
238     <fieldset class="action"><a href="#" onclick="$(this).parent().parent().remove(); return false;"><i class="fa fa-trash"></i> Delete field</a></fieldset>
239     </div>
240 </div>
242 [% INCLUDE 'intranet-bottom.inc' %]