4 [% INCLUDE 'doc-head-open.inc' %]
6 [% IF op =='add_form' %]
11 [% END %] › [% ELSE %]
12 [% IF op == 'delete_confirm' %]
13 Confirm deletion of city › [% END %]
15 Cities › Administration › Koha
17 [% INCLUDE 'doc-head-close.inc' %]
20 <body id="admin_cities" class="admin">
21 [% INCLUDE 'header.inc' %]
22 [% INCLUDE 'cities-admin-search.inc' %]
24 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
27 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
30 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
33 [% IF op == 'add_form' %]
35 <a href="/cgi-bin/koha/admin/cities.pl">Cities</a>
38 <a href="#" aria-current="page">
47 [% ELSIF op == 'delete_confirm' %]
49 <a href="/cgi-bin/koha/admin/cities.pl">Cities</a>
52 <a href="#" aria-current="page">
53 Confirm deletion of city
59 <a href="#" aria-current="page">
67 <div class="main container-fluid">
69 <div class="col-sm-10 col-sm-push-2">
72 [% FOR m IN messages %]
73 <div class="dialog [% m.type | html %]">
75 [% CASE 'error_on_update' %]
76 An error occurred when updating this city. Perhaps it already exists.
77 [% CASE 'error_on_insert' %]
78 An error occurred when adding this city. The city id might already exist.
79 [% CASE 'error_on_delete' %]
80 An error occurred when deleting this city. Check the logs.
81 [% CASE 'success_on_update' %]
82 City updated successfully.
83 [% CASE 'success_on_insert' %]
84 City added successfully.
85 [% CASE 'success_on_delete' %]
86 City deleted successfully.
87 [% CASE 'already_exists' %]
88 This city already exists.
95 [% IF op == 'add_form' %]
97 <h1>Modify a city</h1>
102 <form action="/cgi-bin/koha/admin/cities.pl" name="Aform" method="post" class="validated">
103 <input type="hidden" name="op" value="add_validate" />
104 <input type="hidden" name="cityid" value="[% city.cityid | html %]" />
106 <fieldset class="rows">
109 <li><span class="label">City ID: </span>[% city.cityid | html %]</li>
112 <label for="city_name" class="required">City: </label>
113 <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>
116 <label for="city_state">State: </label>
117 <input type="text" name="city_state" id="city_state" size="80" maxlength="100" value="[% city.city_state | html %]" />
120 <label for="city_zipcode" class="required">ZIP/Postal code: </label>
121 <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>
124 <label for="city_country">Country: </label>
125 <input type="text" name="city_country" id="city_country" size="80" maxlength="100" value="[% city.city_country | html %]" />
130 <fieldset class="action">
131 <input type="submit" value="Submit" />
132 <a class="cancel" href="/cgi-bin/koha/admin/cities.pl">Cancel</a>
137 [% IF op == 'delete_confirm' %]
138 <div class="dialog alert">
139 <h3>Delete city "[% city.city_name | html %]?"</h3>
142 <td>[% city.cityid | html %]</td>
145 <td>[% city.city_name | html %]</td>
148 <td>[% city.city_state | html %]</td>
150 <tr><th>ZIP/Postal code</th>
151 <td>[% city.city_zipcode | html %]</td>
154 <td>[% city.city_country | html %]</td>
157 <form action="/cgi-bin/koha/admin/cities.pl" method="post">
158 <input type="hidden" name="op" value="delete_confirmed" />
159 <input type="hidden" name="cityid" value="[% city.cityid | html %]" />
160 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
162 <form action="/cgi-bin/koha/admin/cities.pl" method="get">
163 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
168 [% IF op == 'list' %]
170 <div id="toolbar" class="btn-toolbar">
171 <a class="btn btn-default" id="newcity" href="/cgi-bin/koha/admin/cities.pl?op=add_form"><i class="fa fa-plus"></i> New city</a>
175 [% IF city_name_filter %]
176 Searching: [% city_name_filter | html %]
179 [% IF cities_count > 0 %]
180 <div class="table_cities_table_controls"></div>
181 <table id="table_cities">
187 <th>ZIP/Postal code</th>
189 <th data-class-name="actions noExport">Actions</th>
194 <div class="dialog message">
195 There are no cities defined. <a href="/cgi-bin/koha/admin/cities.pl?op=add_form">Create a new city</a>.
201 </div> <!-- /.col-sm-10.col-sm-push-2 -->
203 <div class="col-sm-2 col-sm-pull-10">
205 [% INCLUDE 'admin-menu.inc' %]
207 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
208 </div> <!-- /.row -->
210 [% MACRO jsinclude BLOCK %]
211 [% Asset.js("js/admin-menu.js") | $raw %]
212 [% INCLUDE 'datatables.inc' %]
215 $(document).ready(function() {
216 var cities_table_url = '/api/v1/cities?';
218 [% IF city_name_filter %]
219 var city_name_filter = {
221 "like": '%[%- city_name_filter | html -%]%'
224 cities_table_url += 'q='+ encodeURIComponent(JSON.stringify(city_name_filter));
227 var cities_table = $("#table_cities").api({
229 "url": cities_table_url
231 "order": [[ 1, "asc" ]],
233 "targets": [0,1,2,3,4],
234 "render": function (data, type, row, meta) {
235 if ( type == 'display' ) {
236 return data.escapeHtml();
258 "data": "postal_code",
268 "data": function( row, type, val, meta ) {
270 var result = '<a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/admin/cities.pl?op=add_form&cityid='+ encodeURIComponent(row.city_id) +'"><i class="fa fa-pencil" aria-hidden="true"></i> '+_("Edit")+'</a>'+"\n";
271 result += '<a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/admin/cities.pl?op=delete_confirm&cityid='+ encodeURIComponent(row.city_id) +'"><i class="fa fa-trash" aria-hidden="true"></i> '+_("Delete")+'</a>';
284 [% INCLUDE 'intranet-bottom.inc' %]