[% 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; %]

[% l('Create new list') %]

[%- INCLUDE "opac/parts/preserve_params.tt2"; %] [% IF ctx.add_rec %] [% END %] [% IF ctx.where_from %] [% END %] [% l('Sharing Help') %]      

[% l("Your existing lists") %]

[% INCLUDE "opac/parts/anon_list.tt2" %] [% IF ctx.bookbags.size %]
[% l('Saved Lists') %] [% IF limit < ctx.bookbag_count; %] [%- IF offset > 0 -%] limit, offset => (offset - limit) }) %]'>[% l('Previous') %] [%- END; -%] [%- IF (ctx.bookbag_count - offset) > limit; -%] limit, offset => (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},['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.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"; %]
[%- 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 bbag.pub == 't'; %] [% l('RSS Feed') %] [% END %]
[% IF CGI.param("bbid") == bbag.id %]
[%- INCLUDE "opac/parts/preserve_params.tt2" params=['loc', 'query', 'qtype']; %] [% INCLUDE "opac/parts/filtersort.tt2" value=CGI.param('sort') mode='bookbag' %]
[%- INCLUDE "opac/parts/preserve_params.tt2"; %]
[% l("Save changes to name or description?") %]

[% 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 %] [% ELSE %] [% END %] [% END %] [% IF CGI.param("edit_notes") == bbag.id %] [% END %]
[% l('Title') %] [% l('Author(s)') %] [% l('Notes') %] [% IF CGI.param("edit_notes") != bbag.id %] | [% l('Edit') %] [% END %] [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
[% l("This list contains no items.") %]
[% attrs.title | html %] [% attrs.author | html %] [% IF CGI.param("edit_notes") == bbag.id %] [% FOR note IN item.notes %] [% END %] [% FOR note IN item.notes %]
[% note.note | html %]
[% END %]
[%- INCLUDE "opac/parts/preserve_params.tt2"; %]
[% END %] [% END %]
[% END %] [% |l %]Sharing a Bookbag means that the contents of the Bookbag will be visible to others. To see the public view of a shared Bookbag, click on the Bookbag's name in the Bookbag list.[% END %]
[% END %]