]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/lists.tt2
2a9b774df392a5f4386c9b185eaff60a4180ca7e
[working/Evergreen.git] / Open-ILS / src / templates / opac / myopac / lists.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     PROCESS "opac/parts/misc_util.tt2";
3     WRAPPER "opac/parts/myopac/base.tt2";
4     myopac_page = "lists"  %]
5 <div id='myopac_bookbag_div' style="padding:5px;">
6
7     <!-- new list creation -->
8     <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST" id="create_form">
9         <h1>[% l('Create new list') %]</h1><a name="createnewlist"></a>
10         <table cellpadding="0" border="0" id="list_create_table">
11             <tr>
12                 <td>
13                     <label for="list_create_name">[% l('Enter the name of the new list:') %]</label>
14                 </td>
15                 <td>
16                     <input id="list_create_name" type="text" name="name" />
17                     <input type="hidden" name="action" value="create" />
18                 </td>
19                 <td>
20                     <label for="list_create_shared">[% l('Share this list?') %]</label>
21                     <select name="shared" id="list_create_shared">
22                         <option value="0">[% l('No') %]
23                         <option value="1">[% l('Yes') %]
24                     </select>
25                     <a href="javascript:void(0);" onclick="alert(document.getElementById('bb_publish_text').innerHTML);"><img alt="[% l('Sharing Help') %]"
26                         src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
27                 </td>
28                 <td class="list-create-table-buttons">
29                     <input type="submit"
30                         value="[% l('Submit') %]"
31                         alt="[% l('Submit') %]"
32                         class="opac-button"/>
33                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
34                     <input type="reset"
35                         value="[% l('Cancel') %]"
36                         alt="[% l('Cancel') %]"
37                         class="opac-button" />
38                 </td>
39             </tr>
40             <tr>
41                 <td class="text-right-top">
42                     <label for="list_description">[% l("List description (optional):") %]</label>
43                 </td>
44                 <td colspan="3">
45                     <textarea cols="40" rows="3" name="description"
46                         id="list_description"></textarea>
47                 </td>
48         </table>
49     </form>
50
51     <h1>[% l("Your existing lists") %]</h1>
52     [% INCLUDE "opac/parts/anon_list.tt2" %]
53     [% IF ctx.bookbags.size %]
54     <div id='acct_lists_prime'>
55         [% FOR bbag IN ctx.bookbags %]
56         <div class="bookbag-controls-holder">
57             <div class="bookbag-controls most">
58                 [% baseurl = ctx.opac_root _ '/myopac/lists';
59                 IF bbag.id != CGI.param("id");
60                     url = mkurl(baseurl,{id => bbag.id},['edit_notes','sort']);
61                     ltitle = l("Show items in list");
62                 ELSE;
63                     url = mkurl(baseurl, {}, ['id', 'edit_notes', 'sort']);
64                     ltitle = l("Hide items in list");
65                 END %]
66                 <h2 class="bookbag-name"><a title="[% ltitle %]" href="[% url %]">[% bbag.name | html %]</a></h2>
67                 [% IF bbag.description %]<div class="bookbag-description">[% bbag.description | html %]</div>[% END %]
68             </div>
69             <form action="[% ctx.opac_root %]/myopac/list/update" method="POST">
70                 <div class="bookbag-share">
71                     <input type="hidden" name="list" value="[% bbag.id %]" />
72                     [% IF bbag.pub != 't' %]
73                     <input type="hidden" name="action" value="show" />
74                     <input class="fixed" type="submit" value="[% l('Share') %]" />
75                     [% ELSE %]
76                     <input type="hidden" name="action" value="hide" />
77                     <input class="fixed" type="submit" value="[% l('Hide') %]" />
78                     [% END %]
79                 </div>
80             </form>
81             <form action="[% ctx.opac_root %]/myopac/list/update" method="POST">
82                 <div class="bookbag-controls">
83                     <input type="hidden" name="list" value="[% bbag.id %]" />
84                     <input type="hidden" name="action" value="delete" />
85                     <input type="submit" value="[% l('Delete List') %]" />
86                 </div>
87             </form>
88             <form action="[% ctx.opac_root %]/myopac/list/print" method="POST">
89                 <div class="bookbag-controls">
90                     <input type="hidden" name="list" value="[% bbag.id %]" />
91                     <input type="hidden" name="sort" value="[% CGI.param('sort') | html %]" />
92                     <input type="submit" value="[% l('Download CSV') %]" />
93                 </div>
94             </form>
95             <div class="bookbag-controls">
96                 [% IF bbag.pub == 't'; %]
97                 <a target='_blank' href='/opac/extras/feed/bookbag/rss2-full/[% bbag.id %]'><img
98                     alt="[% l('RSS Feed') %]" border="0"
99                     src="[% ctx.media_prefix %]/images/small-rss.png"/></a>
100                 [% END %]
101             </div>
102             <div class="bookbag-controls">
103                 [% IF bbag.pub == 't'; %]
104                 <a href='[%-
105                     mkurl( ctx.opac_root _ '/results', {page => '0', bookbag => bbag.id} )
106                 -%]'>[% l('HTML View') %]</a>
107                 [% END %]
108             </div>
109             <div class="clear-both pad-bottom-five"></div>
110         </div>
111         [% IF CGI.param("id") == bbag.id %]
112         <div class="bookbag-specific">
113             <div class="sort">
114                 <form method="GET">
115                     <label for="opac.result.sort">[% l("Sort list items by: ") %]</label>
116                     [% INCLUDE "opac/parts/filtersort.tt2"
117                         value=CGI.param('sort') mode='bookbag' %]
118                     <input type="hidden" name="id"
119                         value="[% CGI.param('id') | html %]" />
120                     <input type="submit" value="[% l('Sort') %]" />
121                 </form>
122             </div>
123             <div class="meta">
124                 <form method="POST">
125                     <input type="hidden" name="id" value="[% bbag.id %]" />
126                     <input type="hidden" name="action" value="editmeta" />
127                     <input type="hidden" name="sort" value="[% CGI.param('sort') | html %]" />
128                     <table id="bbag-name-desc-form">
129                         <tr>
130                             <th>
131                                 <label for="bbag-edit-name">[% l('Name:') %]</label>
132                             </th>
133                             <td>
134                                 <input name="name" type="text"
135                                     value="[% bbag.name | html %]"
136                                     id="bbag-edit-name" />
137                             </td>
138                             <td rowspan="2" class="saver">
139                                 [% l("Save changes to name or description?") %]<br />
140                                 <input type="submit" value="[% l('Save') %]" />
141                             </td>
142                         </tr>
143                         <tr>
144                             <th><label for="bbag-edit-description">[% l('Description:') %]</label></th>
145                             <td>
146                                 <textarea name="description"
147                                     id="bbag-edit-description">[% bbag.description | html %]</textarea>
148                             </td>
149                         </tr>
150                     </table>
151                 </form>
152             </div>
153         </div>
154         <br class="clear-both" />
155         <form action="[% ctx.opac_root %]/myopac/list/update" method="POST">
156         <input type="hidden" name="list" value="[% bbag.id %]" />
157         <input type="hidden" name="sort" value="[% CGI.param('sort') | uri %]" />
158         <table class="bookbag-specific" cellpadding='0' cellspacing='0' border='0'>
159             <thead id="acct_list_header">
160                 <tr>
161                     <td class="list_checkbox">
162                     <input type="checkbox" onclick="
163                         var inputs=document.getElementsByTagName('input'); 
164                         for (i = 0; i < inputs.length; i++) { 
165                             if (inputs[i].name == 'selected_item' && !inputs[i].disabled && inputs[i].getAttribute('bbag') == [% bbag.id %]) 
166                                 inputs[i].checked = this.checked;}"/>
167
168                     </td>
169                     <td class="list_entry">
170                         <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=> (CGI.param('sort') == 'titlesort' ? 'titlesort.descending' : 'titlesort')}) %]">[% l('Title') %]</a>
171                     </td>
172                     <td class="list_entry">
173                         <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=>(CGI.param('sort') == 'authorsort' ? 'authorsort.descending' : 'authorsort')}) %]">[% l('Author(s)') %]</a>
174                     </td>
175                     <td class="list_entry">
176                         [% l('Notes') %]
177                         [% IF CGI.param("edit_notes") != bbag.id %]
178                         | <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {edit_notes=> bbag.id}) %]">[% l('Edit') %]</a>
179                         [% END %]
180                     </td>
181                     <td class="list_actions">
182                         <select name="action">
183                             <option disabled="disabled">[% l('-- Actions for these items --') %]</option>
184                             <option value="place_hold">[% l('Place hold') %]</option>
185                             <option value="del_item">[% l('Remove from list') %]</option>
186                         </select>
187                         <input type="submit" value="[% l('Go') %]" />
188                     </td>
189                 </tr>
190             </thead>
191             <tbody>
192                 [% UNLESS bbag.items.size %]
193                 <tr><td colspan="4" class="list_is_empty">
194                     [% l("This list contains no items.") %]
195                 </td></tr>
196                 [% END %]
197                 [% FOR item IN bbag.items;
198                     rec_id = item.target_biblio_record_entry.id;
199                     attrs = {marc_xml => ctx.bookbags_marc_xml.$rec_id};
200                     PROCESS get_marc_attrs args=attrs %]
201                 <tr class="bookbag-item-row">
202                     <td class="list_checkbox">
203                         <input type="checkbox" name="selected_item" value="[% item.id %]" bbag='[% bbag.id %]'/>
204                     </td>
205                     <td class="list_entry">
206                         <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec_id, {}, ['edit_notes', 'id']) %]">[% attrs.title | html %]</a>
207                     </td>
208                     <td class="list_entry">
209                         <a href="[%- 
210                             authorquery = attrs.author | replace('[,\.:;]', '');
211                             mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page', 'id', 'edit_notes'])
212                             -%]">[% attrs.author | html %]</a>
213                     [% IF CGI.param("edit_notes") == bbag.id %]
214                     <td class="list_entry">
215                         [% FOR note IN item.notes %]
216                         <input type="text" name="note-[% note.id %]" value="[% note.note | html %]" />
217                         [% END %]
218                         <input type="text" name="item-[% item.id %]" />
219                     </td>
220                     [% ELSE %]
221                     <td class="list_entry">
222                         [% FOR note IN item.notes %]
223                         <div>[% note.note | html %]</div>
224                         [% END %]
225                     </td>
226                     [% END %]
227                 </tr>
228                 [% END %]
229                 [% IF CGI.param("edit_notes") == bbag.id %]
230                 <tr>
231                     <td colspan="3"><!-- All space left of notes column --></td>
232                     <td class="save-notes">
233                         <input type="hidden" name="id" value="[% CGI.param('id') | html %]" />
234                         <input type="submit" name="save_notes" value="[% l('Save Notes') %]" />
235                     </td>
236                 </tr>
237                 [% END %]
238             </tbody>
239         </table>
240         </form>
241         [% END %]
242         [% END %]
243     </div>
244     [% END %]
245
246     <span id='bb_publish_text' class='hide_me'>
247 [% |l %]Sharing a Bookbag means that the contents 
248 of the Bookbag will be visible to others.  
249 To see the public view of a shared Bookbag, 
250 click on the Bookbag's name in the Bookbag list.[% END %]
251     </span>
252 </div>
253 [% END %]