--- /dev/null
+[% 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;
+%]
+<div id='myopac_bookbag_div' style="padding:5px;">
+
+ <!-- new list creation -->
+ <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST" id="create_form">
+ <h1>[% l('Create new list') %]</h1><a name="createnewlist"></a>
+ <table cellpadding="0" border="0" id="list_create_table">
+ <tr>
+ <td>
+ <label for="list_create_name">[% l('Enter the name of the new list:') %]</label>
+ </td>
+ <td>
+ [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+ <input id="list_create_name" type="text" name="name" />
+ <input type="hidden" name="action" value="create" />
+ [% IF ctx.add_rec %]
+ <input type="hidden" name="add_rec" value="[% ctx.add_rec %]" />
+ [% END %]
+ [% IF ctx.where_from %]
+ <input type="hidden" name="where_from" value="[% ctx.where_from %]" />
+ [% END %]
+ </td>
+ <td>
+ <label for="list_create_shared">[% l('Share this list?') %]</label>
+ <select name="shared" id="list_create_shared">
+ <option value="0">[% l('No') %]
+ <option value="1">[% l('Yes') %]
+ </select>
+ <a href="javascript:void(0);" onclick="alert(document.getElementById('bb_publish_text').innerHTML);"><img alt="[% l('Sharing Help') %]"
+ src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
+ </td>
+ <td class="list-create-table-buttons">
+ <input type="submit"
+ value="[% l('Submit') %]"
+ alt="[% l('Submit') %]"
+ class="opac-button"/>
+
+ <input type="reset"
+ value="[% l('Cancel') %]"
+ alt="[% l('Cancel') %]"
+ class="opac-button" />
+ </td>
+ </tr>
+ <tr>
+ <td class="text-right-top">
+ <label for="list_description">[% l("List description (optional):") %]</label>
+ </td>
+ <td colspan="3">
+ <textarea cols="40" rows="3" name="description"
+ id="list_description"></textarea>
+ </td>
+ </table>
+ </form>
+
+ <h1>[% l("Your existing lists") %]</h1>
+ [% INCLUDE "opac/parts/anon_list.tt2" %]
+ [% IF ctx.bookbags.size %]
+ <div class="header_middle">
+ <span class="float-left">[% l('Saved Lists') %]</span>
+ [% IF limit < ctx.bookbag_count; %]
+ <span class='float-left' style='padding-left: 10px;'>
+ [%- IF offset > 0 -%]
+ <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
+ limit => limit, offset => (offset - limit)
+ }) %]'><span class="nav_arrow_fix">◄</span>[% l('Previous') %]</a>
+ [%- END; -%]
+ [%- IF (ctx.bookbag_count - offset) > limit; -%]
+ <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {
+ limit => limit, offset => (offset + limit)
+ }) %]'>[% l('Next') %]<span class="nav_arrow_fix">►</span></a>
+ </span>
+ [%- END; -%]
+ [% END %]
+ </div>
+ <div class="clear-both"></div>
+
+ <div id='acct_lists_prime'>
+ [% FOR bbag IN ctx.bookbags %]
+ <div class="bookbag-controls-holder">
+ <div class="bookbag-controls most">
+ [% 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 %]
+ <h2 class="bookbag-name"><a title="[% ltitle %]" href="[% url %]">[% bbag.name | html %]</a></h2>
+ [% IF bbag.description %]<div class="bookbag-description">[% bbag.description | html %]</div>[% END %]
+ </div>
+ [% IF ctx.add_rec %]
+ <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update', {}, 1) %]" method="POST">
+ <div class="bookbag-controls">
+ <input type="hidden" name="action" value="add_rec" />
+ <input type="hidden" name="list" value="[% bbag.id %]" />
+ <input type="hidden" name="add_rec" value="[% ctx.add_rec %]" />
+ [% IF ctx.where_from %]
+ <input type="hidden" name="where_from" value="[% ctx.where_from %]" />
+ [% END %]
+ <input class="fixed" type="submit" value="[% l('Add to this list') %]" />
+ </div>
+ </form>
+ [% END %]
+ <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST">
+ <div class="bookbag-share">
+ <input type="hidden" name="list" value="[% bbag.id %]" />
+ [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+ [% IF bbag.pub != 't' %]
+ <input type="hidden" name="action" value="show" />
+ <input class="fixed" type="submit" value="[% l('Share') %]" />
+ [% ELSE %]
+ <input type="hidden" name="action" value="hide" />
+ <input class="fixed" type="submit" value="[% l('Hide') %]" />
+ [% END %]
+ </div>
+ </form>
+ <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST">
+ <div class="bookbag-controls">
+ <input type="hidden" name="list" value="[% bbag.id %]" />
+ <input type="hidden" name="action" value="delete" />
+ [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+ <input type="submit" value="[% l('Delete List') %]" />
+ </div>
+ </form>
+ <form action="[% mkurl(ctx.opac_root _ '/myopac/list/print') %]" method="POST">
+ <div class="bookbag-controls">
+ <input type="hidden" name="list" value="[% bbag.id %]" />
+ <input type="hidden" name="sort" value="[% CGI.param('sort') | html %]" />
+ [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+ <input type="submit" value="[% l('Download CSV') %]" />
+ </div>
+ </form>
+ [% setting = 'opac.default_list'; %]
+ <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST">
+ <div class="bookbag-controls">
+ <input type="hidden" name="list" value="[% bbag.id %]" />
+ [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+ [% IF ctx.user_setting_map.$setting == bbag.id %]
+ <input type="hidden" name="action" value="remove_default" />
+ <input type="submit" value="[% l('Remove Default List') %]" />
+ [% ELSE %]
+ <input type="hidden" name="action" value="make_default" />
+ <input type="submit" value="[% l('Make Default List') %]" />
+ [% END %]
+ </div>
+ </form>
+ <div class="bookbag-controls">
+ [% IF bbag.pub == 't'; %]
+ <a target='_blank' href='/opac/extras/feed/bookbag/rss2-full/[% bbag.id %]'><img
+ alt="[% l('RSS Feed') %]" border="0"
+ src="[% ctx.media_prefix %]/images/small-rss.png"/></a>
+ [% END %]
+ </div>
+ <div class="bookbag-controls">
+ [% IF bbag.pub == 't'; %]
+ <a href='[%-
+ mkurl(
+ ctx.opac_root _ '/results',
+ {page => '0', bookbag => bbag.id, depth => 0, locg => ctx.search_ou},
+ 1
+ )
+ -%]'>[% l('HTML View') %]</a>
+ [% END %]
+ </div>
+ <div class="clear-both pad-bottom-five"></div>
+ </div>
+ [% IF CGI.param("bbid") == bbag.id %]
+ <div class="bookbag-specific">
+ <div class="sort">
+ <form method="GET">
+ <label for="opac.result.sort">[% l("Sort list items by: ") %]</label>
+ [%- INCLUDE "opac/parts/preserve_params.tt2" params=['loc', 'query', 'qtype']; %]
+ [% INCLUDE "opac/parts/filtersort.tt2"
+ value=CGI.param('sort') mode='bookbag' %]
+ <input type="hidden" name="bbid"
+ value="[% CGI.param('bbid') | html %]" />
+ <input type="submit" value="[% l('Sort') %]" />
+ </form>
+ </div>
+ <div class="meta">
+ <form method="POST">
+ <input type="hidden" name="bbid" value="[% bbag.id %]" />
+ <input type="hidden" name="action" value="editmeta" />
+ <input type="hidden" name="limit" value="[% limit %]" />
+ <input type="hidden" name="offset" value="[% offset %]" />
+ [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+ <table id="bbag-name-desc-form">
+ <tr>
+ <th>
+ <label for="bbag-edit-name">[% l('Name:') %]</label>
+ </th>
+ <td>
+ <input name="name" type="text"
+ value="[% bbag.name | html %]"
+ id="bbag-edit-name" />
+ </td>
+ <td rowspan="2" class="saver">
+ [% l("Save changes to name or description?") %]<br />
+ <input type="submit" value="[% l('Save') %]" />
+ </td>
+ </tr>
+ <tr>
+ <th><label for="bbag-edit-description">[% l('Description:') %]</label></th>
+ <td>
+ <textarea name="description"
+ id="bbag-edit-description">[% bbag.description | html %]</textarea>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+ </div>
+ <br class="clear-both" />
+ <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST">
+ <input type="hidden" name="list" value="[% bbag.id %]" />
+ <input type="hidden" name="sort" value="[% CGI.param('sort') | uri %]" />
+ <table class="bookbag-specific" cellpadding='0' cellspacing='0' border='0'>
+ <thead id="acct_list_header">
+ <tr>
+ <td class="list_checkbox">
+ <input type="checkbox" onclick="
+ var inputs=document.getElementsByTagName('input');
+ for (i = 0; i < inputs.length; i++) {
+ if (inputs[i].name == 'selected_item' && !inputs[i].disabled && inputs[i].getAttribute('bbag') == [% bbag.id %])
+ inputs[i].checked = this.checked;}"/>
+
+ </td>
+ <td class="list_entry">
+ <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=> (CGI.param('sort') == 'titlesort' ? 'titlesort.descending' : 'titlesort')}) %]">[% l('Title') %]</a>
+ </td>
+ <td class="list_entry">
+ <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=>(CGI.param('sort') == 'authorsort' ? 'authorsort.descending' : 'authorsort')}) %]">[% l('Author(s)') %]</a>
+ </td>
+ <td class="list_entry">
+ <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=>(CGI.param('sort') == 'pubdate' ? 'pubdate.descending' : 'pubdate')}) %]">[% l('Publication Date') %]</a>
+ </td>
+ <td class="list_entry">
+ [% l('Format') %]
+ </td>
+ <td class="list_entry">
+ [% l('Notes') %]
+ [% IF CGI.param("edit_notes") != bbag.id %]
+ | <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {edit_notes=> bbag.id}) %]">[% l('Edit') %]</a>
+ [% END %]
+ </td>
+ <td class="list_actions">
+ <select name="action">
+ <option disabled="disabled">[% l('-- Actions for these items --') %]</option>
+ <option value="del_item">[% l('Remove from list') %]</option>
+ </select>
+ [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+ <input type="submit" value="[% l('Go') %]" />
+ </td>
+ </tr>
+ </thead>
+ <tbody>
+ [% UNLESS bbag.items.size %]
+ <tr><td colspan="6" class="list_is_empty">
+ [% l("This list contains no items.") %]
+ </td></tr>
+ [% 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 %]
+ <tr class="bookbag-item-row">
+ <td class="list_checkbox">
+ <input type="checkbox" name="selected_item" value="[% item.id %]" bbag='[% bbag.id %]'/>
+ </td>
+ <td class="list_entry">
+ <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec_id, {}, ['edit_notes', 'bbid']) %]">[% attrs.title | html %]</a>
+ </td>
+ <td class="list_entry">
+ <a href="[%-
+ authorquery = attrs.author | replace('[,\.:;]', '');
+ mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page', 'bbid', 'edit_notes'])
+ -%]">[% attrs.author | html %]</a>
+ </td>
+ <td class="list_entry">
+ [% attrs.pubdate | html %]
+ </td>
+ <td class="list_entry">
+ [% attrs.format_label | html %]
+ </td>
+ [% IF CGI.param("edit_notes") == bbag.id %]
+ <td class="list_entry">
+ [% FOR note IN item.notes %]
+ <input type="text" name="note-[% note.id %]" value="[% note.note | html %]" />
+ [% END %]
+ <input type="text" name="item-[% item.id %]" />
+ </td>
+ [% ELSE %]
+ <td class="list_entry">
+ [% FOR note IN item.notes %]
+ <div>[% note.note | html %]</div>
+ [% END %]
+ </td>
+ [% END %]
+ </tr>
+ [% END %]
+ [% IF CGI.param("edit_notes") == bbag.id %]
+ <tr>
+ <td colspan="3"><!-- All space left of notes column --></td>
+ <td class="save-notes">
+ [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+ <input type="hidden" name="bbid" value="[% CGI.param('bbid') | html %]" />
+ <input type="submit" name="save_notes" value="[% l('Save Notes') %]" />
+ </td>
+ </tr>
+ [% END %]
+ </tbody>
+ </table>
+ </form>
+ [% END %]
+ [% END %]
+ </div>
+ [% END %]
+
+ <span id='bb_publish_text' class='hide_me'>
+[% |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 %]
+ </span>
+</div>
+[% END %]
--- /dev/null
+ [% IF ctx.mylist.size %]
+ <div class="bookbag-specific">
+ <form method="GET">
+ <label for="anonsort">[% l("Sort list items by: ") %]</label>
+ [% INCLUDE "opac/parts/filtersort.tt2" mode='bookbag'
+ id="anonsort" name="anonsort" value=CGI.param("anonsort") %]
+ <input type="hidden" name="id"
+ value="[% CGI.param('id') | html %]" />
+ [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+ <input type="submit" value="[% l('Sort') %]" />
+ </form>
+ </div>
+
+ <form action="[% mkurl(ctx.opac_root _ '/mylist/move') %]" method="GET">
+ <div>
+ <p class="big-strong">[% l('Temporary List') %]</p>
+ <table cellpadding='0' cellspacing='0' border='0'>
+ <thead id="acct_list_header_anon">
+ <tr>
+ <td width="1%" style="padding-left:10px;">
+ <input type="checkbox" onclick="
+ var inputs=document.getElementsByTagName('input');
+ for (i = 0; i < inputs.length; i++) {
+ if (inputs[i].name == 'record' && !inputs[i].disabled) inputs[i].checked = this.checked;}"/>
+ </td>
+ <td width="49%" class="opac-auto-108"><a href="[% mkurl('', {anonsort=>(CGI.param('anonsort') == 'titlesort' ? 'titlesort.descending' : 'titlesort')}) %]">[% l('Title') %]</a></td>
+ <td width="49%" class="opac-auto-108"><a href="[% mkurl('', {anonsort=>(CGI.param('anonsort') == 'authorsort' ? 'authorsort.descending' : 'authorsort')}) %]">[% l('Author(s)') %]</a% l('Author(s)') %]</td>
+ <td width="1%" class="nowrap">
+ <select name="action">
+ <option>[% l('-- Actions for these items --') %]</option>
+ <option value="delete">[% l('Remove from list') %]</option>
+ [% IF ctx.user AND ctx.bookbags.size %]
+ <optgroup label="[% l('Move selected items to bookbag:') %]">
+ [% FOR bbag IN ctx.bookbags %]]
+ <option value="[% bbag.id %]" class="selector_actions_for_list_inner_option">[% bbag.name | html %]</option>
+ [% END %]
+ </optgroup>
+ [% END %]
+ </select>
+ [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+ <input type="submit" value="[% l('Go') %]" />
+ </td>
+ </tr>
+ </thead>
+ <tbody>
+ [% FOR item IN ctx.mylist;
+ attrs = {marc_xml => ctx.mylist_marc_xml.$item};
+ PROCESS get_marc_attrs args=attrs %]
+ <tr>
+ <td class="item_list_padding" style="padding-left: 10px;">
+ <input type="checkbox" name="record" value="[% item %]" />
+ </td>
+ <td class="item_list_padding" style="padding-left: 5px;"><a href="[% mkurl(ctx.opac_root _ '/record/' _ item, {}, ['edit_notes', 'id']) %]">[% attrs.title | html %]</a></td>
+ <td class="item_list_padding" style="padding-left: 5px;"><a href="[%-
+ authorquery = attrs.author | replace('[,\.:;]', '');
+ mkurl(
+ ctx.opac_root _ '/results',
+ {qtype => 'author', query => authorquery},
+ ['page', 'id', 'edit_notes']
+ )
+ -%]">[% attrs.author | html %]</a></td>
+ </tr>
+ [% END %]
+ </tbody>
+ </table>
+ <br /><br />
+ </div>
+ </form>
+ [% END %]