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;
8 <div id='myopac_bookbag_div' style="padding:5px;">
10 <!-- new list creation -->
11 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST" id="create_form">
12 <h1>[% l('Create new list') %]</h1><a name="createnewlist"></a>
13 <table cellpadding="0" border="0" id="list_create_table">
16 <label for="list_create_name">[% l('Enter the name of the new list:') %]</label>
19 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
20 <input id="list_create_name" type="text" name="name" />
21 <input type="hidden" name="action" value="create" />
24 <label for="list_create_shared">[% l('Share this list?') %]</label>
25 <select name="shared" id="list_create_shared">
26 <option value="0">[% l('No') %]
27 <option value="1">[% l('Yes') %]
29 <a href="javascript:void(0);" onclick="alert(document.getElementById('bb_publish_text').innerHTML);"><img alt="[% l('Sharing Help') %]"
30 src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
32 <td class="list-create-table-buttons">
34 value="[% l('Submit') %]"
35 alt="[% l('Submit') %]"
37
39 value="[% l('Cancel') %]"
40 alt="[% l('Cancel') %]"
41 class="opac-button" />
45 <td class="text-right-top">
46 <label for="list_description">[% l("List description (optional):") %]</label>
49 <textarea cols="40" rows="3" name="description"
50 id="list_description"></textarea>
55 <h1>[% l("Your existing lists") %]</h1>
56 [% INCLUDE "opac/parts/anon_list.tt2" %]
57 [% IF ctx.bookbags.size %]
58 <div class="header_middle">
59 <span class="float-left">[% l('Saved Lists') %]</span>
60 <span class='float-left' style='padding-left: 10px;'>
61 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {limit => limit, offset => (offset - limit)}) %]'
62 [% IF offset == 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">◄</span>[% l('Previous') %]</a>
63 [%# TODO: get total to prevent paging off then end of the list.. %]
64 <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {limit => limit, offset => (offset + limit)}) %]'
65 [% IF ctx.bookbags.size < limit %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">►</span></a>
68 <div class="clear-both"></div>
70 <div id='acct_lists_prime'>
71 [% FOR bbag IN ctx.bookbags %]
72 <div class="bookbag-controls-holder">
73 <div class="bookbag-controls most">
74 [% baseurl = ctx.opac_root _ '/myopac/lists';
75 IF bbag.id != CGI.param("bbid");
76 url = mkurl(baseurl,{bbid => bbag.id},['edit_notes','sort']);
77 ltitle = l("Show items in list");
79 url = mkurl(baseurl, {}, ['bbid', 'edit_notes', 'sort']);
80 ltitle = l("Hide items in list");
82 <h2 class="bookbag-name"><a title="[% ltitle %]" href="[% url %]">[% bbag.name | html %]</a></h2>
83 [% IF bbag.description %]<div class="bookbag-description">[% bbag.description | html %]</div>[% END %]
85 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST">
86 <div class="bookbag-share">
87 <input type="hidden" name="list" value="[% bbag.id %]" />
88 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
89 [% IF bbag.pub != 't' %]
90 <input type="hidden" name="action" value="show" />
91 <input class="fixed" type="submit" value="[% l('Share') %]" />
93 <input type="hidden" name="action" value="hide" />
94 <input class="fixed" type="submit" value="[% l('Hide') %]" />
98 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST">
99 <div class="bookbag-controls">
100 <input type="hidden" name="list" value="[% bbag.id %]" />
101 <input type="hidden" name="action" value="delete" />
102 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
103 <input type="submit" value="[% l('Delete List') %]" />
106 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/print') %]" method="POST">
107 <div class="bookbag-controls">
108 <input type="hidden" name="list" value="[% bbag.id %]" />
109 <input type="hidden" name="sort" value="[% CGI.param('sort') | html %]" />
110 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
111 <input type="submit" value="[% l('Download CSV') %]" />
114 <div class="bookbag-controls">
115 [% IF bbag.pub == 't'; %]
116 <a target='_blank' href='/opac/extras/feed/bookbag/rss2-full/[% bbag.id %]'><img
117 alt="[% l('RSS Feed') %]" border="0"
118 src="[% ctx.media_prefix %]/images/small-rss.png"/></a>
121 <div class="bookbag-controls">
122 [% IF bbag.pub == 't'; %]
125 ctx.opac_root _ '/results',
126 {page => '0', bookbag => bbag.id, depth => 0, locg => ctx.search_ou},
129 -%]'>[% l('HTML View') %]</a>
132 <div class="clear-both pad-bottom-five"></div>
134 [% IF CGI.param("bbid") == bbag.id %]
135 <div class="bookbag-specific">
138 <label for="opac.result.sort">[% l("Sort list items by: ") %]</label>
139 [%- INCLUDE "opac/parts/preserve_params.tt2" params=['loc', 'query', 'qtype']; %]
140 [% INCLUDE "opac/parts/filtersort.tt2"
141 value=CGI.param('sort') mode='bookbag' %]
142 <input type="hidden" name="bbid"
143 value="[% CGI.param('bbid') | html %]" />
144 <input type="submit" value="[% l('Sort') %]" />
149 <input type="hidden" name="bbid" value="[% bbag.id %]" />
150 <input type="hidden" name="action" value="editmeta" />
151 <input type="hidden" name="limit" value="[% limit %]" />
152 <input type="hidden" name="offset" value="[% offset %]" />
153 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
154 <table id="bbag-name-desc-form">
157 <label for="bbag-edit-name">[% l('Name:') %]</label>
160 <input name="name" type="text"
161 value="[% bbag.name | html %]"
162 id="bbag-edit-name" />
164 <td rowspan="2" class="saver">
165 [% l("Save changes to name or description?") %]<br />
166 <input type="submit" value="[% l('Save') %]" />
170 <th><label for="bbag-edit-description">[% l('Description:') %]</label></th>
172 <textarea name="description"
173 id="bbag-edit-description">[% bbag.description | html %]</textarea>
180 <br class="clear-both" />
181 <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST">
182 <input type="hidden" name="list" value="[% bbag.id %]" />
183 <input type="hidden" name="sort" value="[% CGI.param('sort') | uri %]" />
184 <table class="bookbag-specific" cellpadding='0' cellspacing='0' border='0'>
185 <thead id="acct_list_header">
187 <td class="list_checkbox">
188 <input type="checkbox" onclick="
189 var inputs=document.getElementsByTagName('input');
190 for (i = 0; i < inputs.length; i++) {
191 if (inputs[i].name == 'selected_item' && !inputs[i].disabled && inputs[i].getAttribute('bbag') == [% bbag.id %])
192 inputs[i].checked = this.checked;}"/>
195 <td class="list_entry">
196 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=> (CGI.param('sort') == 'titlesort' ? 'titlesort.descending' : 'titlesort')}) %]">[% l('Title') %]</a>
198 <td class="list_entry">
199 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=>(CGI.param('sort') == 'authorsort' ? 'authorsort.descending' : 'authorsort')}) %]">[% l('Author(s)') %]</a>
201 <td class="list_entry">
203 [% IF CGI.param("edit_notes") != bbag.id %]
204 | <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {edit_notes=> bbag.id}) %]">[% l('Edit') %]</a>
207 <td class="list_actions">
208 <select name="action">
209 <option disabled="disabled">[% l('-- Actions for these items --') %]</option>
210 <option value="place_hold">[% l('Place hold') %]</option>
211 <option value="del_item">[% l('Remove from list') %]</option>
213 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
214 <input type="submit" value="[% l('Go') %]" />
219 [% UNLESS bbag.items.size %]
220 <tr><td colspan="4" class="list_is_empty">
221 [% l("This list contains no items.") %]
224 [% FOR item IN bbag.items;
225 rec_id = item.target_biblio_record_entry.id;
226 attrs = {marc_xml => ctx.bookbags_marc_xml.$rec_id};
227 PROCESS get_marc_attrs args=attrs %]
228 <tr class="bookbag-item-row">
229 <td class="list_checkbox">
230 <input type="checkbox" name="selected_item" value="[% item.id %]" bbag='[% bbag.id %]'/>
232 <td class="list_entry">
233 <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec_id, {}, ['edit_notes', 'bbid']) %]">[% attrs.title | html %]</a>
235 <td class="list_entry">
237 authorquery = attrs.author | replace('[,\.:;]', '');
238 mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page', 'bbid', 'edit_notes'])
239 -%]">[% attrs.author | html %]</a>
240 [% IF CGI.param("edit_notes") == bbag.id %]
241 <td class="list_entry">
242 [% FOR note IN item.notes %]
243 <input type="text" name="note-[% note.id %]" value="[% note.note | html %]" />
245 <input type="text" name="item-[% item.id %]" />
248 <td class="list_entry">
249 [% FOR note IN item.notes %]
250 <div>[% note.note | html %]</div>
256 [% IF CGI.param("edit_notes") == bbag.id %]
258 <td colspan="3"><!-- All space left of notes column --></td>
259 <td class="save-notes">
260 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
261 <input type="hidden" name="bbid" value="[% CGI.param('bbid') | html %]" />
262 <input type="submit" name="save_notes" value="[% l('Save Notes') %]" />
274 <span id='bb_publish_text' class='hide_me'>
275 [% |l %]Sharing a Bookbag means that the contents
276 of the Bookbag will be visible to others.
277 To see the public view of a shared Bookbag,
278 click on the Bookbag's name in the Bookbag list.[% END %]