Koha/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt
Owen Leonard 027daeff56 Bug 20035: Switch single-column templates to Bootstrap grid: Patron clubs
This patch updates two single-column Patron clubs templates to
use the Bootstrap grid.

- clubs/clubs-add-modify.tt - Tools -> Patron clubs -> New club.
- clubs/templates-add-modify.tt - Tools -> Patron clubs -> New club
  template. Also changed in this file: Markup corrections. Label "for"
  attribute should match the form field's id attribute.

Each of these pages should look correct, with a single centered column
with wide margins on either side. At lower browser widths the margins
should disappear.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-15 13:30:23 -03:00

242 lines
13 KiB
Text

[% USE Branches %]
[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Tools &rsaquo; Patron clubs &rsaquo;
[% IF club_template %]
Modify club template [% club_template.name %]
[% ELSE %]
Create a new club template
[% END %]
</title>
[% INCLUDE 'doc-head-close.inc' %]
<style type="text/css">
.club-field,
.enrollment-field {
border-top: 1px solid #DDD;
}
</style>
</head>
<body id="clubs_templates_add_modify" class="clubs">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<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;
[% IF club_template %]
Modify club template <i>[% club_template.name %]</i>
[% ELSE %]
Create a new club template
[% END %]
</div>
<div class="main container-fluid">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<form method="post" class="validated">
<input type="hidden" name="id" value="[% club_template.id %]" />
<h2>
[% IF club_template %]
Modify club template <i>[% club_template.name %]</i>
[% ELSE %]
Create a new club template
[% END %]
</h2>
<fieldset class="rows">
<ol>
<li>
<label class="required" for="name">Name:</label>
<input id="club-template-name" name="name" type="text" value="[% club_template.name %]" required="required"/>
<span class="required">Required</span>
</li>
<li>
<label for="club-template-description">Description:</label>
<input id="club-template-description" name="description" type="text" value="[% club_template.description %]" />
</li>
<li>
<label for="club-template-is-enrollable-from-opac">Allow public enrollment:</label>
[% IF club_template.is_enrollable_from_opac %]
<input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" checked="checked" />
[% ELSE %]
<input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" />
[% END %]
<span class="hint">If a template allows public enrollment, patrons can enroll in a club based on this template from the public catalog.</span>
</li>
<li>
<label for="club-template-is-email-required">Require valid email address:</label>
[% IF club_template.is_email_required %]
<input type="checkbox" id="club-template-is-email-required" name="is_email_required" checked="checked" />
[% ELSE %]
<input type="checkbox" id="club-template-is-email-required" name="is_email_required" />
[% END %]
<span class="hint">If set, a club based on this template can only be enrolled in by patrons with a valid email address.</span>
</li>
<li>
<label for="club-template-branchcode">Library:</label>
<select name="branchcode" id="club-template-branchcode">
<option value=""></option>
[% PROCESS options_for_libraries libraries => Branches.all( selected => club_template.branchcode ) %]
</select>
<div class="hint">If set, only librarians logged in with this branch will be able to modify this club template.</div>
</li>
</ol>
</fieldset>
<fieldset class="rows">
<legend>Club fields:</legend>
<p><span class="hint">These fields will be used in the creation of clubs based on this template</span></p>
<div id="club-template-fields">
[% FOREACH f IN club_template.club_template_fields %]
<div class="club-field">
<ol class="clearfix">
<input type="hidden" name="club_template_field_id" value="[% f.id %]" />
<li>
<label for="field-name-[% f.id %]">Name:</label>
<input name="club_template_field_name" id="field-name-[% f.id %]" value="[% f.name %]" />
</li>
<li>
<label for="field-description-[% f.id %]">Description:</label>
<input name="club_template_field_description" id="field-description-[% f.id %]" value="[% f.description %]" />
</li>
<li>
<label for="field-authorised-value-category-[% f.id %]">Authorised value category:</label>
<select name="club_template_field_authorised_value_category" id="field-authorised-value-category-[% f.id %]">
<option value=""></option>
[% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
</select>
</li>
<li>
<label for="field-delete-[% f.id %]">Delete field:</label>
<input type="checkbox" name="club_template_field_delete" id="field-delete-[% f.id %]" value="[% f.id %]" />
</li>
</ol>
</div>
[% END %]
</div>
<fieldset class="action">
<a href="#" onclick="$('#new-field-template').clone().attr('id','').show().appendTo('#club-template-fields'); return false;">
<i class="fa fa-plus"></i> Add new field
</a>
</fieldset>
</fieldset>
<fieldset class="rows">
<legend>Enrollment fields</legend>
<p><span class="hint">These fields will be used when enrolling a patron in a club based on this template</span></p>
<div id="club-template-enrollment-fields">
[% FOREACH f IN club_template.club_template_enrollment_fields %]
<div class="enrollment-field">
<ol class="clearfix">
<li>
<span class="label">&nbsp;</span>
<strong>Enrollment field</strong>
</li>
<li>
<input type="hidden" name="club_template_enrollment_field_id" value="[% f.id %]" />
<label for="enrollment-field-name-[% f.id %]">Name:</label>
<input name="club_template_enrollment_field_name" id="enrollment-field-name-[% f.id %]" value="[% f.name %]" size="40" />
</li>
<li>
<label for="enrollment-field-description-[% f.id %]">Description:</label>
<input name="club_template_enrollment_field_description" id="enrollment-field-description-[% f.id %]" value="[% f.description %]" size="40" />
</li>
<li>
<label for="enrollment-field-authorised-value-category-[% f.id %]">Authorised value category:</label>
<select name="club_template_enrollment_field_authorised_value_category" id="enrollment-field-authorised-value-category-[% f.id %]">
<option value=""></option>
[% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
</select>
</li>
<li>
<label for="enrollment-field-delete-[% f.id %]">Delete field:</label>
<input type="checkbox" name="club_template_enrollment_field_delete" id="enrollment-field-delete-[% f.id %]" value="[% f.id %]" />
</li>
</ol>
</div>
[% END %]
</div>
<fieldset class="action">
<a href="#" onclick="$('#new-enrollment-field-template').clone().attr('id','').show().appendTo('#club-template-enrollment-fields'); return false;">
<i class="fa fa-plus"></i> Add new field
</a>
</fieldset>
</fieldset>
<fieldset class="action">
<input type="hidden" name="id" value="[% club_template.id %]" />
<input type="submit" value="Save" />
<a href="clubs.pl" class="cancel">Cancel</a>
</fieldset>
</form>
</div> <!-- /.col-md-8 .col-md-offset-2 -->
</div> <!-- /.row -->
<div id="new-field-template" class="club-field" style="display:none">
<h4 style="margin-left:1em;">New club field</h4>
<input type="hidden" name="club_template_field_id" value="" />
<ol class="clearfix">
<li>
<label for="club_template_field_name">Name:</label>
<input name="club_template_field_name" />
</li>
<li>
<label for="club_template_field_description">Description:</label>
<input name="club_template_field_description" />
</li>
<li>
<label for="club_template_field_authorised_value_category">Authorised value category:</label>
<select name="club_template_field_authorised_value_category">
<option value=""></option>
[% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
</select>
</li>
</ol>
<fieldset class="action"><a href="#" onclick="$(this).parent().parent().remove(); return false;"><i class="fa fa-trash"></i> Delete field</a></fieldset>
<hr/>
</div>
<div id="new-enrollment-field-template" class="enrollment-field" style="display:none">
<h4 style="margin-left:1em;">New enrollment field</h4>
<input type="hidden" name="club_template_enrollment_field_id" value="" />
<ol class="clearfix">
<li>
<label for="club_template_enrollment_field_name">Name:</label>
<input name="club_template_enrollment_field_name" />
</li>
<li>
<label for="club_template_enrollment_field_description">Description:</label>
<input name="club_template_enrollment_field_description" />
</li>
<li>
<label for="club_template_enrollment_field_authorised_value_category">Authorised value category:</label>
<select name="club_template_enrollment_field_authorised_value_category">
<option value=""></option>
[% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
</select>
</li>
</ol>
<fieldset class="action"><a href="#" onclick="$(this).parent().parent().remove(); return false;"><i class="fa fa-trash"></i> Delete field</a></fieldset>
</div>
[% INCLUDE 'intranet-bottom.inc' %]