1 [% PROCESS "opac/parts/header.tt2";
2 PROCESS "opac/parts/misc_util.tt2";
3 WRAPPER "opac/parts/myopac/base.tt2";
5 limit = ctx.bookbags_limit;
6 offset = ctx.bookbags_offset;
7 item_page = ctx.bookbags_item_page;
8 move_cart_by_default = CGI.param('move_cart_by_default') || 0;
10 "Sharing a list means that the contents " _
11 "of the list will be visible to others. " _
12 "To see the public view of a shared list, " _
13 "click on the HTML View link in the Saved Lists section.");
17 <div id='myopac_bookbag_div container'>
19 <!-- new list creation -->
21 <button class="btn btn-sm btn-opac my-2" data-toggle="collapse" data-target="#create_form" aria-expanded="false" aria-controls="create_form">[% l('Create New List') %]</button>
23 <div id="create_form" [% IF ctx.add_rec || move_cart_by_default || !ctx.bookbags.size %] class="collapse show my-3"[% ELSE %] class="row collapse my-3"[% END %]>
24 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post">
25 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
26 <input type="hidden" name="action" value="create" class="form-control" />
28 <input type="hidden" name="add_rec" value="[% ctx.add_rec %]" class="form-control" />
30 [% IF ctx.where_from %]
31 <input type="hidden" name="where_from" value="[% ctx.where_from %]" class="form-control" />
33 <div class="form-group">
34 <label for="list_create_name">[% l('Enter the name of the new list:') %]</label>
35 <input id="list_create_name" type="text" name="name" class="form-control" autofocus>
37 <div class="form-group">
38 <label for="list_description">[% l("List description (optional):") %]</label>
39 <textarea name="description" id="list_description" class="form-control"></textarea>
41 <div class="form-group">
42 <label for="list_create_shared">[% l('Share this list?') %]</label>
43 <select class="d-inline-block form-control mini-control" name="shared" id="list_create_shared">
44 <option value="0">[% l('No') %]
45 <option value="1">[% l('Yes') %]
47 <a href="#" title="Allows the list to be shared through a link or RSS." data-toggle="tooltip">
48 <i class="fas fa-question-circle" aria-hidden="true"></i>
51 [% IF ctx.mylist.size %]
52 <div class="form-group">
53 <label for="list_move_cart">[% l('Move contents of basket to this list?') %]</label>
54 <select class="d-inline-block form-control mini-control" name="move_cart" id="list_move_cart">
55 <option value="0">[% l('No') %]
56 <option value="1" [% IF move_cart_by_default %]selected="selected"[% END%]>[% l('Yes') %]
60 <button type="submit" class="btn btn-confirm"><i class="fas fa-plus-square" aria-hidden="true"></i> [% l('Create List') %]</button>
61 <button type="reset" class="btn btn-deny" ><i class="fas fa-ban" aria-hidden="true"></i> [% l('Cancel') %]</button>
66 [% IF (CGI.param('from_basket') && ctx.mylist.size) %]
67 <h3>[% l("... from basket") %]</h3>
68 [% INCLUDE "opac/parts/anon_list.tt2" %]
70 [% INCLUDE "opac/parts/anon_list.tt2" %]
73 <div class="row border-top pt-4">
74 <h3>[% l('Saved Lists') %]</h3>
77 [% IF !ctx.bookbags.size %]
78 <div class="container pb-2 mt-2 pt-2">
79 <h4>[% l("You don't have any lists yet") %]</h4>
80 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {}) %]'>[% l('Create a list with the form above') %]</a>
83 [% IF limit < ctx.bookbag_count; %]
84 <span class='float-left' style='padding-left: 10px;'>
86 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
87 offset => (offset - limit)
88 }) %]'><span class="nav_arrow_fix">◄</span>[% l('Previous') %]</a>
90 [%- IF (offset - (limit * 3)) >= 0 -%]
91 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
92 offset => (offset - (limit * 3))
93 }) %]'>[% ((offset - (limit * 3)) / limit) + 1 %]</a>
95 [%- IF (offset - (limit * 2)) >= 0 -%]
96 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
97 offset => (offset - (limit * 2))
98 }) %]'>[% ((offset - (limit * 2)) / limit) + 1 %]</a>
100 [%- IF (offset - limit) >= 0 -%]
101 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
102 offset => (offset - limit)
103 }) %]'>[% ((offset - limit) / limit) + 1 %]</a>
105 <span class="bookbag-paginator-selected" >[% (offset / limit) + 1 %]</span>
106 [%- IF (offset + limit) < ctx.bookbag_count -%]
107 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
108 offset => (offset + limit)
109 }) %]'>[% ((offset + limit) / limit) + 1 %]</a>
111 [%- IF (offset + (limit * 2)) < ctx.bookbag_count -%]
112 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
113 offset => (offset + (limit * 2))
114 }) %]'>[% ((offset + (limit * 2)) / limit) + 1 %]</a>
116 [%- IF (offset + (limit * 3)) < ctx.bookbag_count -%]
117 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
118 offset => (offset + (limit * 3))
119 }) %]'>[% ((offset + (limit * 3)) / limit) + 1 %]</a>
121 [%- IF (ctx.bookbag_count - offset) > limit; -%]
122 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
123 offset => (offset + limit)
124 }) %]'>[% l('Next') %]<span class="nav_arrow_fix">►</span></a>
130 <div id='acct_lists_prime'>
131 [% FOR bbag IN ctx.bookbags %]
132 <div class="container border-bottom pb-2">
133 <div class="row mt-2">
134 [% baseurl = ctx.opac_root _ '/myopac/lists';
135 IF bbag.id != CGI.param("bbid");
136 url = mkurl(baseurl,{bbid => bbag.id, item_page => 1},['edit_notes','sort']);
137 ltitle = l("Show items in list");
139 url = mkurl(baseurl, {}, ['bbid', 'edit_notes', 'sort']);
140 ltitle = l("Hide items in list");
142 <h4 class="bookbag-name"><a title="[% ltitle %]" href="[% url %]">[% bbag.name | html %]</a>[% IF bbag.pub == 't'; %]
143 <a target='_blank' href='/opac/extras/feed/bookbag/rss2-full/[% bbag.id %]' aria-label="RSS Feed">
144 <i class="fas fa-rss-square" aria-hidden="true"></i></a>
147 <div class="row bookbag-description">
148 [% bbag.description | html %]
153 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update', {}, 1) %]" method="post">
154 <div class="bookbag-controls">
155 <input type="hidden" name="action" value="add_rec" />
156 <input type="hidden" name="list" value="[% bbag.id %]" />
157 <input type="hidden" name="add_rec" value="[% ctx.add_rec %]" />
158 [% IF ctx.where_from %]
159 <input type="hidden" name="where_from" value="[% ctx.where_from %]" />
161 <button class="fixed btn btn-success btn-sm m-1" type="submit" ><i class="fas fa-plus-square" aria-hidden="true"></i> [% l('Add to this list') %]</button>
166 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post">
167 <div class="bookbag-share">
168 <input type="hidden" name="list" value="[% bbag.id %]" />
169 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
170 [% IF bbag.pub != 't' %]
171 <input type="hidden" name="action" value="show" />
172 <button class="fixed btn btn-action btn-sm m-1" type="submit" ><i class="fas fa-share-square" aria-hidden="true"></i> [% l('Share') %]</button>
174 <input type="hidden" name="action" value="hide" />
175 <button class="fixed btn btn-secondary btn-sm m-1" type="submit"><i class="fas fa-eye-slash" aria-hidden="true"></i> [% l('Hide') %]</button>
180 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/print') %]" method="post">
181 <div class="bookbag-controls">
182 <input type="hidden" name="list" value="[% bbag.id %]" />
183 <input type="hidden" name="sort" value="[% CGI.param('sort') | html %]" />
184 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
185 <button type="submit" class="btn btn-action btn-sm m-1"><i class="fas fa-file-download" aria-hidden="true"></i> [% l('Download CSV') %]</button>
189 [% setting = 'opac.default_list'; %]
190 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post">
191 <div class="bookbag-controls">
192 <input type="hidden" name="list" value="[% bbag.id %]" />
193 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
194 [% IF ctx.user_setting_map.$setting == bbag.id %]
195 <input type="hidden" name="action" value="remove_default" />
196 <button type="submit" class="btn btn-deny btn-sm m-1"><i class="fas fa-minus-circle" aria-hidden="true"></i> [% l('Remove Default List') %]</button>
198 <input type="hidden" name="action" value="make_default" />
199 <button type="submit" class="btn btn-action btn-sm m-1"><i class="fas fa-th-list" aria-hidden="true"></i> [% l('Make Default List') %]</button>
205 [% IF ctx.is_staff %]
206 <div class="bookbag-controls">
211 "oils://remote/xul/server/cat/bucketz39_dialog.xul";
213 xulG.url_prefix(path),
215 "width=800,height=500",
217 "[% ctx.authtoken %]",
218 "[% ctx.user.ws_ou %]",
222 value="[% l('Locate Z39.50 Matches') %]"
223 ><i class="fas fa-external-link-alt" aria-hidden="true"></i></button>
227 [% IF bbag.pub == 't'; %]
228 <div class="bookbag-controls">
229 <a class="btn btn-sm btn-opac m-1" href='[%-
231 ctx.opac_root _ '/results',
232 {page => '0', bookbag => bbag.id, depth => 0, locg => ctx.search_ou},
235 -%]'><i class="fas fa-glasses" aria-hidden="true"></i> [% l('View in Catalogue') %]</a>
242 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post" onsubmit="return confirm('[% l('Do you really want to delete this list?') %]')">
243 <div class="bookbag-controls float-right">
244 <input type="hidden" name="list" value="[% bbag.id %]" />
245 <input type="hidden" name="action" value="delete" />
246 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
247 <button type="submit" class="btn btn-deny btn-sm m-1"><i class="fas fa-trash-alt" aria-hidden="true"></i> [% l('Delete List') %]</button>
255 [% IF CGI.param("bbid") == bbag.id %]
258 <h5 class="text-center my-2">List Items</h5>
259 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post" >
260 <input type="hidden" name="list" value="[% bbag.id %]" />
261 <input type="hidden" name="sort" value="[% CGI.param('sort') | uri %]" />
263 [% IF bbag.items.size %]
265 <button name="action" class="btn btn-action btn-sm" type="submit" value="place_hold" id="place_hold">[% l('Place hold') %]</button>
266 <button name="action" class="btn btn-action btn-sm" type="submit" value="print">[% l('Print title details') %]</button>
267 <button name="action" class="btn btn-action btn-sm" type="submit" value="email">[% l('Email title details') %]</button>
268 <button name="action" class="btn btn-action btn-sm" type="submit" value="del_item">[% l('Remove from list') %]</button>
273 <div class="d-block d-md-none">
276 <input id="check_all_list_items" checked="checked" type="checkbox" onclick="var inputs=document.getElementsByTagName('input');
277 for (i = 0; i < inputs.length; i++) {
278 if (inputs[i].name == 'selected_item' && !inputs[i].disabled && inputs[i].getAttribute('bbag') == [% bbag.id %])
279 inputs[i].checked = this.checked;}"/>
281 <label for="check_all_list_items">[% l('Check/Uncheck All') %]</label>
283 <table class="table table-hover miniTable w-100 bookbagTable">
286 <th class="list_checkbox">
287 <input type="checkbox"
288 onclick="var inputs=document.getElementsByTagName('input');
289 for (i = 0; i < inputs.length; i++) {
290 if (inputs[i].name == 'selected_item' && !inputs[i].disabled && inputs[i].getAttribute('bbag') == [% bbag.id %])
291 inputs[i].checked = this.checked;}"/>
294 <th class="list_entry">
297 <th class="list_entry">
298 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=> (CGI.param('sort') == 'titlesort' ? 'titlesort.descending' : 'titlesort')}) %]">[% l('Title') %]</a>
300 <th class="list_entry">
301 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=>(CGI.param('sort') == 'authorsort' ? 'authorsort.descending' : 'authorsort')}) %]">[% l('Author(s)') %]</a>
303 <th class='list_entry'>
304 [% l('Local Call Number') %]
306 <th class="list_entry">
307 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=>(CGI.param('sort') == 'pubdate' ? 'pubdate.descending' : 'pubdate')}) %]">[% l('Publication Date') %]</a>
309 <th class="list_entry">
312 <th class="list_entry">
314 [% IF CGI.param("edit_notes") != bbag.id %]
315 | <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {edit_notes=> bbag.id}) %]">[% l('Edit') %]</a>
321 [% UNLESS bbag.items.size %]
322 <tr><td colspan="6" class="list_is_empty">
323 [% l("This list contains no items.") %]
326 [% FOR item IN bbag.items;
327 rec_id = item.target_biblio_record_entry.id;
328 attrs = {marc_xml => ctx.bookbags_marc_xml.$rec_id};
329 PROCESS get_marc_attrs args=attrs %]
330 <tr class="bookbag-item-row">
331 <td class="list_checkbox">
332 <input type="checkbox" name="selected_item" value="[% item.id %]" bbag='[% bbag.id %]'/>
335 row_isbnissn = attrs.issns.0;
337 row_isbnissn = attrs.isbns.0;
342 row_title = attrs.title;
345 <td class="list_entry" data-label="[% l('Title') %]">
346 <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec_id, {}, ['edit_notes', 'bbid']) %]">[% attrs.title | html %]</a>
348 <td class="list_entry" data-label="[% l('Author(s)') %]">
350 authorquery = attrs.author | replace('[,\.:;]', '');
351 mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page', 'bbid', 'edit_notes'])
352 -%]">[% attrs.author | html %]</a>
354 <td class="list_entry" data-label="[% l('Local Call Number') %]">
356 copy = attrs.holdings.0;
358 # only show a relevant call number
359 copy_org = ctx.get_aou_by_shortname(copy.owner);
360 FOR ctx_org IN [ctx.pref_ou, ctx.search_ou, ctx.home_ou, ctx.physical_loc];
362 ctx_org = ctx.get_aou(ctx_org);
363 IF ctx.org_within_scope(ctx_org, copy_org, ctx_org.ou_type.depth);
364 l('[_1] ([_2])', copy.label, copy_org.name) | html;
371 <td class="list_entry" data-label="[% l('Publication Date') %]">
372 [% attrs.pubdate | html %]
374 <td class="list_entry" data-label="[% l('Format') %]">
375 [% attrs.format_label | html %]
377 [% IF CGI.param("edit_notes") == bbag.id %]
378 <td class="list_entry" data-label="[% l('Notes') %]">
379 [% FOR note IN item.notes %]
380 <input type="text" name="note-[% note.id %]" value="[% note.note | html %]" />
382 <input type="text" name="item-[% item.id %]" />
385 <td class="list_entry" data-label="[% l('Notes') %]">
386 [% FOR note IN item.notes %]
387 <div>[% note.note | html %]</div>
393 [% IF CGI.param("edit_notes") == bbag.id %]
394 <tr class="mobile_hide">
395 <td colspan="6"><!-- All space left of notes column --></td>
396 <td class="save-notes">
397 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
398 <input type="hidden" name="bbid" value="[% CGI.param('bbid') | html %]" />
399 <button type="submit" class="btn btn-confirm" name="save_notes" value="[% l('Save Notes') %]" ><i class="fas fa-save" aria-hidden="true"></i> [% l('Save Notes') %]</button>
410 [% IF ctx.bb_page_count > 1; %]
411 <div class="header_middle" style="padding-top:7px;">
412 <div class="bbag-navigate-list">[% l('Navigate Selected List ') %]</div>
413 <div class="bbag-navigate-list-pages">
414 [%- IF item_page > 1 -%]
415 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
416 item_page => item_page - 1
417 }) %]'><span class="nav_arrow_fix">◄</span>[% l('Previous') %]</a>
420 [%- IF (item_page - 3) >= 1 -%]
421 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
422 item_page => item_page - 3
423 }) %]'>[% item_page - 3 %]</a>
425 [%- IF (item_page - 2) >= 1 -%]
426 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
427 item_page => item_page - 2
428 }) %]'>[% item_page - 2 %]</a>
430 [%- IF (item_page - 1) >= 1 -%]
431 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
432 item_page => item_page - 1
433 }) %]'>[% item_page - 1%]</a>
435 <span class="bookbag-paginator-selected" >[% item_page %]</span>
436 [%- IF (item_page + 1) <= ctx.bb_page_count -%]
437 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
438 item_page => item_page + 1
439 }) %]'>[% item_page + 1 %]</a>
441 [%- IF (item_page + 2) <= ctx.bb_page_count -%]
442 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
443 item_page => item_page + 2
444 }) %]'>[% item_page + 2 %]</a>
446 [%- IF (item_page + 3) <= ctx.bb_page_count -%]
447 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
448 item_page => item_page + 3
449 }) %]'>[% item_page + 3 %]</a>
452 [%- IF (item_page + 1) <= ctx.bb_page_count; -%]
453 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
454 item_page => item_page + 1
455 }) %]'>[% l('Next') %]<span class="nav_arrow_fix">►</span></a>