[% PROCESS "opac/parts/header.tt2"; PROCESS "opac/parts/misc_util.tt2"; WRAPPER "opac/parts/myopac/base.tt2"; myopac_page = "lists" limit = ctx.bookbags_limit; offset = ctx.bookbags_offset; item_page = ctx.bookbags_item_page; bb_publish_text = l( "Sharing a list means that the contents " _ "of the list will be visible to others. " _ "To see the public view of a shared list, " _ "click on the HTML View link in the Saved Lists section."); %]

[% l('My Lists') %]

[% l('Create New List') %]

[% IF ctx.mylist.size %] [% END %]
[%- INCLUDE "opac/parts/preserve_params.tt2"; %] [% IF ctx.add_rec %] [% END %] [% IF ctx.where_from %] [% END %]
 
[% IF (CGI.param('from_basket') && ctx.mylist.size) %]

[% l("... from basket") %]

[% INCLUDE "opac/parts/anon_list.tt2" %] [% ELSE %]

[% l("My Existing Basket and Lists") %]

[% INCLUDE "opac/parts/anon_list.tt2" %] [% IF ctx.bookbags.size %]
[% l('Saved Lists') %] [% IF limit < ctx.bookbag_count; %] [%- IF offset > 0 -%] (offset - limit) }) %]'>[% l('Previous') %] [%- END; -%] [%- IF (offset - (limit * 3)) >= 0 -%] (offset - (limit * 3)) }) %]'>[% ((offset - (limit * 3)) / limit) + 1 %] [%- END; -%] [%- IF (offset - (limit * 2)) >= 0 -%] (offset - (limit * 2)) }) %]'>[% ((offset - (limit * 2)) / limit) + 1 %] [%- END; -%] [%- IF (offset - limit) >= 0 -%] (offset - limit) }) %]'>[% ((offset - limit) / limit) + 1 %] [%- END; -%] [% (offset / limit) + 1 %] [%- IF (offset + limit) < ctx.bookbag_count -%] (offset + limit) }) %]'>[% ((offset + limit) / limit) + 1 %] [%- END; -%] [%- IF (offset + (limit * 2)) < ctx.bookbag_count -%] (offset + (limit * 2)) }) %]'>[% ((offset + (limit * 2)) / limit) + 1 %] [%- END; -%] [%- IF (offset + (limit * 3)) < ctx.bookbag_count -%] (offset + (limit * 3)) }) %]'>[% ((offset + (limit * 3)) / limit) + 1 %] [%- END; -%] [%- IF (ctx.bookbag_count - offset) > limit; -%] (offset + limit) }) %]'>[% l('Next') %] [%- END; -%] [% END %]
[% FOR bbag IN ctx.bookbags %]
[% baseurl = ctx.opac_root _ '/myopac/lists'; IF bbag.id != CGI.param("bbid"); url = mkurl(baseurl,{bbid => bbag.id, item_page => 1},['edit_notes','sort']); ltitle = l("Show items in list"); ELSE; url = mkurl(baseurl, {}, ['bbid', 'edit_notes', 'sort']); ltitle = l("Hide items in list"); END %]

[% bbag.name | html %][% IF bbag.pub == 't'; %] [% END %]

[% IF bbag.description %]
[% bbag.description | html %]
[% END %]
[% IF ctx.add_rec %]
[% IF ctx.where_from %] [% END %]
[% END %]
[%- INCLUDE "opac/parts/preserve_params.tt2"; %] [% IF bbag.pub != 't' %] [% ELSE %] [% END %]
[%- INCLUDE "opac/parts/preserve_params.tt2"; %]
[% setting = 'opac.default_list'; %]
[%- INCLUDE "opac/parts/preserve_params.tt2"; %] [% IF ctx.user_setting_map.$setting == bbag.id %] [% ELSE %] [% END %]
[% IF ctx.is_staff %]
[% END %] [% IF bbag.pub == 't'; %] [% END %]
[%- INCLUDE "opac/parts/preserve_params.tt2"; %]
[% IF CGI.param("bbid") == bbag.id %]
List Items
[% IF bbag.items.size %]
[% END %]
[% UNLESS bbag.items.size %] [% END %] [% FOR item IN bbag.items; rec_id = item.target_biblio_record_entry.id; attrs = {marc_xml => ctx.bookbags_marc_xml.$rec_id}; PROCESS get_marc_attrs args=attrs %] [% IF CGI.param("edit_notes") == bbag.id %] [% ELSE %] [% END %] [% END %] [% IF CGI.param("edit_notes") == bbag.id %] [% END %]
[% l('Title') %] [% l('Author(s)') %] [% l('Local Call Number') %] [% l('Publication Date') %] [% l('Format') %] [% l('Notes') %] [% IF CGI.param("edit_notes") != bbag.id %] | [% l('Edit') %] [% END %]
[% l("This list contains no items.") %]
[% attrs.title | html %] [% attrs.author | html %] [% copy = attrs.holdings.0; IF copy; # only show a relevant call number copy_org = ctx.get_aou_by_shortname(copy.owner); FOR ctx_org IN [ctx.pref_ou, ctx.search_ou, ctx.home_ou, ctx.physical_loc]; NEXT UNLESS ctx_org; ctx_org = ctx.get_aou(ctx_org); IF ctx.org_within_scope(ctx_org, copy_org, ctx_org.ou_type.depth); l('[_1] ([_2])', copy.label, copy_org.name) | html; LAST; END; END; END; %] [% attrs.pubdate | html %] [% attrs.format_label | html %] [% FOR note IN item.notes %] [% END %] [% FOR note IN item.notes %]
[% note.note | html %]
[% END %]
[%- INCLUDE "opac/parts/preserve_params.tt2"; %]
[% IF ctx.bb_page_count > 1; %]
[% l('Navigate Selected List ') %]
[%- IF item_page > 1 -%] item_page - 1 }) %]'>[% l('Previous') %] [%- END; -%] [%- IF (item_page - 3) >= 1 -%] item_page - 3 }) %]'>[% item_page - 3 %] [%- END; -%] [%- IF (item_page - 2) >= 1 -%] item_page - 2 }) %]'>[% item_page - 2 %] [%- END; -%] [%- IF (item_page - 1) >= 1 -%] item_page - 1 }) %]'>[% item_page - 1%] [%- END; -%] [% item_page %] [%- IF (item_page + 1) <= ctx.bb_page_count -%] item_page + 1 }) %]'>[% item_page + 1 %] [%- END; -%] [%- IF (item_page + 2) <= ctx.bb_page_count -%] item_page + 2 }) %]'>[% item_page + 2 %] [%- END; -%] [%- IF (item_page + 3) <= ctx.bb_page_count -%] item_page + 3 }) %]'>[% item_page + 3 %] [%- END; -%] [%- IF (item_page + 1) <= ctx.bb_page_count; -%] item_page + 1 }) %]'>[% l('Next') %] [%- END; -%]
[% END %]
[% END %] [% END %]
[% END %][% END %] [% END %]