Bug 30952: Staff interface redesign (header)
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / clubs / clubs-add-modify.tt
1 [% USE KohaDates %]
2 [% USE Branches %]
3 [% USE AuthorisedValues %]
4 [% SET AuthorisedValuesCategories = AuthorisedValues.GetCategories %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>
8     [% IF club %]
9         Modify club [% club.name | html %]
10     [% ELSE %]
11         Create a new [% club_template.name | html %] club
12     [% END %] &rsaquo; Patron clubs &rsaquo; Tools &rsaquo; Koha
13 </title>
14 [% INCLUDE 'doc-head-close.inc' %]
15 </head>
16
17 <body id="clubs_add_modify" class="clubs">
18 [% WRAPPER 'header.inc' %]
19     [% INCLUDE 'cat-search.inc' %]
20 [% END %]
21
22 [% WRAPPER 'sub-header.inc' %]
23 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
24     <ol>
25         <li>
26             <a href="/cgi-bin/koha/mainpage.pl"><i class="fa fa-home"></i></a>
27         </li>
28         <li>
29             <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
30         </li>
31         <li>
32             <a href="clubs.pl">Patron clubs</a>
33         </li>
34         <li>
35             <a href="#" aria-current="page">
36                 [% IF club %]
37                     Modify club <em>[% club.name | html %]</em>
38                 [% ELSE %]
39                     Create a new <em>[% club_template.name | html %]</em> club
40                 [% END %]
41             </a>
42         </li>
43     </ol>
44 </nav>
45 [% END %]
46
47 <div class="main container-fluid">
48     <div class="row">
49         <div class="col-md-8 col-md-offset-2">
50
51             <form method="post" class="validated">
52                 <input type="hidden" name="id" value="[% club.id | html %]" />
53                 <input type="hidden" name="club_template_id" value="[% club_template.id | html %]" />
54
55                 <fieldset class="rows">
56
57                     <legend>
58                         <h1>
59                             [% IF club %]
60                                 Modify club <em>[% club.name | html %]</em>
61                             [% ELSE %]
62                                 Create a new <em>[% club_template.name | html %]</em> club
63                             [% END %]
64                         </h1>
65                     </legend>
66
67                     <ol>
68                         <li>
69                             <label class="required" for="club-name">Name:</label>
70                             <input id="club-name" name="name" type="text" value="[% club.name | html %]" required="required"/>
71                             <span class="required">Required</span>
72                         </li>
73
74                         <li>
75                             <label for="club-template-name">Description:</label>
76                             <input id="club-template-name" name="description" type="text" value="[% club.description | html %]" size="40" />
77                         </li>
78
79                         <li>
80                             <label for="from">Start date:</label>
81                             <input name="date_start" id="from" size="10" class="flatpickr" data-date_to="to" value="[% club.date_start | html %]">
82                         </li>
83
84                         <li>
85                             <label for="to">End date:</label>
86                             <input name="date_end" id="to" size="10" class="flatpickr" value="[% club.date_end | html %]" >
87                         </li>
88
89                         <li>
90                             <label for="club-template-branchcode">Library:</label>
91                             <select name="branchcode" id="club-template-branchcode">
92                                 <option value=""></option>
93                                 [% PROCESS options_for_libraries libraries => Branches.all( selected => club.branch.branchcode ) %]
94                             </select>
95                         </li>
96
97                         [% IF club %]
98                             [% FOREACH f IN club.club_fields %]
99                                 <li>
100                                     <input type="hidden" name="club_template_field_id" value="[% f.club_template_field.id | html %]" />
101                                     <input type="hidden" name="club_field_id" value="[% f.id | html %]" />
102
103                                     <label for="club_field_[% f.club_template_field_id | html %]">[% f.club_template_field.name | html %]</label>
104                                     [% IF f.club_template_field.authorised_value_category %]
105                                         <select name="club_field" id="club_field_[% f.club_template_field_id | html %]">
106                                             [% FOREACH a IN AuthorisedValues.Get( f.club_template_field.authorised_value_category ) %]
107                                                 [% IF a.authorised_value == f.value %]
108                                                     <option value="[% a.authorised_value | html %]" selected="selected">[% a.lib | html %]</option>
109                                                 [% ELSE %]
110                                                     <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
111                                                 [% END %]
112                                             [% END %]
113                                         </select>
114                                     [% ELSE %]
115                                         <input type="text" name="club_field" id="club_field_[% f.club_template_field_id | html %]" value="[% f.value | html %]" size="40" />
116                                     [% END %]
117                                 </li>
118                             [% END %]
119                         [% ELSE %]
120                             [% FOREACH f IN club_template.club_template_fields %]
121                                 <li>
122                                     <input type="hidden" name="club_template_field_id" value="[% f.id | html %]" />
123
124                                     <label for="club_template_field_[% f.id | html %]">[% f.name | html %]</label>
125                                     [% IF f.authorised_value_category %]
126                                         <select name="club_field" id="club_template_field_[% f.id | html %]">
127                                             [% FOREACH a IN AuthorisedValues.Get( f.authorised_value_category ) %]
128                                                 <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
129                                             [% END %]
130                                         </select>
131                                     [% ELSE %]
132                                         <input type="text" name="club_field" id="club_template_field_[% f.id | html %]" size="40" />
133                                     [% END %]
134                                 </li>
135                             [% END %]
136                         [% END %]
137
138                     </ol>
139
140                 </fieldset>
141
142                 <fieldset class="action">
143                     <input type="submit" value="Save" />
144                     <a href="clubs.pl" class="cancel">Cancel</a>
145                 </fieldset>
146             </form>
147         </div>
148     </div>
149
150 [% MACRO jsinclude BLOCK %]
151     [% INCLUDE 'calendar.inc' %]
152 [% END %]
153
154 [% INCLUDE 'intranet-bottom.inc' %]