|
Lines 129-150
Link Here
|
| 129 |
</div> |
129 |
</div> |
| 130 |
|
130 |
|
| 131 |
<h2>Cities</h2> |
131 |
<h2>Cities</h2> |
| 132 |
[% IF searchfield %] |
132 |
[% IF city_name_filter %] |
| 133 |
Searching: [% searchfield | html %] |
133 |
Searching: [% city_name_filter | html %] |
| 134 |
[% END %] |
134 |
[% END %] |
| 135 |
|
135 |
|
| 136 |
<table id="table_cities"> |
136 |
[% IF cities_count > 0 %] |
| 137 |
<thead> |
137 |
<table id="table_cities"> |
| 138 |
<tr> |
138 |
<thead> |
| 139 |
<th>City ID</th> |
139 |
<tr> |
| 140 |
<th>City</th> |
140 |
<th>City ID</th> |
| 141 |
<th>State</th> |
141 |
<th>City</th> |
| 142 |
<th>ZIP/Postal code</th> |
142 |
<th>State</th> |
| 143 |
<th>Country</th> |
143 |
<th>ZIP/Postal code</th> |
| 144 |
<th>Actions</th> |
144 |
<th>Country</th> |
| 145 |
</tr> |
145 |
<th data-class-name="actions">Actions</th> |
| 146 |
</thead> |
146 |
</tr> |
| 147 |
</table> |
147 |
</thead> |
|
|
148 |
</table> |
| 149 |
[% ELSE %] |
| 150 |
<div class="dialog message"> |
| 151 |
There are no cities defined. <a href="/cgi-bin/koha/admin/cities.pl?op=add_form">Create a new city</a>. |
| 152 |
</div> |
| 153 |
[% END %] |
| 148 |
[% END %] |
154 |
[% END %] |
| 149 |
|
155 |
|
| 150 |
</main> |
156 |
</main> |
|
Lines 162-173
Link Here
|
| 162 |
[% INCLUDE 'datatables.inc' %] |
168 |
[% INCLUDE 'datatables.inc' %] |
| 163 |
<script> |
169 |
<script> |
| 164 |
$(document).ready(function() { |
170 |
$(document).ready(function() { |
| 165 |
var cities_table_url = '/api/v1/cities'; |
171 |
var cities_table_url = '/api/v1/cities?'; |
|
|
172 |
[% IF city_name_filter %] |
| 173 |
var city_name_filter = { |
| 174 |
'name': { |
| 175 |
"like": '%[%- city_name_filter | html -%]%' |
| 176 |
} |
| 177 |
}; |
| 178 |
cities_table_url += 'q='+ encodeURI(JSON.stringify(city_name_filter)); |
| 179 |
[% END %] |
| 166 |
var cities_table = $("#table_cities").api({ |
180 |
var cities_table = $("#table_cities").api({ |
| 167 |
"ajax": { |
181 |
"ajax": { |
| 168 |
"url": cities_table_url |
182 |
"url": cities_table_url |
| 169 |
}, |
183 |
}, |
| 170 |
'dom': 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>', |
184 |
'dom': 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>', |
|
|
185 |
"order": [[ 1, "asc" ]], |
| 171 |
"columns": [ |
186 |
"columns": [ |
| 172 |
{ |
187 |
{ |
| 173 |
"data": "city_id", |
188 |
"data": "city_id", |
|
Lines 197-203
Link Here
|
| 197 |
{ |
212 |
{ |
| 198 |
"data": function( row, type, val, meta ) { |
213 |
"data": function( row, type, val, meta ) { |
| 199 |
|
214 |
|
| 200 |
var result = '<a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/admin/cities.pl?op=add_form&cityid='+ row.city_id +'"><i class="fa fa-pencil" aria-hidden="true"></i> '+_("Edit")+'</a>'; |
215 |
var result = '<a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/admin/cities.pl?op=add_form&cityid='+ row.city_id +'"><i class="fa fa-pencil" aria-hidden="true"></i> '+_("Edit")+'</a>'+"\n"; |
| 201 |
result += '<a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/admin/cities.pl?op=delete_confirm&cityid='+ row.city_id +'"><i class="fa fa-trash" aria-hidden="true"></i> '+_("Delete")+'</a>'; |
216 |
result += '<a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/admin/cities.pl?op=delete_confirm&cityid='+ row.city_id +'"><i class="fa fa-trash" aria-hidden="true"></i> '+_("Delete")+'</a>'; |
| 202 |
return result; |
217 |
return result; |
| 203 |
|
218 |
|
| 204 |
- |
|
|