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