|
Lines 2495-2504
Link Here
|
| 2495 |
const can_edit_items_from = [% To.json(can_edit_items_from) | $raw %]; |
2495 |
const can_edit_items_from = [% To.json(can_edit_items_from) | $raw %]; |
| 2496 |
const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %]; |
2496 |
const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %]; |
| 2497 |
let table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?"; |
2497 |
let table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?"; |
|
|
2498 |
let embed = ["+strings"]; |
| 2499 |
[% IF Koha.Preference('LocalCoverImages') %] |
| 2500 |
embed.push('cover_image_ids'); |
| 2501 |
[% END %] |
| 2498 |
var items_table = $("#table_items").kohaTable({ |
2502 |
var items_table = $("#table_items").kohaTable({ |
| 2499 |
ajax: { url: table_url }, |
2503 |
ajax: { url: table_url }, |
| 2500 |
order: [[ 0, "asc" ]], |
2504 |
order: [[ 0, "asc" ]], |
| 2501 |
embed: ["+strings"], |
2505 |
embed, |
| 2502 |
bAutoWidth: false, |
2506 |
bAutoWidth: false, |
| 2503 |
columns: [ |
2507 |
columns: [ |
| 2504 |
[% IF (StaffDetailItemSelection) %] |
2508 |
[% IF (StaffDetailItemSelection) %] |
|
Lines 2519-2528
Link Here
|
| 2519 |
{ |
2523 |
{ |
| 2520 |
data: "", |
2524 |
data: "", |
| 2521 |
className: "cover", |
2525 |
className: "cover", |
| 2522 |
searchable: true, |
2526 |
searchable: false, |
| 2523 |
orderable: true, |
2527 |
orderable: false, |
| 2524 |
render: function (data, type, row, meta) { |
2528 |
render: function (data, type, row, meta) { |
| 2525 |
return ""; // FIXME Build cover images |
2529 |
if ( !row.cover_image_ids.length > 0 ) { |
|
|
2530 |
return ''; |
| 2531 |
} |
| 2532 |
let node = '<div class="bookcoverimg">'; |
| 2533 |
node += '<div class="cover-slider">'; |
| 2534 |
row.cover_image_ids.forEach(id => { |
| 2535 |
node += '<div class="cover-image local-coverimg">'; |
| 2536 |
node += '<a href="/cgi-bin/koha/catalogue/image.pl?itemnumber=%s&imagenumber=%s" title="Local cover image">'.format(id, id); |
| 2537 |
node += '<img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&imagenumber=%s" alt="Local cover image" data-link="/cgi-bin/koha/catalogue/imageviewer.pl?itemnumber=[% item.itemnumber | uri %]&imagenumber=%s" />'.format(id, id); |
| 2538 |
node += '</a>'; |
| 2539 |
node += '</div>'; |
| 2540 |
}); |
| 2541 |
node += '</div>'; |
| 2542 |
node += '</div>'; |
| 2543 |
return node; |
| 2526 |
} |
2544 |
} |
| 2527 |
}, |
2545 |
}, |
| 2528 |
[% END %] |
2546 |
[% END %] |
| 2529 |
- |
|
|