|
Lines 43-48
Link Here
|
| 43 |
<h1>Bookings for [% INCLUDE 'biblio-title-head.inc' %]</h1> |
43 |
<h1>Bookings for [% INCLUDE 'biblio-title-head.inc' %]</h1> |
| 44 |
<div class="page-section" id="bookings-timeline"></div> |
44 |
<div class="page-section" id="bookings-timeline"></div> |
| 45 |
<div class="page-section"> |
45 |
<div class="page-section"> |
|
|
46 |
<fieldset class="action filters" style="cursor:pointer;"> |
| 47 |
<a id="expired_filter" class="filtered"><i class="fa fa-bars"></i> Show expired</a> |
| 48 |
</fieldset> |
| 49 |
|
| 46 |
<table id="bookings_table"></table> |
50 |
<table id="bookings_table"></table> |
| 47 |
</div> |
51 |
</div> |
| 48 |
</div> |
52 |
</div> |
|
Lines 198-203
Link Here
|
| 198 |
} |
202 |
} |
| 199 |
); |
203 |
); |
| 200 |
|
204 |
|
|
|
205 |
let filter_expired = true; |
| 206 |
let additional_filters = { |
| 207 |
end_date: function(){ |
| 208 |
if ( filter_expired ) { |
| 209 |
let today = new Date(); |
| 210 |
return { ">=": today.toISOString() } |
| 211 |
} else { |
| 212 |
return; |
| 213 |
} |
| 214 |
} |
| 215 |
}; |
| 216 |
|
| 201 |
var bookings_table_url = "/api/v1/biblios/[% biblionumber | uri %]/bookings"; |
217 |
var bookings_table_url = "/api/v1/biblios/[% biblionumber | uri %]/bookings"; |
| 202 |
bookings_table = $('#bookings_table').kohaTable({ |
218 |
bookings_table = $('#bookings_table').kohaTable({ |
| 203 |
"ajax": { |
219 |
"ajax": { |
|
Lines 281-287
Link Here
|
| 281 |
return result; |
297 |
return result; |
| 282 |
} |
298 |
} |
| 283 |
}] |
299 |
}] |
| 284 |
}, [], 0); |
300 |
}, [], 0, additional_filters); |
|
|
301 |
|
| 302 |
var txtActivefilter = _("Show expired"); |
| 303 |
var txtInactivefilter = _("Hide expired"); |
| 304 |
$("#expired_filter").on("click", function() { |
| 305 |
if ($(this).hasClass('filtered')){ |
| 306 |
filter_expired = false; |
| 307 |
$(this).html('<i class="fa fa-filter"></i> '+txtInactivefilter); |
| 308 |
} else { |
| 309 |
filter_expired = true; |
| 310 |
$(this).html('<i class="fa fa-bars"></i> '+txtActivefilter); |
| 311 |
} |
| 312 |
bookings_table.DataTable().draw(); |
| 313 |
$(this).toggleClass('filtered'); |
| 314 |
}); |
| 315 |
|
| 285 |
}); |
316 |
}); |
| 286 |
</script> |
317 |
</script> |
| 287 |
[% END %] |
318 |
[% END %] |
| 288 |
- |
|
|