]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/lists.tt2
Bookbag enhancements in TTOPAC
[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     <!-- <div class="header_middle">
8         <span id="acct_holds_header" style="float:left;">[% l('My Lists') %]</span>
9         <span style="float:right;"><a class="hide_me" href="#">[% l('Export List') %]</a></span>
10     </div>
11     <div style="float:right;width:85px;">
12         <div style="position:absolute">
13             <div style="position:relative;top:13px;">
14                 <a href="#" style="position:relative;top:-3px;left:-5px;"><img alt="[% l('Saving Help') %]" 
15                     src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
16                 <a href="#"><img alt="[% l('Save') %]" src="[% ctx.media_prefix %]/images/save-btn.png"/></a>
17             </div>
18         </div>
19     </div> -->
20     <div id="temp_wrapper">
21
22
23     <!-- new list creation -->
24     <form action="[% ctx.opac_root %]/myopac/list/update" method="POST" id="create_form">
25         <h2>[% l('Create new list') %]</h2><a name="createnewlist"></a>
26         <table cellpadding="0" border="0" id="list_create_table">
27             <tr>
28                 <td>
29                     <label for="list_create_name">[% l('Enter the name of the new list:') %]</label>
30                 </td>
31                 <td>
32                     <input id="list_create_name" type="text" name="name" />
33                     <input type="hidden" name="action" value="create" />
34                 </td>
35                 <td>
36                     <label for="list_create_shared">[% l('Share this list?') %]</label>
37                     <select name="shared" id="list_create_shared">
38                         <option value="0">[% l('No') %]
39                         <option value="1">[% l('Yes') %]
40                     </select>
41                     <a href="javascript:void(0);" onclick="alert(document.getElementById('bb_publish_text').innerHTML);"><img alt="[% l('Sharing Help') %]"
42                         src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
43                 </td>
44                 <td class="list-create-table-buttons">
45                     <input type="submit"
46                         value="[% l('Submit') %]"
47                         alt="[% l('Submit') %]"
48                         class="opac-button"/>
49                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
50                     <input type="reset"
51                         value="[% l('Cancel') %]"
52                         alt="[% l('Cancel') %]"
53                         class="opac-button" />
54                 </td>
55             </tr>
56             <tr>
57                 <td class="text-right-top">
58                     <label for="list_description">[% l("List description (optional):") %]</label>
59                 </td>
60                 <td colspan="3">
61                     <textarea cols="40" rows="3" name="description"
62                         id="list_description"></textarea>
63                 </td>
64         </table>
65     </form>
66
67     <h2>[% l("Your existing lists") %]</h2>
68     <p>
69         <form method="GET">
70             <label for="opac.result.sort">[% l("Sort list items by: ") %]</label>
71             [% INCLUDE "opac/parts/filtersort.tt2"
72                 value=CGI.param('sort') %]
73             <input type="submit" value="[% l('Sort') %]" />
74         </form>
75     </p>
76
77     [% INCLUDE "opac/parts/anon_list.tt2" %]
78     [% IF ctx.bookbags.size %]
79     <div id='acct_lists_prime'>
80         [% FOR bbag IN ctx.bookbags %]
81         <div id='acct_list_template'>
82             <div style="width:100%">
83                 <form action="[% ctx.opac_root %]/myopac/list/update" method="POST">
84                     <div class="bookbag-share">
85                         <input type="hidden" name="list" value="[% bbag.id %]" />
86                         [% IF bbag.pub != 't' %]
87                         <input type="hidden" name="action" value="show" />
88                         <input type="submit" value="[% l('Share') %]" />
89                         [% ELSE %]
90                         <input type="hidden" name="action" value="hide" />
91                         <input type="submit" value="[% l('Hide') %]" />
92                         [% END %]
93                     </div>
94                 </form>
95                 <form action="[% ctx.opac_root %]/myopac/list/update" method="POST">
96                     <div class="bookbag-controls">
97                         <input type="hidden" name="list" value="[% bbag.id %]" />
98                         <input type="hidden" name="action" value="delete" />
99                         <input type="submit" value="[% l('Delete List') %]" />
100                     </div>
101                 </form>
102                 <form action="[% ctx.opac_root %]/myopac/list/print" method="POST" target="_blank">
103                     <div class="bookbag-controls">
104                         <input type="hidden" name="list" value="[% bbag.id %]" />
105                         <input type="hidden" name="sort" value="[% CGI.param('sort') | html %]" />
106                         <input type="submit" value="[% l('Download CSV') %]" />
107                     </div>
108                 </form>
109                 <div class="bookbag-controls">
110                     <big><strong>
111                     [% IF bbag.pub == 't' %]
112                         [% url = 'http://' _ ctx.hostname _ '/opac/extras/feed/bookbag/html-full/' _ bbag.id %]
113                         <a target='_blank' href='[% url %]'>[% bbag.name | html %]</a>
114                     [% ELSE %]
115                     [% bbag.name | html %]
116                     [% END %]
117                     </strong></big>
118                     [% IF bbag.description %]<br /><em>[% bbag.description | html %]</em>[% END %]
119                 </div>
120                 <div class="bookbag-controls">
121                     [% IF bbag.pub == 't'; %]
122                     <a target='_blank' href='/opac/extras/feed/bookbag/rss2-full/[% bbag.id %]'><img
123                         alt="[% l('RSS Feed') %]" border="0"
124                         src="[% ctx.media_prefix %]/images/small-rss.png"/></a>
125                     [% END %]
126                 </div>
127                 <div class="clear-both pad-bottom-five"></div>
128             </div>
129             <form action="[% ctx.opac_root %]/myopac/list/update" method="POST">
130             <input type="hidden" name="list" value="[% bbag.id %]" />
131             <input type="hidden" name="sort" value="[% CGI.param('sort') | uri %]" />
132             <table cellpadding='0' cellspacing='0' border='0'>
133                 <thead id="acct_list_header">
134                     <tr>
135                         <td width="1%" style="padding-left: 10px;">
136                         <input type="checkbox" onclick="
137                             var inputs=document.getElementsByTagName('input'); 
138                             for (i = 0; i < inputs.length; i++) { 
139                                 if (inputs[i].name == 'selected_item' && !inputs[i].disabled && inputs[i].getAttribute('bbag') == [% bbag.id %]) 
140                                     inputs[i].checked = this.checked;}"/>
141
142                         </td>
143                         <td width="32%" style="padding-left: 5px;">
144                             <a href="[% ctx.opac_root %]/myopac/lists?sort=titlesort">[% l('Title') %]</a>
145                         </td>
146                         <td width="33%">
147                             <a href="[% ctx.opac_root %]/myopac/lists?sort=authorsort">[% l('Author(s)') %]</a>
148                         </td>
149                         <td width="32%">
150                             [% l('Notes') %]
151                             [% IF CGI.param("edit_notes") != bbag.id %]
152                             | <a href="[% ctx.opac_root %]/myopac/lists?[% IF CGI.param('sort'); 'sort='; (CGI.param('sort')) | uri; '&amp;'; END %]edit_notes=[% bbag.id %]">[% l('Edit') %]</a>
153                             [% END %]
154                         </td>
155                         <td width="1%" class="nowrap">
156                             <select class="selector_actions_for_list" name="action">
157                                 <option>[% l('-- Actions for this list --') %]</option>
158                                 <option value="place_hold">[% l('Place Hold') %]</option>
159                                 <option value="del_item">[% l('Remove Items') %]</option>
160                             </select>
161                             <input type="submit" value="[% l('Go') %]" />
162                         </td>
163                     </tr>
164                 </thead>
165                 <tbody>
166                     [% UNLESS bbag.items.size %]
167                     <tr><td colspan="4" class="opac-auto-171 opac-auto-097">
168                         [% l("This list contains no items.") %]
169                     </td></tr>
170                     [% END %]
171                     [% FOR item IN bbag.items;
172                         rec_id = item.target_biblio_record_entry.id;
173                         attrs = {marc_xml => ctx.bookbags_marc_xml.$rec_id};
174                         PROCESS get_marc_attrs args=attrs %]
175                     <tr class="bookbag-item-row">
176                         <td class="item_list_padding" style="padding-left: 10px;">
177                             <input type="checkbox" name="selected_item" value="[% item.id %]" bbag='[% bbag.id %]'/>
178                         </td>
179                         <td class="item_list_padding" style="padding-left: 5px;">
180                             <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec_id) %]">[% attrs.title | html %]</a>
181                         </td>
182                         <td class="item_list_padding">
183                             <a href="[%- 
184                                 authorquery = attrs.author | replace('[,\.:;]', '');
185                                 mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page'])
186                                 -%]">[% attrs.author | html %]</a>
187                         [% IF CGI.param("edit_notes") == bbag.id %]
188                         <td class="opac-auto-097b">
189                             [% FOR note IN item.notes %]
190                             <input type="text" name="note-[% note.id %]" value="[% note.note | html %]" />
191                             [% END %]
192                             <input type="text" name="item-[% item.id %]" />
193                         </td>
194                         [% ELSE %]
195                         <td class="opac-auto-097b">
196                             [% FOR note IN item.notes %]
197                             <div>[% note.note | html %]</div>
198                             [% END %]
199                         </td>
200                         [% END %]
201                     </tr>
202                     [% END %]
203                     [% IF CGI.param("edit_notes") == bbag.id %]
204                     <tr>
205                         <td colspan="3"><!-- All space left of notes column --></td>
206                         <td>
207                             <input type="submit" name="save_notes" value="[% l('Save Notes') %]" />
208                         </td>
209                     </tr>
210                     [% END %]
211                 </tbody>
212             </table>
213             </form>
214             <hr /><br />
215         </div>
216         [% END %]
217     </div>
218     [% END %]
219
220     <div id='myopac_delete_bookbag_warn' class='hide_me'>
221         [% l("This will remove the selected bookbag and all items contained within the bookbag.  Are you sure you wish to continue?") %]
222     </div>
223     <div style='text-align: center; font-weight: bold;' 
224         class='hide_me' id='myopac_bookbags_none'>[% l("You have not created any bookbags") %]</div>
225     <div style='width: 99%; text-align: center'>
226         <b id='myopac_bookbag_items_name'> </b>
227     </div>
228     <span id='bb_publish_text' class='hide_me'>
229 [% |l %]Sharing a Bookbag means that the contents 
230 of the Bookbag will be visible to others.  
231 To see the public view of a shared Bookbag, 
232 click on the Bookbag's name in the Bookbag list.[% END %]
233     </span>
234     <span id='myopac_remove_bb_item_confirm' class='hide_me'>
235         [% l("Are you sure you wish to remove this bookbag item?") %]
236     </span>
237     <span id='myopac_make_published_confirm' class='hide_me'>
238         [% l("Sharing this bookbag will allow the contents of the bookbag to be seen by others.  Are you sure you wish to share this bookbag?") %]
239     </span>
240     <span id='myopac_make_unpublished_confirm' class='hide_me'>
241         [% l("Are you sure you wish to hide this bookbag?") %]
242     </span>
243     <span id='myopac_bb_update_success' class='hide_me'>
244         [% l("The Bookbag was successfully updated.") %]
245     </span>
246     <span id='bb_create_warning' class='hide_me'>
247         [% l("Warning: Adding items to a bookbag creates a link between you and the items in the database.  The contents of the bookbag are NOT publicly viewable unless the bookbag is shared. However, if you prefer not to have any link between your patron record and a particular item or items, we suggest that you do not place said items in a bookbag or that you avoid using bookbags all together.  Thank you.") %]
248     </span>
249     <span id='myopac_bb_what_are' class='hide_me'>
250         [% l("Bookbags are...") %]
251     </span>
252     <span class='hide_me' id='bb_update_success'>
253         [% l("Bookbag successfully updated") %]
254     </span>
255
256 </div>
257 [% END %]