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