LP1735768: adding labels to inputs in the public catalog
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / anon_list.tt2
index 5101117..ed0b546 100644 (file)
@@ -1,48 +1,57 @@
         [% IF ctx.mylist.size %]
-        <form action="[% ctx.opac_root %]/mylist/move" method="POST">
-        <div>
-            <div style="width:100%">
-                <table cellpadding="0" cellspacing="0" border="0">
-                    <tr>
-                        <td id='anon_list_name'>
-                            [% l('Temporary List') %]
-                        </td>
-                        <td>
-                            <!-- <a href="#"><img
-                                alt="[% l('Anonymous List Help') %]"
-                                src="[% ctx.media_prefix %]/images/question-mark.png" /></a>-->
-                        </td>
-                    </tr>
-                </table>
-                <div class="float-right"></div>
-                <div class="clear-both pad-bottom-five"></div>
-            </div>
-            <table cellpadding='0' cellspacing='0' border='0'>
+        <div class="bookbag-specific">
+        <p class="big-strong">[% l('Basket') %]</p>
+        <div class="sort">
+            <form method="get">
+                <label for="anonsort">[% l("Sort basket items by: ") %]</label>
+                [% INCLUDE "opac/parts/filtersort.tt2" mode='bookbag'
+                    id="anonsort" name="anonsort" value=CGI.param("anonsort") %]
+                <input type="hidden" name="id"
+                    value="[% CGI.param('id') | html %]" />
+                [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+                <input class="opac-button" type="submit" value="[% l('Sort') %]" />
+            </form>
+        </div>
+        <form action="[% mkurl(ctx.opac_root _ '/mylist/move') %]" method="post">
+        <input type="hidden" name="orig_referrer" value="[% CGI.referer | html %]" />
+        <input type="hidden" name="redirect_to" value="[% mkurl('', {}, ['list_none_selected', 'cart_none_selected']) %]" />
+        <div class="bbag-action" style="clear:both;">
+            <select name="action" aria-label="[% l('Actions for these items') %]">
+                <option>[% l('-- Actions for these items --') %]</option>
+                <option value="place_hold">[% l('Place hold') %]</option>
+                <option value="print">[% l('Print title details') %]</option>
+                <option value="email">[% l('Email title details') %]</option>
+                <option value="delete">[% l('Remove from basket') %]</option>
+                <option value="new_list">[% l('Add to new list') %]</option>
+                [% IF ctx.user AND ctx.bookbags.size %]
+                    <optgroup label="[% l('Move selected items to list:') %]">
+                    [% FOR bbag IN ctx.bookbags %]]
+                        <option value="[% bbag.id %]" class="selector_actions_for_list_inner_option">[% bbag.name | html %]</option>
+                    [% END %]
+                    </optgroup>
+                [% END %]
+            </select>
+            [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+            <input class="opac-button" type="submit" value="[% l('Go') %]" />
+            <input type="checkbox" name="clear_cart" id="clear_cart" /><label for="clear_cart">[% l('Clear entire basket when action complete') %]</label>
+            [% IF CGI.param('cart_none_selected') %]
+                <span class="error">[% l('No items were selected') %]</span>
+            [% END %]
+        </div>
+        <div class="bbag-content">
+            <table class="bookbag-specific table_no_cell_pad table_no_border_space table_no_border">
                 <thead id="acct_list_header_anon">
                     <tr>
-                        <td width="1%" style="padding-left:10px;">
-                            <input type="checkbox" onclick="
+                        <td class='list_checkbox'>
+                            <input type="checkbox" checked="checked"
+                                aria-label="[% l('Select all records') %]" onclick="
                                 var inputs=document.getElementsByTagName('input'); 
                                 for (i = 0; i < inputs.length; i++) { 
                                     if (inputs[i].name == 'record' && !inputs[i].disabled) inputs[i].checked = this.checked;}"/>
                         </td>
-                        <td width="49%" style="padding-left:5px;">[% l('Title') %]</td>
-                        <td width="49%" style="padding-left:5px;">[% l('Author(s)') %]</td>
-                        <td width="1%" class="nowrap">
-                            <select class="selector_actions_for_list" name="action">
-                                <option>[% l('-- Actions for this list --') %]</option>
-                                <option value="place_hold">[% l('Place Hold') %]</option>
-                                <option value="delete">[% l('Remove Items') %]</option>
-                                [% IF ctx.user AND ctx.bookbags.size %]
-                                <optgroup label="Move selected items to">
-                                    [% FOR bbag IN ctx.bookbags %]]
-                                    <option value="[% bbag.id %]" class="selector_actions_for_list_inner_option">[% bbag.name | html %]</option>
-                                    [% END %]
-                                </optgroup>
-                                [% END %]
-                            </select>
-                            <input type="submit" value="[% l('Go') %]" />
-                        </td>
+                        <td><a href="[% mkurl('', {anonsort=>(CGI.param('anonsort') == 'titlesort' ? 'titlesort.descending' : 'titlesort')}) %]">[% l('Title') %]</a></td>
+                        <td><a href="[% mkurl('', {anonsort=>(CGI.param('anonsort') == 'authorsort' ? 'authorsort.descending' : 'authorsort')}) %]">[% l('Author(s)') %]</a></td>
+                        <td>[% l('Local Call Number') %]</td>
                     </tr>
                 </thead>
                 <tbody>
                         attrs = {marc_xml => ctx.mylist_marc_xml.$item};
                         PROCESS get_marc_attrs args=attrs %]
                     <tr>
-                        <td class="item_list_padding" style="padding-left: 10px;">
-                            <input type="checkbox" name="record" value="[% item %]" />
+                        <td class="list_checkbox">
+                            <input type="checkbox" checked="checked" name="record" value="[% item %]" aria-label="[% l('Select record') %]" />
+                        </td>
+                        <td class="list_entry" data-label="[% l('Title') %]"><a href="[% mkurl(ctx.opac_root _ '/record/' _ item, {}, ['edit_notes', 'id']) %]">[% attrs.title | html %]</a></td>
+                        <td class="list_entry" data-label="[% l('Author(s)') %]"><a href="[%-
+                            authorquery = attrs.author | replace('[,\.:;]', '');
+                            mkurl(
+                                ctx.opac_root _ '/results',
+                                {qtype => 'author', query => authorquery},
+                                ['page', 'id', 'edit_notes']
+                            )
+                        -%]">[% attrs.author | html %]</a></td>
+                        <td class="list_entry" data-label="[% l('Local Call Number') %]">
+                        [% 
+                            copy = attrs.holdings.0;
+                            IF copy;
+                                copy_org = ctx.get_aou_by_shortname(copy.owner);
+                                FOR ctx_org IN [ctx.pref_ou, ctx.search_ou, ctx.home_ou, ctx.physical_loc];
+                                    NEXT UNLESS ctx_org;
+                                    ctx_org = ctx.get_aou(ctx_org);
+                                    IF ctx.org_within_scope(ctx_org, copy_org, ctx_org.ou_type.depth);
+                                        l('[_1] ([_2])', copy.label, copy_org.name) | html;
+                                        LAST;
+                                    END;
+                                END;
+                            END;
+                        %]
                         </td>
-                        <td class="item_list_padding" style="padding-left: 5px;">[% attrs.title | html %]</td>
-                        <td class="item_list_padding" style="padding-left: 5px;">[% attrs.author | html %]</td>
                     </tr>
                     [% END %]
                 </tbody>
@@ -62,4 +94,5 @@
             <br /><br />
         </div>
         </form>
+        </div>
         [% END %]