Bug 21454: Remove html filter for Price filtered variables
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / cities.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Administration &rsaquo; [% IF op =='add_form' %]Cities &rsaquo; [% IF city.cityid %] Modify city[% ELSE %] New city[% END %][% ELSE %][% IF op == 'delete_confirm' %]Cities &rsaquo; Confirm deletion of city[% ELSE %] Cities[% END %][% END %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% Asset.css("css/datatables.css") | $raw %]
8 </head>
9
10 <body id="admin_cities" class="admin">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'cities-admin-search.inc' %]
13
14 <div id="breadcrumbs">
15     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
16     &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
17     &rsaquo; <a href="/cgi-bin/koha/admin/cities.pl">Cities</a>
18     [% IF op == 'add_form' %]
19     &rsaquo; [% IF city.cityid %]Modify[% ELSE %]New[% END %] City
20     [% ELSIF op == 'delete_confirm' %]
21     &rsaquo; Confirm deletion of city
22     [% END %]
23 </div>
24
25 <div class="main container-fluid">
26     <div class="row">
27         <div class="col-sm-10 col-sm-push-2">
28             <main>
29
30 [% FOR m IN messages %]
31     <div class="dialog [% m.type | html %]">
32         [% SWITCH m.code %]
33         [% CASE 'error_on_update' %]
34             An error occurred when updating this city. Perhaps it already exists.
35         [% CASE 'error_on_insert' %]
36             An error occurred when adding this city. The city id might already exist.
37         [% CASE 'error_on_delete' %]
38             An error occurred when deleting this city. Check the logs.
39         [% CASE 'success_on_update' %]
40             City updated successfully.
41         [% CASE 'success_on_insert' %]
42             City added successfully.
43         [% CASE 'success_on_delete' %]
44             City deleted successfully.
45         [% CASE 'already_exists' %]
46             This city already exists.
47         [% CASE %]
48             [% m.code | html %]
49         [% END %]
50     </div>
51 [% END %]
52
53 [% IF op == 'add_form' %]
54     [% IF city %]
55         <h1>Modify a city</h1>
56     [% ELSE %]
57         <h1>New city</h1>
58     [% END %]
59
60     <form action="/cgi-bin/koha/admin/cities.pl" name="Aform" method="post" class="validated">
61         <input type="hidden" name="op" value="add_validate" />
62         <input type="hidden" name="cityid" value="[% city.cityid | html %]" />
63
64         <fieldset class="rows">
65             <ol>
66                 [% IF city %]
67                     <li><span class="label">City ID: </span>[% city.cityid | html %]</li>
68                 [% END %]
69                 <li>
70                     <label for="city_name" class="required">City: </label>
71                     <input type="text" name="city_name" id="city_name" size="80" maxlength="100" value="[% city.city_name | html %]" required="required" class="required" /> <span class="required">Required</span>
72                 </li>
73                 <li>
74                     <label for="city_state">State: </label>
75                     <input type="text" name="city_state" id="city_state" size="80" maxlength="100" value="[% city.city_state | html %]" />
76                 </li>
77                 <li>
78                     <label for="city_zipcode" class="required">ZIP/Postal code: </label>
79                     <input type="text" name="city_zipcode" id="city_zipcode" size="20" maxlength="20" value="[% city.city_zipcode | html %]" required="required" class="required" /> <span class="required">Required</span>
80                 </li>
81                 <li>
82                     <label for="city_country">Country: </label>
83                     <input type="text" name="city_country" id="city_country" size="80" maxlength="100" value="[% city.city_country | html %]" />
84                 </li>
85             </ol>
86         </fieldset>
87
88         <fieldset class="action">
89             <input type="submit" value="Submit" />
90             <a class="cancel" href="/cgi-bin/koha/admin/cities.pl">Cancel</a>
91         </fieldset>
92     </form>
93 [% END %]
94
95 [% IF op == 'delete_confirm' %]
96     <div class="dialog alert">
97         <h3>Delete city "[% city.city_name | html %]?"</h3>
98         <table>
99             <tr><th>City id</th>
100                 <td>[% city.cityid | html %]</td>
101             </tr>
102             <tr><th>City</th>
103                 <td>[% city.city_name | html %]</td>
104             </tr>
105             <tr><th>State</th>
106                 <td>[% city.city_state | html %]</td>
107             </tr>
108             <tr><th>ZIP/Postal code</th>
109                 <td>[% city.city_zipcode | html %]</td>
110             </tr>
111             <tr><th>Country</th>
112                 <td>[% city.city_country | html %]</td>
113             </tr>
114         </table>
115         <form action="/cgi-bin/koha/admin/cities.pl" method="post">
116             <input type="hidden" name="op" value="delete_confirmed" />
117             <input type="hidden" name="cityid" value="[% city.cityid | html %]" />
118             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
119         </form>
120         <form action="/cgi-bin/koha/admin/cities.pl" method="get">
121             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
122         </form>
123     </div>
124 [% END %]
125
126 [% IF op == 'list' %]
127
128     <div id="toolbar" class="btn-toolbar">
129         <a class="btn btn-default btn-sm" id="newcity" href="/cgi-bin/koha/admin/cities.pl?op=add_form"><i class="fa fa-plus"></i> New city</a>
130     </div>
131
132     <h2>Cities</h2>
133     [% IF searchfield %]
134         Searching: [% searchfield | html %]
135     [% END %]
136
137     [% IF cities.count %]
138         <table id="table_cities">
139             <thead>
140                 <tr>
141                     <th>City ID</th>
142                     <th>City</th>
143                     <th>State</th>
144                     <th>ZIP/Postal code</th>
145                     <th>Country</th>
146                     <th>Actions</th>
147                 </tr>
148             </thead>
149             <tbody>
150                 [% FOREACH city IN cities %]
151                 <tr>
152                     <td>[% city.cityid | html %]</td>
153                     <td>[% city.city_name | html %]</td>
154                     <td>[% city.city_state | html %]</td>
155                     <td>[% city.city_zipcode | html %]</td>
156                     <td>[% city.city_country | html %]</td>
157                     <td class="actions">
158                         <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/cities.pl?op=add_form&amp;cityid=[% city.cityid | html %]"><i class="fa fa-pencil"></i> Edit</a>
159                         <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/cities.pl?op=delete_confirm&amp;cityid=[% city.cityid | html %]"><i class="fa fa-trash"></i> Delete</a>
160                     </td>
161                 </tr>
162                 [% END %]
163             </tbody>
164         </table>
165     [% ELSE %]
166         <div class="dialog message">
167             There are no cities defined. <a href="/cgi-bin/koha/admin/cities.pl?op=add_form">Create a new city</a>.
168         </div>
169     [% END %]
170 [% END %]
171
172             </main>
173         </div> <!-- /.col-sm-10.col-sm-push-2 -->
174
175         <div class="col-sm-2 col-sm-pull-10">
176             <aside>
177                 [% INCLUDE 'admin-menu.inc' %]
178             </aside>
179         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
180      </div> <!-- /.row -->
181
182 [% MACRO jsinclude BLOCK %]
183     [% Asset.js("js/admin-menu.js") | $raw %]
184     [% INCLUDE 'datatables.inc' %]
185     <script>
186         $(document).ready(function() {
187             $("#table_cities").dataTable($.extend(true, {}, dataTablesDefaults, {
188                 "aoColumnDefs": [
189                     { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
190                 ],
191                 "aaSorting": [[ 1, "asc" ]],
192                 "iDisplayLength": 10,
193                 "sPaginationType": "full_numbers"
194             }));
195         });
196     </script>
197 [% END %]
198 [% INCLUDE 'intranet-bottom.inc' %]