Bug 13863: Fix Datatables paging on the cities and search history pages
[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 ( add_form ) %]Cities &rsaquo; [% IF ( cityid ) %] Modify city[% ELSE %] New city[% END %][% ELSE %][% IF ( 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 ( add_form ) %]
30     &rsaquo; [% IF ( cityid ) %]Modify[% ELSE %]New[% END %] City
31     [% ELSIF ( 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 [% IF ( add_form ) %]
43         [% IF ( cityid ) %]
44                 <h1>Modify a city</h1>
45         [% ELSE %]
46                 <h1>New city</h1>
47         [% END %]
48
49     <form action="[% script_name %]" name="Aform" method="post" class="validated">
50         <input type="hidden" name="op" value="add_validate" />
51         <input type="hidden" name="checked" value="0" />
52         <input type="hidden" name="cityid" value="[% cityid %]" />
53
54 <fieldset class="rows"><ol>     [% IF ( cityid ) %]
55                 <li>
56                 <span class="label">City ID: </span>[% cityid %]</li>
57         [% END %]
58         <li>
59     <label for="city_name" class="required">City: </label>
60     <input type="text" name="city_name" id="city_name" size="80" maxlength="100" value="[% city_name |html %]" required="required" class="required" /> <span class="required">Required</span>
61         </li>
62         <li>
63         <label for="city_state">State: </label>
64         <input type="text" name="city_state" id="city_state" size="80" maxlength="100" value="[% city_state |html %]" />
65         </li>
66         <li>                            
67     <label for="city_zipcode" class="required">Zip/Postal code: </label>
68     <input type="text" name="city_zipcode" id="city_zipcode" size="20" maxlength="20" value="[% city_zipcode %]" required="required" class="required" /> <span class="required">Required</span>
69         </li>
70         <li>
71         <label for="city_country">Country: </label>
72         <input type="text" name="city_country" id="city_country" size="80" maxlength="100" value="[% city_country |html %]" />
73         </li></ol></fieldset>
74         
75         <fieldset class="action">
76         <input type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/admin/cities.pl">Cancel</a>
77         </fieldset>
78         </form>
79
80 [% END %]
81 [% IF ( delete_confirm ) %]
82     <div class="dialog alert">
83     <h3>Delete City "[% city_name %]?"</h3>
84     <table>
85         <tr><th>City id</th>
86             <td>[% cityid %]</td>
87         </tr>
88         <tr><th>City</th>
89             <td>[% city_name %]</td>
90         </tr>
91         <tr><th>State</th>
92             <td>[% city_state %]</td>
93         </tr>
94         <tr><th>Zip/Postal code</th>
95             <td>[% city_zipcode %]</td>
96         </tr>
97         <tr><th>Country</th>
98             <td>[% city_country %]</td>
99         </tr>
100     </table>
101     <form action="[% script_name %]" method="post">
102         <input type="hidden" name="op" value="delete_confirmed" />
103         <input type="hidden" name="cityid" value="[% cityid %]" />
104         <input type="submit" class="approve" value="Yes, Delete" />
105     </form>
106     <form action="[% script_name %]" method="get">
107         <input type="submit" class="deny" value="No, do not Delete" />
108     </form>
109 </div>
110 [% END %]
111
112 [% IF ( else ) %]
113
114 <div id="toolbar" class="btn-toolbar">
115     <a class="btn btn-small" id="newcity" href="[% script_name %]?op=add_form"><i class="icon-plus"></i> New city</a>
116 </div>
117
118         <h2>Cities</h2>
119         [% IF ( searchfield ) %]
120                 Searching: [% searchfield %]
121         [% END %]
122
123 [% IF ( loop ) %]
124 <table id="table_cities">
125                 <thead>
126                         <th>City ID</th>
127                         <th>City</th>
128                         <th>State</th>
129                         <th>Zip/Postal code</th>
130                         <th>Country</th>
131                         <th>&nbsp;</th>
132                         <th>&nbsp;</th>
133                 </thead>
134                 [% FOREACH loo IN loop %]
135         <tr>
136                         <td>[% loo.cityid %]</td>
137                         <td>[% loo.city_name %]</td>
138                         <td>[% loo.city_state %]</td>
139                         <td>[% loo.city_zipcode %]</td>
140                         <td>[% loo.city_country %]</td>
141                         <td><a href="[% loo.script_name %]?op=add_form&amp;cityid=[% loo.cityid %]">Edit</a></td>
142                         <td><a href="[% loo.script_name %]?op=delete_confirm&amp;cityid=[% loo.cityid %]">Delete</a></td>
143                 </tr>
144                 [% END %]
145         </table>[% END %]
146 [% END %]
147
148 </div>
149 </div>
150 <div class="yui-b">
151 [% INCLUDE 'admin-menu.inc' %]
152 </div>
153 </div>
154 [% INCLUDE 'intranet-bottom.inc' %]
155