]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/lists.tt2
Merge branch 'master' of git.evergreen-ils.org:Evergreen-DocBook into doc_consolidati...
[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(
110                         ctx.opac_root _ '/results',
111                         {page => '0', bookbag => bbag.id, depth => 0, locg => ctx.search_ou},
112                         1
113                     )
114                 -%]'>[% l('HTML View') %]</a>
115                 [% END %]
116             </div>
117             <div class="clear-both pad-bottom-five"></div>
118         </div>
119         [% IF CGI.param("id") == bbag.id %]
120         <div class="bookbag-specific">
121             <div class="sort">
122                 <form method="GET">
123                     <label for="opac.result.sort">[% l("Sort list items by: ") %]</label>
124                     [%- INCLUDE "opac/parts/preserve_params.tt2" params=['loc', 'query', 'qtype']; %]
125                     [% INCLUDE "opac/parts/filtersort.tt2"
126                         value=CGI.param('sort') mode='bookbag' %]
127                     <input type="hidden" name="id"
128                         value="[% CGI.param('id') | html %]" />
129                     <input type="submit" value="[% l('Sort') %]" />
130                 </form>
131             </div>
132             <div class="meta">
133                 <form method="POST">
134                     <input type="hidden" name="id" value="[% bbag.id %]" />
135                     <input type="hidden" name="action" value="editmeta" />
136                     [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
137                     <table id="bbag-name-desc-form">
138                         <tr>
139                             <th>
140                                 <label for="bbag-edit-name">[% l('Name:') %]</label>
141                             </th>
142                             <td>
143                                 <input name="name" type="text"
144                                     value="[% bbag.name | html %]"
145                                     id="bbag-edit-name" />
146                             </td>
147                             <td rowspan="2" class="saver">
148                                 [% l("Save changes to name or description?") %]<br />
149                                 <input type="submit" value="[% l('Save') %]" />
150                             </td>
151                         </tr>
152                         <tr>
153                             <th><label for="bbag-edit-description">[% l('Description:') %]</label></th>
154                             <td>
155                                 <textarea name="description"
156                                     id="bbag-edit-description">[% bbag.description | html %]</textarea>
157                             </td>
158                         </tr>
159                     </table>
160                 </form>
161             </div>
162         </div>
163         <br class="clear-both" />
164         <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST">
165         <input type="hidden" name="list" value="[% bbag.id %]" />
166         <input type="hidden" name="sort" value="[% CGI.param('sort') | uri %]" />
167         <table class="bookbag-specific" cellpadding='0' cellspacing='0' border='0'>
168             <thead id="acct_list_header">
169                 <tr>
170                     <td class="list_checkbox">
171                     <input type="checkbox" onclick="
172                         var inputs=document.getElementsByTagName('input'); 
173                         for (i = 0; i < inputs.length; i++) { 
174                             if (inputs[i].name == 'selected_item' && !inputs[i].disabled && inputs[i].getAttribute('bbag') == [% bbag.id %]) 
175                                 inputs[i].checked = this.checked;}"/>
176
177                     </td>
178                     <td class="list_entry">
179                         <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=> (CGI.param('sort') == 'titlesort' ? 'titlesort.descending' : 'titlesort')}) %]">[% l('Title') %]</a>
180                     </td>
181                     <td class="list_entry">
182                         <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=>(CGI.param('sort') == 'authorsort' ? 'authorsort.descending' : 'authorsort')}) %]">[% l('Author(s)') %]</a>
183                     </td>
184                     <td class="list_entry">
185                         [% l('Notes') %]
186                         [% IF CGI.param("edit_notes") != bbag.id %]
187                         | <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {edit_notes=> bbag.id}) %]">[% l('Edit') %]</a>
188                         [% END %]
189                     </td>
190                     <td class="list_actions">
191                         <select name="action">
192                             <option disabled="disabled">[% l('-- Actions for these items --') %]</option>
193                             <option value="place_hold">[% l('Place hold') %]</option>
194                             <option value="del_item">[% l('Remove from list') %]</option>
195                         </select>
196                         [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
197                         <input type="submit" value="[% l('Go') %]" />
198                     </td>
199                 </tr>
200             </thead>
201             <tbody>
202                 [% UNLESS bbag.items.size %]
203                 <tr><td colspan="4" class="list_is_empty">
204                     [% l("This list contains no items.") %]
205                 </td></tr>
206                 [% END %]
207                 [% FOR item IN bbag.items;
208                     rec_id = item.target_biblio_record_entry.id;
209                     attrs = {marc_xml => ctx.bookbags_marc_xml.$rec_id};
210                     PROCESS get_marc_attrs args=attrs %]
211                 <tr class="bookbag-item-row">
212                     <td class="list_checkbox">
213                         <input type="checkbox" name="selected_item" value="[% item.id %]" bbag='[% bbag.id %]'/>
214                     </td>
215                     <td class="list_entry">
216                         <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec_id, {}, ['edit_notes', 'id']) %]">[% attrs.title | html %]</a>
217                     </td>
218                     <td class="list_entry">
219                         <a href="[%- 
220                             authorquery = attrs.author | replace('[,\.:;]', '');
221                             mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page', 'id', 'edit_notes'])
222                             -%]">[% attrs.author | html %]</a>
223                     [% IF CGI.param("edit_notes") == bbag.id %]
224                     <td class="list_entry">
225                         [% FOR note IN item.notes %]
226                         <input type="text" name="note-[% note.id %]" value="[% note.note | html %]" />
227                         [% END %]
228                         <input type="text" name="item-[% item.id %]" />
229                     </td>
230                     [% ELSE %]
231                     <td class="list_entry">
232                         [% FOR note IN item.notes %]
233                         <div>[% note.note | html %]</div>
234                         [% END %]
235                     </td>
236                     [% END %]
237                 </tr>
238                 [% END %]
239                 [% IF CGI.param("edit_notes") == bbag.id %]
240                 <tr>
241                     <td colspan="3"><!-- All space left of notes column --></td>
242                     <td class="save-notes">
243                         [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
244                         <input type="hidden" name="id" value="[% CGI.param('id') | html %]" />
245                         <input type="submit" name="save_notes" value="[% l('Save Notes') %]" />
246                     </td>
247                 </tr>
248                 [% END %]
249             </tbody>
250         </table>
251         </form>
252         [% END %]
253         [% END %]
254     </div>
255     [% END %]
256
257     <span id='bb_publish_text' class='hide_me'>
258 [% |l %]Sharing a Bookbag means that the contents 
259 of the Bookbag will be visible to others.  
260 To see the public view of a shared Bookbag, 
261 click on the Bookbag's name in the Bookbag list.[% END %]
262     </span>
263 </div>
264 [% END %]