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' style="padding:5px;">
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 <span title="Allows the list to be shared through a link or RSS." data-toggle="tooltip">
57 <i class="fas fa-question-circle"></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="far fa-plus-square"></i> [% l('Create List') %]</button>
79 <button type="reset" class="btn btn-deny" ><i class="fas fa-ban"></i> [% l('Cancel') %]</button>
85 [% IF CGI.param('from_basket'); %]
86 <h1>[% l("... from basket") %]</h1>
87 [% INCLUDE "opac/parts/anon_list.tt2" %]
89 <h1>[% l("My Existing Basket and Lists") %]</h1>
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 <h2 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"></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="far fa-plus-square"></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="class=fixed btn btn-action btn-sm m-1" type="submit" ><i class="fas fa-share-square"></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"></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"></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-danger btn-sm m-1"><i class="fas fa-minus-circle"></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"></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"></i></button>
235 [% IF bbag.pub == 't'; %]
236 <div class="bookbag-controls">
238 <a class="btn btn-sm btn-opac m-1" href='[%-
240 ctx.opac_root _ '/results',
241 {page => '0', bookbag => bbag.id, depth => 0, locg => ctx.search_ou},
244 -%]'><i class="fas fa-glasses"></i> [% l('View in Catalogue') %]</a>
248 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post" onsubmit="return confirm('[% l('Do you really want to delete this list?') %]')">
249 <div class="bookbag-controls float-right">
250 <input type="hidden" name="list" value="[% bbag.id %]" />
251 <input type="hidden" name="action" value="delete" />
252 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
253 <button type="submit" class="btn btn-danger btn-sm m-1"><i class="fas fa-trash-alt"></i> [% l('Delete List') %]</button>
260 [% IF CGI.param("bbid") == bbag.id %]
263 <h5 class="text-center my-2">List Items</h5>
264 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post" >
265 <input type="hidden" name="list" value="[% bbag.id %]" />
266 <input type="hidden" name="sort" value="[% CGI.param('sort') | uri %]" />
268 [% IF bbag.items.size %]
270 <button name="action" class="btn btn-action" type="submit" value="place_hold" id="place_hold">[% l('Place hold') %]</button>
271 <button name="action" class="btn btn-action" type="submit" value="print">[% l('Print title details') %]</button>
272 <button name="action" class="btn btn-action" type="submit" value="email">[% l('Email title details') %]</button>
273 <button name="action" class="btn btn-action" type="submit" value="del_item">[% l('Remove from list') %]</button>
278 <div class="d-block d-md-none">
281 <input id="check_all_list_items" checked="checked" type="checkbox" onclick="var inputs=document.getElementsByTagName('input');
282 for (i = 0; i < inputs.length; i++) {
283 if (inputs[i].name == 'selected_item' && !inputs[i].disabled && inputs[i].getAttribute('bbag') == [% bbag.id %])
284 inputs[i].checked = this.checked;}"/>
286 <label for="check_all_list_items">[% l('Check/Uncheck All') %]</label>
288 <table class="table table-hover miniTable w-100 bookbagTable">
291 <th class="list_checkbox">
292 <input type="checkbox"
293 onclick="var inputs=document.getElementsByTagName('input');
294 for (i = 0; i < inputs.length; i++) {
295 if (inputs[i].name == 'selected_item' && !inputs[i].disabled && inputs[i].getAttribute('bbag') == [% bbag.id %])
296 inputs[i].checked = this.checked;}"/>
299 <th class="list_entry">
300 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=> (CGI.param('sort') == 'titlesort' ? 'titlesort.descending' : 'titlesort')}) %]">[% l('Title') %]</a>
302 <th class="list_entry">
303 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=>(CGI.param('sort') == 'authorsort' ? 'authorsort.descending' : 'authorsort')}) %]">[% l('Author(s)') %]</a>
305 <th class='list_entry'>
306 [% l('Local Call Number') %]
308 <th class="list_entry">
309 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=>(CGI.param('sort') == 'pubdate' ? 'pubdate.descending' : 'pubdate')}) %]">[% l('Publication Date') %]</a>
311 <th class="list_entry">
314 <th class="list_entry">
316 [% IF CGI.param("edit_notes") != bbag.id %]
317 | <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {edit_notes=> bbag.id}) %]">[% l('Edit') %]</a>
323 [% UNLESS bbag.items.size %]
324 <tr><td colspan="6" class="list_is_empty">
325 [% l("This list contains no items.") %]
328 [% FOR item IN bbag.items;
329 rec_id = item.target_biblio_record_entry.id;
330 attrs = {marc_xml => ctx.bookbags_marc_xml.$rec_id};
331 PROCESS get_marc_attrs args=attrs %]
332 <tr class="bookbag-item-row">
333 <td class="list_checkbox">
334 <input type="checkbox" name="selected_item" value="[% item.id %]" bbag='[% bbag.id %]'/>
336 <td class="list_entry" data-label="[% l('Title') %]">
337 <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec_id, {}, ['edit_notes', 'bbid']) %]">[% attrs.title | html %]</a>
339 <td class="list_entry" data-label="[% l('Author(s)') %]">
341 authorquery = attrs.author | replace('[,\.:;]', '');
342 mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page', 'bbid', 'edit_notes'])
343 -%]">[% attrs.author | html %]</a>
345 <td class="list_entry" data-label="[% l('Local Call Number') %]">
347 copy = attrs.holdings.0;
349 # only show a relevant call number
350 copy_org = ctx.get_aou_by_shortname(copy.owner);
351 FOR ctx_org IN [ctx.pref_ou, ctx.search_ou, ctx.home_ou, ctx.physical_loc];
353 ctx_org = ctx.get_aou(ctx_org);
354 IF ctx.org_within_scope(ctx_org, copy_org, ctx_org.ou_type.depth);
355 l('[_1] ([_2])', copy.label, copy_org.name) | html;
362 <td class="list_entry" data-label="[% l('Publication Date') %]">
363 [% attrs.pubdate | html %]
365 <td class="list_entry" data-label="[% l('Format') %]">
366 [% attrs.format_label | html %]
368 [% IF CGI.param("edit_notes") == bbag.id %]
369 <td class="list_entry" data-label="[% l('Notes') %]">
370 [% FOR note IN item.notes %]
371 <input type="text" name="note-[% note.id %]" value="[% note.note | html %]" />
373 <input type="text" name="item-[% item.id %]" />
376 <td class="list_entry" data-label="[% l('Notes') %]">
377 [% FOR note IN item.notes %]
378 <div>[% note.note | html %]</div>
384 [% IF CGI.param("edit_notes") == bbag.id %]
385 <tr class="mobile_hide">
386 <td colspan="6"><!-- All space left of notes column --></td>
387 <td class="save-notes">
388 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
389 <input type="hidden" name="bbid" value="[% CGI.param('bbid') | html %]" />
390 <button type="submit" class="btn btn-confirm" ><i class="fas fa-save"></i> [% l('Save Notes') %]</button>
401 [% IF ctx.bb_page_count > 1; %]
402 <div class="header_middle" style="padding-top:7px;">
403 <div class="bbag-navigate-list">[% l('Navigate Selected List ') %]</div>
404 <div class="bbag-navigate-list-pages">
405 [%- IF item_page > 1 -%]
406 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
407 item_page => item_page - 1
408 }) %]'><span class="nav_arrow_fix">◄</span>[% l('Previous') %]</a>
411 [%- IF (item_page - 3) >= 1 -%]
412 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
413 item_page => item_page - 3
414 }) %]'>[% item_page - 3 %]</a>
416 [%- IF (item_page - 2) >= 1 -%]
417 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
418 item_page => item_page - 2
419 }) %]'>[% item_page - 2 %]</a>
421 [%- IF (item_page - 1) >= 1 -%]
422 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
423 item_page => item_page - 1
424 }) %]'>[% item_page - 1%]</a>
426 <span class="bookbag-paginator-selected" >[% item_page %]</span>
427 [%- IF (item_page + 1) <= ctx.bb_page_count -%]
428 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
429 item_page => item_page + 1
430 }) %]'>[% item_page + 1 %]</a>
432 [%- IF (item_page + 2) <= ctx.bb_page_count -%]
433 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
434 item_page => item_page + 2
435 }) %]'>[% item_page + 2 %]</a>
437 [%- IF (item_page + 3) <= ctx.bb_page_count -%]
438 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
439 item_page => item_page + 3
440 }) %]'>[% item_page + 3 %]</a>
443 [%- IF (item_page + 1) <= ctx.bb_page_count; -%]
444 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
445 item_page => item_page + 1
446 }) %]'>[% l('Next') %]<span class="nav_arrow_fix">►</span></a>