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 style="padding-bottom:10px;">[% l("PINES Account Tips") %]</div>
18 <div id='myopac_bookbag_div'>
20 <!-- new list creation -->
21 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post" id="create_form">
22 <h4>[% l('Create New List') %]</h4><a id="createnewlist"></a>
23 <table class="table" >
25 <td class="list_create_table_label">
26 <label for="list_create_name">[% l('Enter the name of the new list:') %]</label>
28 <td class="px-3 my-2">
29 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
30 <input id="list_create_name" type="text" name="name" class="form-control"/>
31 <input type="hidden" name="action" value="create" class="form-control" />
33 <input type="hidden" name="add_rec" value="[% ctx.add_rec %]" class="form-control" />
35 [% IF ctx.where_from %]
36 <input type="hidden" name="where_from" value="[% ctx.where_from %]" class="form-control" />
41 <td class="list_create_table_label">
42 <label for="list_description">[% l("List description (optional):") %]</label>
45 <textarea name="description" id="list_description" class="form-control"></textarea>
49 <td class="list_create_table_label">
50 <label for="list_create_shared">[% l('Share this list?') %]</label>
53 <select class="d-inline-block form-control mini-control" name="shared" id="list_create_shared">
54 <option value="0">[% l('No') %]
55 <option value="1">[% l('Yes') %]
57 <a title="[% l('Allows the list to be shared through a link or RSS.') %]" data-toggle="tooltip">
58 <i class="fas fa-question-circle" aria-hidden="true"></i>
62 [% IF ctx.mylist.size %]
64 <td class="list_create_table_label">
65 <label for="list_move_cart">[% l('Move contents of basket to this list?') %]</label>
68 <select class="d-inline-block form-control mini-control" name="move_cart" id="list_move_cart">
69 <option value="0">[% l('No') %]
70 <option value="1" [% IF CGI.param('move_cart_by_default') %]selected="selected"[% END%]>[% l('Yes') %]
77 <td class="list-create-table-buttons">
78 <button type="submit" class="btn btn-confirm"><i class="fas fa-plus-square" aria-hidden="true"></i> [% l('Create List') %]</button>
80 <button type="reset" class="btn btn-deny" ><i class="fas fa-ban" aria-hidden="true"></i> [% l('Cancel') %]</button>
86 [% IF (CGI.param('from_basket') && ctx.mylist.size) %]
88 <h3>[% l("... from basket") %]</h3>
89 [% INCLUDE "opac/parts/anon_list.tt2" %]
91 <h3>[% l("My Saved Lists") %]</h3>
92 [% INCLUDE "opac/parts/anon_list.tt2" %]
94 [% IF ctx.bookbags.size %]
95 <div class="header_middle">
96 <span class="sr-only">[% l('Saved Lists') %]</span>
97 [% IF limit < ctx.bookbag_count; %]
98 <span class='float-left' style='padding-left: 10px;'>
100 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
101 offset => (offset - limit)
102 }) %]'><span class="nav_arrow_fix">◄</span>[% l('Previous') %]</a>
104 [%- IF (offset - (limit * 3)) >= 0 -%]
105 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
106 offset => (offset - (limit * 3))
107 }) %]'>[% ((offset - (limit * 3)) / limit) + 1 %]</a>
109 [%- IF (offset - (limit * 2)) >= 0 -%]
110 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
111 offset => (offset - (limit * 2))
112 }) %]'>[% ((offset - (limit * 2)) / limit) + 1 %]</a>
114 [%- IF (offset - limit) >= 0 -%]
115 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
116 offset => (offset - limit)
117 }) %]'>[% ((offset - limit) / limit) + 1 %]</a>
119 <span class="bookbag-paginator-selected" >[% (offset / limit) + 1 %]</span>
120 [%- IF (offset + limit) < ctx.bookbag_count -%]
121 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
122 offset => (offset + limit)
123 }) %]'>[% ((offset + limit) / limit) + 1 %]</a>
125 [%- IF (offset + (limit * 2)) < ctx.bookbag_count -%]
126 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
127 offset => (offset + (limit * 2))
128 }) %]'>[% ((offset + (limit * 2)) / limit) + 1 %]</a>
130 [%- IF (offset + (limit * 3)) < ctx.bookbag_count -%]
131 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
132 offset => (offset + (limit * 3))
133 }) %]'>[% ((offset + (limit * 3)) / limit) + 1 %]</a>
135 [%- IF (ctx.bookbag_count - offset) > limit; -%]
136 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
137 offset => (offset + limit)
138 }) %]'>[% l('Next') %]<span class="nav_arrow_fix">►</span></a>
144 <div id='acct_lists_prime'>
145 [% FOR bbag IN ctx.bookbags %]
147 <table class="table" style="border:3px solid #8DC641;"><tr>
148 <td class="listTitleText">
149 [% baseurl = ctx.opac_root _ '/myopac/lists';
150 IF bbag.id != CGI.param("bbid");
151 url = mkurl(baseurl,{bbid => bbag.id, item_page => 1},['edit_notes','sort']);
152 ltitle = l("Show items in list");
154 url = mkurl(baseurl, {}, ['bbid', 'edit_notes', 'sort']);
155 ltitle = l("Hide items in list");
157 <h4 class="bookbag-name"><a title="[% ltitle %]" href="[% url %]">[% bbag.name | html %]</a>[% IF bbag.pub == 't'; %]
158 <a target='_blank' href='/opac/extras/feed/bookbag/rss2-full/[% bbag.id %]' aria-label="RSS Feed">
159 <i class="fas fa-rss-square" aria-hidden="true"></i></a>
161 [% IF bbag.description %]<div class="bookbag-description" style="padding-left: 20px;">[% bbag.description | html %]</div>[% END %]
167 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update', {}, 1) %]" method="post">
168 <div class="bookbag-controls">
169 <input type="hidden" name="action" value="add_rec" />
170 <input type="hidden" name="list" value="[% bbag.id %]" />
171 <input type="hidden" name="add_rec" value="[% ctx.add_rec %]" />
172 [% IF ctx.where_from %]
173 <input type="hidden" name="where_from" value="[% ctx.where_from %]" />
175 <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>
179 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post">
180 <div class="bookbag-share">
181 <input type="hidden" name="list" value="[% bbag.id %]" />
182 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
183 [% IF bbag.pub != 't' %]
184 <input type="hidden" name="action" value="show" />
185 <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>
187 <input type="hidden" name="action" value="hide" />
188 <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>
193 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/print') %]" method="post">
194 <div class="bookbag-controls">
195 <input type="hidden" name="list" value="[% bbag.id %]" />
196 <input type="hidden" name="sort" value="[% CGI.param('sort') | html %]" />
197 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
198 <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>
201 [% setting = 'opac.default_list'; %]
202 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post">
203 <div class="bookbag-controls">
204 <input type="hidden" name="list" value="[% bbag.id %]" />
205 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
206 [% IF ctx.user_setting_map.$setting == bbag.id %]
207 <input type="hidden" name="action" value="remove_default" />
208 <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>
210 <input type="hidden" name="action" value="make_default" />
211 <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>
215 [% IF ctx.is_staff %]
216 <div class="bookbag-controls">
221 "oils://remote/xul/server/cat/bucketz39_dialog.xul";
223 xulG.url_prefix(path),
225 "width=800,height=500",
227 "[% ctx.authtoken %]",
228 "[% ctx.user.ws_ou %]",
232 value="[% l('Locate Z39.50 Matches') %]"
233 ><i class="fas fa-external-link-alt" aria-hidden="true"></i></button>
236 [% IF bbag.pub == 't'; %]
237 <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" aria-hidden="true"></i> [% l('View in Catalog') %]</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-deny btn-sm m-1"><i class="fas fa-trash-alt" aria-hidden="true"></i> [% l('Delete List') %]</button>
260 [% IF CGI.param("bbid") == bbag.id %]
263 <h5 class="sr-only">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 <div style="border:1px solid #8DC641;margin: -17px 0px 30px 0px;">
269 [% IF bbag.items.size %]
270 <div class="my-2" style="padding-left:30px;">
271 [% l('Select at least one item from your list below to use these actions:') %]<br/>
272 <button name="action" class="btn btn-action" type="submit" value="place_hold" id="place_hold">[% l('Place hold') %]</button>
273 <button name="action" class="btn btn-action" type="submit" value="print">[% l('Print title details') %]</button>
274 <button name="action" class="btn btn-action" type="submit" value="email">[% l('Email title details') %]</button>
275 <button name="action" class="btn btn-action" type="submit" value="del_item">[% l('Remove from list') %]</button>
280 <div class="d-block d-md-none">
283 <input id="check_all_list_items" checked="checked" type="checkbox" onclick="var inputs=document.getElementsByTagName('input');
284 for (i = 0; i < inputs.length; i++) {
285 if (inputs[i].name == 'selected_item' && !inputs[i].disabled && inputs[i].getAttribute('bbag') == [% bbag.id %])
286 inputs[i].checked = this.checked;}"/>
288 <label for="check_all_list_items">[% l('Check/Uncheck All') %]</label>
290 <table class="table table-hover miniTable w-100 bookbagTable">
293 <th class="list_checkbox">
294 <input type="checkbox"
295 onclick="var inputs=document.getElementsByTagName('input');
296 for (i = 0; i < inputs.length; i++) {
297 if (inputs[i].name == 'selected_item' && !inputs[i].disabled && inputs[i].getAttribute('bbag') == [% bbag.id %])
298 inputs[i].checked = this.checked;}"/>
301 <th class="list_entry">
302 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=> (CGI.param('sort') == 'titlesort' ? 'titlesort.descending' : 'titlesort')}) %]">[% l('Title') %]</a>
304 <th class="list_entry">
305 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=>(CGI.param('sort') == 'authorsort' ? 'authorsort.descending' : 'authorsort')}) %]">[% l('Author(s)') %]</a>
307 <th class='list_entry'>
308 [% l('Local Call Number') %]
310 <th class="list_entry">
311 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=>(CGI.param('sort') == 'pubdate' ? 'pubdate.descending' : 'pubdate')}) %]">[% l('Publication Date') %]</a>
313 <th class="list_entry">
316 <th class="list_entry">
318 [% IF CGI.param("edit_notes") != bbag.id %]
319 | <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {edit_notes=> bbag.id}) %]">[% l('Edit') %]</a>
325 [% UNLESS bbag.items.size %]
326 <tr><td colspan="6" class="list_is_empty">
327 [% l("This list contains no items.") %]
330 [% FOR item IN bbag.items;
331 rec_id = item.target_biblio_record_entry.id;
332 attrs = {marc_xml => ctx.bookbags_marc_xml.$rec_id};
333 PROCESS get_marc_attrs args=attrs %]
334 <tr class="bookbag-item-row">
335 <td class="list_checkbox">
336 <input type="checkbox" name="selected_item" value="[% item.id %]" bbag='[% bbag.id %]'/>
338 <td class="list_entry" data-label="[% l('Title') %]">
339 <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec_id, {}, ['edit_notes', 'bbid']) %]">[% attrs.title | html %]</a>
341 <td class="list_entry" data-label="[% l('Author(s)') %]">
343 authorquery = attrs.author | replace('[,\.:;]', '');
344 mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page', 'bbid', 'edit_notes'])
345 -%]">[% attrs.author | html %]</a>
347 <td class="list_entry" data-label="[% l('Local Call Number') %]">
349 copy = attrs.holdings.0;
351 # only show a relevant call number
352 copy_org = ctx.get_aou_by_shortname(copy.owner);
353 FOR ctx_org IN [ctx.pref_ou, ctx.search_ou, ctx.home_ou, ctx.physical_loc];
355 ctx_org = ctx.get_aou(ctx_org);
356 IF ctx.org_within_scope(ctx_org, copy_org, ctx_org.ou_type.depth);
357 l('[_1] ([_2])', copy.label, copy_org.name) | html;
364 <td class="list_entry" data-label="[% l('Publication Date') %]">
365 [% attrs.pubdate | html %]
367 <td class="list_entry" data-label="[% l('Format') %]">
368 [% attrs.format_label | html %]
370 [% IF CGI.param("edit_notes") == bbag.id %]
371 <td class="list_entry" data-label="[% l('Notes') %]">
372 [% FOR note IN item.notes %]
373 <input type="text" name="note-[% note.id %]" value="[% note.note | html %]" />
375 <input type="text" name="item-[% item.id %]" />
378 <td class="list_entry" data-label="[% l('Notes') %]">
379 [% FOR note IN item.notes %]
380 <div>[% note.note | html %]</div>
386 [% IF CGI.param("edit_notes") == bbag.id %]
387 <tr class="mobile_hide">
388 <td colspan="6"><!-- All space left of notes column --></td>
389 <td class="save-notes">
390 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
391 <input type="hidden" name="bbid" value="[% CGI.param('bbid') | html %]" />
392 <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>
402 [% IF ctx.bb_page_count > 1; %]
403 <div class="header_middle" style="padding-top:7px;">
404 <div class="bbag-navigate-list sr-only">[% l('Navigate Selected List ') %]</div>
405 <div class="bbag-navigate-list-pages" style="width:100%;text-align:center;">
406 [%- IF item_page > 1 -%]
407 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
408 item_page => item_page - 1
409 }) %]'><span class="nav_arrow_fix">◄</span>[% l('Previous') %]</a>
412 [%- IF (item_page - 3) >= 1 -%]
413 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
414 item_page => item_page - 3
415 }) %]'>[% item_page - 3 %]</a>
417 [%- IF (item_page - 2) >= 1 -%]
418 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
419 item_page => item_page - 2
420 }) %]'>[% item_page - 2 %]</a>
422 [%- IF (item_page - 1) >= 1 -%]
423 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
424 item_page => item_page - 1
425 }) %]'>[% item_page - 1%]</a>
427 <span class="bookbag-paginator-selected" >[% item_page %]</span>
428 [%- IF (item_page + 1) <= ctx.bb_page_count -%]
429 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
430 item_page => item_page + 1
431 }) %]'>[% item_page + 1 %]</a>
433 [%- IF (item_page + 2) <= ctx.bb_page_count -%]
434 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
435 item_page => item_page + 2
436 }) %]'>[% item_page + 2 %]</a>
438 [%- IF (item_page + 3) <= ctx.bb_page_count -%]
439 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
440 item_page => item_page + 3
441 }) %]'>[% item_page + 3 %]</a>
444 [%- IF (item_page + 1) <= ctx.bb_page_count; -%]
445 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
446 item_page => item_page + 1
447 }) %]'>[% l('Next') %]<span class="nav_arrow_fix">►</span></a>