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;
9 "Sharing a list means that the contents " _
10 "of the list will be visible to others. " _
11 "To see the public view of a shared list, " _
12 "click on the HTML View link in the Saved Lists section.");
16 <h3>[% l('My Lists') %]</h3>
17 <div id='myopac_bookbag_div'>
19 <!-- new list creation -->
20 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post" id="create_form">
21 <h4>[% l('Create New List') %]</h4><a id="createnewlist"></a>
22 <table class="table" >
24 <td class="list_create_table_label">
25 <label for="list_create_name">[% l('Enter the name of the new list:') %]</label>
27 <td class="px-3 my-2">
28 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
29 <input id="list_create_name" type="text" name="name" class="form-control"/>
30 <input type="hidden" name="action" value="create" class="form-control" />
32 <input type="hidden" name="add_rec" value="[% ctx.add_rec %]" class="form-control" />
34 [% IF ctx.where_from %]
35 <input type="hidden" name="where_from" value="[% ctx.where_from %]" class="form-control" />
40 <td class="list_create_table_label">
41 <label for="list_description">[% l("List description (optional):") %]</label>
44 <textarea name="description" id="list_description" class="form-control"></textarea>
48 <td class="list_create_table_label">
49 <label for="list_create_shared">[% l('Share this list?') %]</label>
52 <select class="d-inline-block form-control mini-control" name="shared" id="list_create_shared">
53 <option value="0">[% l('No') %]
54 <option value="1">[% l('Yes') %]
56 <a href="#" title="Allows the list to be shared through a link or RSS." data-toggle="tooltip">
57 <i class="fas fa-question-circle" aria-hidden="true"></i>
61 [% IF ctx.mylist.size %]
63 <td class="list_create_table_label">
64 <label for="list_move_cart">[% l('Move contents of basket to this list?') %]</label>
67 <select class="d-inline-block form-control mini-control" name="move_cart" id="list_move_cart">
68 <option value="0">[% l('No') %]
69 <option value="1" [% IF CGI.param('move_cart_by_default') %]selected="selected"[% END%]>[% l('Yes') %]
76 <td class="list-create-table-buttons">
77 <button type="submit" class="btn btn-confirm"><i class="fas fa-plus-square" aria-hidden="true"></i> [% l('Create List') %]</button>
79 <button type="reset" class="btn btn-deny" ><i class="fas fa-ban" aria-hidden="true"></i> [% l('Cancel') %]</button>
85 [% IF CGI.param('from_basket'); %]
86 <h3>[% l("... from basket") %]</h3>
87 [% INCLUDE "opac/parts/anon_list.tt2" %]
89 <h3>[% l("My Existing Basket and Lists") %]</h3>
90 [% INCLUDE "opac/parts/anon_list.tt2" %]
92 [% IF ctx.bookbags.size %]
93 <div class="header_middle">
94 <span class="float-left">[% l('Saved Lists') %]</span>
95 [% IF limit < ctx.bookbag_count; %]
96 <span class='float-left' style='padding-left: 10px;'>
98 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
99 offset => (offset - limit)
100 }) %]'><span class="nav_arrow_fix">◄</span>[% l('Previous') %]</a>
102 [%- IF (offset - (limit * 3)) >= 0 -%]
103 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
104 offset => (offset - (limit * 3))
105 }) %]'>[% ((offset - (limit * 3)) / limit) + 1 %]</a>
107 [%- IF (offset - (limit * 2)) >= 0 -%]
108 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
109 offset => (offset - (limit * 2))
110 }) %]'>[% ((offset - (limit * 2)) / limit) + 1 %]</a>
112 [%- IF (offset - limit) >= 0 -%]
113 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
114 offset => (offset - limit)
115 }) %]'>[% ((offset - limit) / limit) + 1 %]</a>
117 <span class="bookbag-paginator-selected" >[% (offset / limit) + 1 %]</span>
118 [%- IF (offset + limit) < ctx.bookbag_count -%]
119 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
120 offset => (offset + limit)
121 }) %]'>[% ((offset + limit) / limit) + 1 %]</a>
123 [%- IF (offset + (limit * 2)) < ctx.bookbag_count -%]
124 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
125 offset => (offset + (limit * 2))
126 }) %]'>[% ((offset + (limit * 2)) / limit) + 1 %]</a>
128 [%- IF (offset + (limit * 3)) < ctx.bookbag_count -%]
129 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
130 offset => (offset + (limit * 3))
131 }) %]'>[% ((offset + (limit * 3)) / limit) + 1 %]</a>
133 [%- IF (ctx.bookbag_count - offset) > limit; -%]
134 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
135 offset => (offset + limit)
136 }) %]'>[% l('Next') %]<span class="nav_arrow_fix">►</span></a>
142 <div id='acct_lists_prime'>
143 [% FOR bbag IN ctx.bookbags %]
145 <table class="table"><tr>
146 <td class="listTitleText">
147 <div class="bookbag-controls-title-block">
148 [% baseurl = ctx.opac_root _ '/myopac/lists';
149 IF bbag.id != CGI.param("bbid");
150 url = mkurl(baseurl,{bbid => bbag.id, item_page => 1},['edit_notes','sort']);
151 ltitle = l("Show items in list");
153 url = mkurl(baseurl, {}, ['bbid', 'edit_notes', 'sort']);
154 ltitle = l("Hide items in list");
156 <h4 class="bookbag-name"><a title="[% ltitle %]" href="[% url %]">[% bbag.name | html %]</a>[% IF bbag.pub == 't'; %]
157 <a target='_blank' href='/opac/extras/feed/bookbag/rss2-full/[% bbag.id %]' aria-label="RSS Feed">
158 <i class="fas fa-rss-square" aria-hidden="true"></i></a>
160 [% IF bbag.description %]<div class="bookbag-description">[% bbag.description | html %]</div>[% END %]
166 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update', {}, 1) %]" method="post">
167 <div class="bookbag-controls">
168 <input type="hidden" name="action" value="add_rec" />
169 <input type="hidden" name="list" value="[% bbag.id %]" />
170 <input type="hidden" name="add_rec" value="[% ctx.add_rec %]" />
171 [% IF ctx.where_from %]
172 <input type="hidden" name="where_from" value="[% ctx.where_from %]" />
174 <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>
178 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post">
179 <div class="bookbag-share">
180 <input type="hidden" name="list" value="[% bbag.id %]" />
181 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
182 [% IF bbag.pub != 't' %]
183 <input type="hidden" name="action" value="show" />
184 <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>
186 <input type="hidden" name="action" value="hide" />
187 <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>
192 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/print') %]" method="post">
193 <div class="bookbag-controls">
194 <input type="hidden" name="list" value="[% bbag.id %]" />
195 <input type="hidden" name="sort" value="[% CGI.param('sort') | html %]" />
196 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
197 <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>
200 [% setting = 'opac.default_list'; %]
201 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post">
202 <div class="bookbag-controls">
203 <input type="hidden" name="list" value="[% bbag.id %]" />
204 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
205 [% IF ctx.user_setting_map.$setting == bbag.id %]
206 <input type="hidden" name="action" value="remove_default" />
207 <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>
209 <input type="hidden" name="action" value="make_default" />
210 <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>
214 [% IF ctx.is_staff %]
215 <div class="bookbag-controls">
220 "oils://remote/xul/server/cat/bucketz39_dialog.xul";
222 xulG.url_prefix(path),
224 "width=800,height=500",
226 "[% ctx.authtoken %]",
227 "[% ctx.user.ws_ou %]",
231 value="[% l('Locate Z39.50 Matches') %]"
232 ><i class="fas fa-external-link-alt" aria-hidden="true"></i></button>
235 [% IF bbag.pub == 't'; %]
236 <div class="bookbag-controls">
237 <a class="btn btn-sm btn-opac m-1" href='[%-
239 ctx.opac_root _ '/results',
240 {page => '0', bookbag => bbag.id, depth => 0, locg => ctx.search_ou},
243 -%]'><i class="fas fa-glasses" aria-hidden="true"></i> [% l('View in Catalogue') %]</a>
247 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post" onsubmit="return confirm('[% l('Do you really want to delete this list?') %]')">
248 <div class="bookbag-controls float-right">
249 <input type="hidden" name="list" value="[% bbag.id %]" />
250 <input type="hidden" name="action" value="delete" />
251 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
252 <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>
259 [% IF CGI.param("bbid") == bbag.id %]
262 <h5 class="text-center my-2">List Items</h5>
263 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post" >
264 <input type="hidden" name="list" value="[% bbag.id %]" />
265 <input type="hidden" name="sort" value="[% CGI.param('sort') | uri %]" />
267 [% IF bbag.items.size %]
269 <button name="action" class="btn btn-action" type="submit" value="place_hold" id="place_hold">[% l('Place hold') %]</button>
270 <button name="action" class="btn btn-action" type="submit" value="print">[% l('Print title details') %]</button>
271 <button name="action" class="btn btn-action" type="submit" value="email">[% l('Email title details') %]</button>
272 <button name="action" class="btn btn-action" type="submit" value="del_item">[% l('Remove from list') %]</button>
277 <div class="d-block d-md-none">
280 <input id="check_all_list_items" checked="checked" type="checkbox" onclick="var inputs=document.getElementsByTagName('input');
281 for (i = 0; i < inputs.length; i++) {
282 if (inputs[i].name == 'selected_item' && !inputs[i].disabled && inputs[i].getAttribute('bbag') == [% bbag.id %])
283 inputs[i].checked = this.checked;}"/>
285 <label for="check_all_list_items">[% l('Check/Uncheck All') %]</label>
287 <table class="table table-hover miniTable w-100 bookbagTable">
290 <th class="list_checkbox">
291 <input type="checkbox"
292 onclick="var inputs=document.getElementsByTagName('input');
293 for (i = 0; i < inputs.length; i++) {
294 if (inputs[i].name == 'selected_item' && !inputs[i].disabled && inputs[i].getAttribute('bbag') == [% bbag.id %])
295 inputs[i].checked = this.checked;}"/>
298 <th class="list_entry">
299 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=> (CGI.param('sort') == 'titlesort' ? 'titlesort.descending' : 'titlesort')}) %]">[% l('Title') %]</a>
301 <th class="list_entry">
302 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=>(CGI.param('sort') == 'authorsort' ? 'authorsort.descending' : 'authorsort')}) %]">[% l('Author(s)') %]</a>
304 <th class='list_entry'>
305 [% l('Local Call Number') %]
307 <th class="list_entry">
308 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=>(CGI.param('sort') == 'pubdate' ? 'pubdate.descending' : 'pubdate')}) %]">[% l('Publication Date') %]</a>
310 <th class="list_entry">
313 <th class="list_entry">
315 [% IF CGI.param("edit_notes") != bbag.id %]
316 | <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {edit_notes=> bbag.id}) %]">[% l('Edit') %]</a>
322 [% UNLESS bbag.items.size %]
323 <tr><td colspan="6" class="list_is_empty">
324 [% l("This list contains no items.") %]
327 [% FOR item IN bbag.items;
328 rec_id = item.target_biblio_record_entry.id;
329 attrs = {marc_xml => ctx.bookbags_marc_xml.$rec_id};
330 PROCESS get_marc_attrs args=attrs %]
331 <tr class="bookbag-item-row">
332 <td class="list_checkbox">
333 <input type="checkbox" name="selected_item" value="[% item.id %]" bbag='[% bbag.id %]'/>
335 <td class="list_entry" data-label="[% l('Title') %]">
336 <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec_id, {}, ['edit_notes', 'bbid']) %]">[% attrs.title | html %]</a>
338 <td class="list_entry" data-label="[% l('Author(s)') %]">
340 authorquery = attrs.author | replace('[,\.:;]', '');
341 mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page', 'bbid', 'edit_notes'])
342 -%]">[% attrs.author | html %]</a>
344 <td class="list_entry" data-label="[% l('Local Call Number') %]">
346 copy = attrs.holdings.0;
348 # only show a relevant call number
349 copy_org = ctx.get_aou_by_shortname(copy.owner);
350 FOR ctx_org IN [ctx.pref_ou, ctx.search_ou, ctx.home_ou, ctx.physical_loc];
352 ctx_org = ctx.get_aou(ctx_org);
353 IF ctx.org_within_scope(ctx_org, copy_org, ctx_org.ou_type.depth);
354 l('[_1] ([_2])', copy.label, copy_org.name) | html;
361 <td class="list_entry" data-label="[% l('Publication Date') %]">
362 [% attrs.pubdate | html %]
364 <td class="list_entry" data-label="[% l('Format') %]">
365 [% attrs.format_label | html %]
367 [% IF CGI.param("edit_notes") == bbag.id %]
368 <td class="list_entry" data-label="[% l('Notes') %]">
369 [% FOR note IN item.notes %]
370 <input type="text" name="note-[% note.id %]" value="[% note.note | html %]" />
372 <input type="text" name="item-[% item.id %]" />
375 <td class="list_entry" data-label="[% l('Notes') %]">
376 [% FOR note IN item.notes %]
377 <div>[% note.note | html %]</div>
383 [% IF CGI.param("edit_notes") == bbag.id %]
384 <tr class="mobile_hide">
385 <td colspan="6"><!-- All space left of notes column --></td>
386 <td class="save-notes">
387 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
388 <input type="hidden" name="bbid" value="[% CGI.param('bbid') | html %]" />
389 <button type="submit" class="btn btn-confirm" ><i class="fas fa-save" aria-hidden="true"></i> [% l('Save Notes') %]</button>
400 [% IF ctx.bb_page_count > 1; %]
401 <div class="header_middle" style="padding-top:7px;">
402 <div class="bbag-navigate-list">[% l('Navigate Selected List ') %]</div>
403 <div class="bbag-navigate-list-pages">
404 [%- IF item_page > 1 -%]
405 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
406 item_page => item_page - 1
407 }) %]'><span class="nav_arrow_fix">◄</span>[% l('Previous') %]</a>
410 [%- IF (item_page - 3) >= 1 -%]
411 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
412 item_page => item_page - 3
413 }) %]'>[% item_page - 3 %]</a>
415 [%- IF (item_page - 2) >= 1 -%]
416 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
417 item_page => item_page - 2
418 }) %]'>[% item_page - 2 %]</a>
420 [%- IF (item_page - 1) >= 1 -%]
421 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
422 item_page => item_page - 1
423 }) %]'>[% item_page - 1%]</a>
425 <span class="bookbag-paginator-selected" >[% item_page %]</span>
426 [%- IF (item_page + 1) <= ctx.bb_page_count -%]
427 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
428 item_page => item_page + 1
429 }) %]'>[% item_page + 1 %]</a>
431 [%- IF (item_page + 2) <= ctx.bb_page_count -%]
432 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
433 item_page => item_page + 2
434 }) %]'>[% item_page + 2 %]</a>
436 [%- IF (item_page + 3) <= ctx.bb_page_count -%]
437 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
438 item_page => item_page + 3
439 }) %]'>[% item_page + 3 %]</a>
442 [%- IF (item_page + 1) <= ctx.bb_page_count; -%]
443 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
444 item_page => item_page + 1
445 }) %]'>[% l('Next') %]<span class="nav_arrow_fix">►</span></a>