4 [% USE TablesSettings %]
5 [% INCLUDE 'doc-head-open.inc' %]
7 [% IF op =='add_form' %]
12 [% END %] › [% ELSE %]
13 [% IF op == 'delete_confirm' %]
14 Confirm deletion of city › [% END %]
16 Cities › Administration › Koha
18 [% INCLUDE 'doc-head-close.inc' %]
21 <body id="admin_cities" class="admin">
22 [% INCLUDE 'header.inc' %]
23 [% INCLUDE 'cities-admin-search.inc' %]
25 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
28 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
31 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
34 [% IF op == 'add_form' %]
36 <a href="/cgi-bin/koha/admin/cities.pl">Cities</a>
39 <a href="#" aria-current="page">
48 [% ELSIF op == 'delete_confirm' %]
50 <a href="/cgi-bin/koha/admin/cities.pl">Cities</a>
53 <a href="#" aria-current="page">
54 Confirm deletion of city
60 <a href="#" aria-current="page">
68 <div class="main container-fluid">
70 <div class="col-sm-10 col-sm-push-2">
73 [% FOR m IN messages %]
74 <div class="dialog [% m.type | html %]">
76 [% CASE 'error_on_update' %]
77 An error occurred when updating this city. Perhaps it already exists.
78 [% CASE 'error_on_insert' %]
79 An error occurred when adding this city. The city id might already exist.
80 [% CASE 'error_on_delete' %]
81 An error occurred when deleting this city. Check the logs.
82 [% CASE 'success_on_update' %]
83 City updated successfully.
84 [% CASE 'success_on_insert' %]
85 City added successfully.
86 [% CASE 'success_on_delete' %]
87 City deleted successfully.
88 [% CASE 'already_exists' %]
89 This city already exists.
96 [% IF op == 'add_form' %]
98 <h1>Modify a city</h1>
103 <form action="/cgi-bin/koha/admin/cities.pl" name="Aform" method="post" class="validated">
104 <input type="hidden" name="op" value="add_validate" />
105 <input type="hidden" name="cityid" value="[% city.cityid | html %]" />
107 <fieldset class="rows">
110 <li><span class="label">City ID: </span>[% city.cityid | html %]</li>
113 <label for="city_name" class="required">City: </label>
114 <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>
117 <label for="city_state">State: </label>
118 <input type="text" name="city_state" id="city_state" size="80" maxlength="100" value="[% city.city_state | html %]" />
121 <label for="city_zipcode" class="required">ZIP/Postal code: </label>
122 <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>
125 <label for="city_country">Country: </label>
126 <input type="text" name="city_country" id="city_country" size="80" maxlength="100" value="[% city.city_country | html %]" />
131 <fieldset class="action">
132 <input type="submit" value="Submit" />
133 <a class="cancel" href="/cgi-bin/koha/admin/cities.pl">Cancel</a>
138 [% IF op == 'delete_confirm' %]
139 <div class="dialog alert">
140 <h3>Delete city "[% city.city_name | html %]?"</h3>
143 <td>[% city.cityid | html %]</td>
146 <td>[% city.city_name | html %]</td>
149 <td>[% city.city_state | html %]</td>
151 <tr><th>ZIP/Postal code</th>
152 <td>[% city.city_zipcode | html %]</td>
155 <td>[% city.city_country | html %]</td>
158 <form action="/cgi-bin/koha/admin/cities.pl" method="post">
159 <input type="hidden" name="op" value="delete_confirmed" />
160 <input type="hidden" name="cityid" value="[% city.cityid | html %]" />
161 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
163 <form action="/cgi-bin/koha/admin/cities.pl" method="get">
164 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
169 [% IF op == 'list' %]
171 <div id="toolbar" class="btn-toolbar">
172 <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>
176 [% IF city_name_filter %]
177 Searching: [% city_name_filter | html %]
180 [% IF cities_count > 0 %]
181 <div class="table_cities_table_controls"></div>
182 <table id="table_cities">
188 <th>ZIP/Postal code</th>
190 <th data-class-name="actions noExport">Actions</th>
195 <div class="dialog message">
196 There are no cities defined. <a href="/cgi-bin/koha/admin/cities.pl?op=add_form">Create a new city</a>.
202 </div> <!-- /.col-sm-10.col-sm-push-2 -->
204 <div class="col-sm-2 col-sm-pull-10">
206 [% INCLUDE 'admin-menu.inc' %]
208 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
209 </div> <!-- /.row -->
211 [% MACRO jsinclude BLOCK %]
212 [% Asset.js("js/admin-menu.js") | $raw %]
213 [% INCLUDE 'datatables.inc' %]
214 [% INCLUDE 'columns_settings.inc' %]
217 var columns_settings = [% TablesSettings.GetColumns( 'admin', 'cities', 'table_cities', 'json' ) | $raw %];
218 $(document).ready(function() {
219 var cities_table_url = '/api/v1/cities?';
221 [% IF city_name_filter %]
222 var city_name_filter = {
224 "like": '%[%- city_name_filter | html -%]%'
227 cities_table_url += 'q='+ encodeURIComponent(JSON.stringify(city_name_filter));
230 var cities_table = $("#table_cities").api({
232 "url": cities_table_url
234 "order": [[ 1, "asc" ]],
236 "targets": [0,1,2,3,4],
237 "render": function (data, type, row, meta) {
238 if ( type == 'display' ) {
239 return data.escapeHtml();
261 "data": "postal_code",
271 "data": function( row, type, val, meta ) {
273 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";
274 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>';
282 }, columns_settings, 1);
287 [% INCLUDE 'intranet-bottom.inc' %]