bug 323: Item Circulation Alerts UI Fixes
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / item_circulation_alerts.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Administration &rsaquo; Item Circulation Alerts</title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <style>
5 div.circulation-alert h2 {
6   margin-top: 1.5em;
7 }
8 div.circulation-alert h3 {
9   margin-top: 1em;
10 }
11
12 table.grid thead th {
13   vertical-align: bottom;
14 }
15
16 table.grid tbody th {
17   text-align: right;
18 }
19
20 table.grid tbody td {
21   font-size: xx-small;
22 }
23
24 table.grid tbody td.info {
25   background: #fff;
26 }
27
28 table.grid.active tbody td {
29   width: 10%;
30   cursor: pointer;
31 }
32
33 table.grid tbody td {
34   background: #cfc;
35   color: #111;
36 }
37
38 table.grid td.disabled {
39   background: #fcc;
40 }
41
42 table.grid td.default {
43   background: #f88;
44 }
45 </style>
46 <script>
47 var $branch = "<!-- TMPL_VAR NAME="branch" -->";
48 $(function(){
49
50     var blocked            = _('Blocked!');
51     var saving             = _('Saving...');
52     var disabledForAll     = _('Disabled for all');
53     var disabledForCurrent = _('Disabled for') + ' ' + $branch;
54
55     $('#branch_selector input:submit').hide();
56     $('#branch').change(function(){
57         $('#branch_selector').submit();
58     });
59
60     $('table.grid.active tbody td').click(function(ev){
61         var id = this.id;
62         var td = $(this);
63         if (td.hasClass('default') && $branch != '*') {
64             td.html(blocked);
65             window.setTimeout(
66               function(){ td.html(disabledForAll) },
67               3000
68             );
69         } else {
70             td.html(saving);
71             $.ajax({
72                 url      : '/cgi-bin/koha/admin/item_circulation_alerts.pl',
73                 type     : 'POST',
74                 dataType : 'json',
75                 data     : { action: 'toggle', id: id, branch: $branch },
76                 success  : function(response){
77                     if ($branch == '*' && response.classes.match(/default/)) {
78                         td.html(disabledForAll);
79                     } else if (response.classes.match(/disabled/)) {
80                         td.html(disabledForCurrent);
81                     } else {
82                         td.html(' ');
83                     }
84                     td.attr('class', response.classes);
85                 }
86             });
87         }
88     });
89
90 });
91 </script>
92 </head>
93 <body>
94 <!-- TMPL_INCLUDE NAME="header.inc" -->
95 <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
96 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; Item Circulation Alerts </div>
97
98 <div id="doc3" class="yui-t1">
99
100 <div id="bd">
101
102 <div id="yui-main" class="circulation-alert">
103 <div class="yui-b">
104 <h1>Item Circulation Alerts</h1>
105
106
107 <h2>Select a library:</h2>
108 <form id="branch_selector" method="GET">
109 <select id="branch" name="branch">
110 <!-- TMPL_LOOP NAME="branches" -->
111 <!-- TMPL_IF NAME="selected" -->
112 <option value="<!-- TMPL_VAR NAME="branchcode" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
113 <!-- TMPL_ELSE -->
114 <option value="<!-- TMPL_VAR NAME="branchcode" -->"><!-- TMPL_VAR NAME="branchname" --></option>
115 <!-- /TMPL_IF -->
116 <!-- /TMPL_LOOP -->
117 </select>
118 <input type="submit" name="pick" value="Pick" />
119 </form>
120
121
122 <h2>Circulation Alerts for <!-- TMPL_VAR NAME="branch_name" --></h2>
123 <p>Click on the grid to toggle the settings.</p>
124
125 <h3>Checkout</h3>
126 <table class="grid active" width="100%">
127 <thead>
128 <tr>
129   <th>&nbsp;</th>
130   <!-- TMPL_LOOP NAME="item_types" -->
131   <th><!-- TMPL_VAR NAME="br_description" --></th>
132   <!-- /TMPL_LOOP -->
133 </tr>
134 </thead>
135 <tbody>
136 <!-- TMPL_LOOP NAME="grid_checkout" -->
137 <tr>
138   <th><!-- TMPL_VAR NAME="description" --></th>
139   <!-- TMPL_LOOP NAME="items" -->
140   <td class="<!-- TMPL_VAR NAME="class" -->" id="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="text" --></td>
141   <!-- /TMPL_LOOP -->
142 </tr>
143 <!-- /TMPL_LOOP -->
144 </tbody>
145 </table>
146
147 <h3>Check-in</h3>
148 <table class="grid active" width="100%">
149 <thead>
150 <tr>
151   <th>&nbsp;</th>
152   <!-- TMPL_LOOP NAME="item_types" -->
153   <th><!-- TMPL_VAR NAME="br_description" --></th>
154   <!-- /TMPL_LOOP -->
155 </tr>
156 </thead>
157 <tbody>
158 <!-- TMPL_LOOP NAME="grid_checkin" -->
159 <tr>
160   <th><!-- TMPL_VAR NAME="description" --></th>
161   <!-- TMPL_LOOP NAME="items" -->
162   <td class="<!-- TMPL_VAR NAME="class" -->" id="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="text" --></td>
163   <!-- /TMPL_LOOP -->
164 </tr>
165 <!-- /TMPL_LOOP -->
166 </tbody>
167 </table>
168
169 <h3>Legend</h3>
170 <table class="grid">
171 <thead>
172   <th>Color</th>
173   <th>Meaning</th>
174 </thead>
175 <tbody>
176   <tr>
177     <td width="100" class="default">&nbsp;</td>
178     <td class="info">These are disabled for ALL libraries.  To change these settings, choose the "Default" library.</td>
179   </tr>
180   <tr>
181     <td class="disabled">&nbsp;</td>
182     <td class="info">These are disabled for the current library.</td>
183   </tr>
184   <tr>
185     <td class="">&nbsp;</td>
186     <td class="info">These are enabled.</td>
187   </tr>
188 </tbody>
189 </table>
190
191
192 </div>
193 </div>
194
195 <div class="yui-b">
196 <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
197 </div>
198 </div>
199 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->