misc work on the results page, including:
authorsenator <lebbeous@esilibrary.com>
Wed, 9 Feb 2011 21:11:28 +0000 (16:11 -0500)
committersenator <lebbeous@esilibrary.com>
Wed, 9 Feb 2011 21:11:28 +0000 (16:11 -0500)
hold placement link,
result prev/next page links on top and bottom,
edition and physical description,
add in previously missing filtersort template

Open-ILS/web/css/skin/default/opac/style.css
Open-ILS/web/templates/default/opac/parts/marc_misc.tt2
Open-ILS/web/templates/default/opac/parts/result/filtersort.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/opac/parts/result/header.tt2
Open-ILS/web/templates/default/opac/parts/result/table.tt2
Open-ILS/web/templates/default/opac/results.tt2

index 1dc531f..1dc5d31 100644 (file)
@@ -623,22 +623,18 @@ div.select-wrapper:hover {
        margin:0;
 }
 
-#results_header_nav1 {
+.results_header_nav1 {
        padding: 5px 7px 6px 0px;
        border-bottom: 1px dotted #ccc;
 }
 
-#results_header_nav1 .h1 {
+.results_header_nav1 .h1 {
        font-size:14px;
        font-weight:bold;
        color:#074079;
 }
 
-#start_end_links_span {
-       font-size: 11px;
-}
-
-#start_end_links_span2 {
+.start_end_links_span {
        font-size: 11px;
 }
 
@@ -652,9 +648,8 @@ div.select-wrapper:hover {
        margin-top: 20px;
 }
 
-#result_numbers1 {
-       font-size: 11px;
-       padding-left:15px;
+.result_numbers {
+       font-size: 11px; padding-left:15px; white-space: nowrap; width: 320px;
 }
 
 .result_table_subtable { width: 100%; border-collapse: collapse; border: 0; }
@@ -892,3 +887,4 @@ div.select-wrapper:hover {
 #rdetail_copy_info_table { font-size: 8pt; }
 #rdetail_copy_info_table td { padding: 3px; }
 .search_page_nav_link { cursor: pointer; }
+#opac.result.sort { width: 160px; }
index 4b5708e..6f678b2 100644 (file)
         args.author = xml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent;
         args.publisher = xml.findnodes('//*[@tag="260"]/*[@code="b"]').textContent;
         args.pubdate = xml.findnodes('//*[@tag="260"]/*[@code="c"]').textContent;
+        args.edition = xml.findnodes('//*[@tag="250"]/*[@code="a"]').textContent ||
+            xml.findnodes('//*[@tag="534"]/*[@code="b"]').textContent ||
+            xml.findnodes('//*[@tag="775"]/*[@code="b"]').textContent;
+        phys = xml.findnodes(
+            '//*[@tag="300"]/*[@code="a" or @code="b" or @code="c" or @code="e"]'
+        );
+        phys_content = [];
+        FOR p IN phys; phys_content.push(p.textContent); END;
+        args.phys_desc = phys_content.join("");
+
         # clean up the ISBN
         args.isbn_clean = args.isbn.replace('\ .*', '');
 
diff --git a/Open-ILS/web/templates/default/opac/parts/result/filtersort.tt2 b/Open-ILS/web/templates/default/opac/parts/result/filtersort.tt2
new file mode 100644 (file)
index 0000000..cee0f82
--- /dev/null
@@ -0,0 +1,19 @@
+<!-- ****************** filtersort.xml ***************************** -->
+    <select class="results_header_sel" id='opac.result.sort' onchange='searchBarSubmit(true);'>
+        <option selected='selected' value=''>[% l("Sort Results by Relevance") %]</option>
+        <optgroup label='[% l("Sort Results by Title") %]'>
+            <option id='opac.result.title.a2z' label='&common.a2z.titla;' value='title.asc'>[% l("Title: A to Z") %]</option>
+            <option id='opac.result.title.z2a' label='&common.z2a.titla;' value='title.desc'>[% l("Title: Z to A") %]</option>
+        </optgroup>
+        <optgroup label='[% l("Sort Results by Author") %]'>
+            <option id='opac.result.author.a2z' label='[% l("Author: A to Z") %]' value='author.asc'>[% l("Author: A to Z") %]</option>
+            <option id='opac.result.author.z2a' label='[% l("Author: Z to A") %]' value='author.desc'>[% l("Author: Z to A") %]</option>
+        </optgroup>
+        <optgroup label='[% l("Sort Results by Publication Date") %]'>
+            <option id='opac.result.pubdate.new2old' label='[% l("Date: Newest to Oldest") %]' 
+                value='pubdate.desc'>[% l("Date: Newest to Oldest") %]</option>
+            <option id='opac.result.pubdate.old2new' label='[% l("Date: Oldest to Newest") %]' 
+                value='pubdate.asc'>[% l("Date: Oldest to Newest") %]</option>
+        </optgroup>
+    </select>
+<!-- ****************** end: filtersort.xml ***************************** -->
index c7e2f58..67f6193 100644 (file)
     IF ctx.result_stop > ctx.hit_count; ctx.result_stop = ctx.hit_count; END;
 %]
 <div style="height: 10px;"></div>
-<div id="results_header_nav1">
+[% BLOCK results_count_header %]
+<div class="results_header_nav1">
     <table cellpadding="0" cellspacing="0" border="0" width="100%">
         <tr>
             <td class="h1" width="116">Search Results</td>
-            <td valign="bottom" nowrap="nowrap" width="320"
-                style="white-space:nowrap;" id="result_numbers1">
+            <td valign="bottom" nowrap="nowrap" class="result_number">
                 [% l("Results") %]
                 <strong>[% ctx.result_start %]</strong>
                 &nbsp;-
                 </span>
             </td>
             <td align="right" valign="bottom">
-                <span id='start_end_links_span'>
+                <span class='start_end_links_span'>
                     [% IF page > 0 %]
-                    <a class='search_page_nav_link' id='prev_link'
+                    <a class='search_page_nav_link'
                         href="[% np_link _ '&page=' _ (page - 1) %]"
                         title='[% l("Previous page") %]'>
                         <span class="nav_arrow_fix">&#9668;</span> Previous
                     </a>
                     [% END %]
-                    <span class='hide_me' id='result_info_div'
+                    <span class='hide_me'
                         style='padding-left: 11px; padding-right:11px;'>
-                        <span id="nav_pages"></span>
+                        <span></span>
                     </span>
                     [% IF (page + 1) < page_count %]
-                    <a class='search_page_nav_link' id='next_link'
+                    <a class='search_page_nav_link'
                         href="[% np_link _ '&page=' _ (page + 1) %]"
                         title='[% l("Next page") %]'>
                         Next <span class="nav_arrow_fix">&#9658;</span>
@@ -55,3 +55,6 @@
         </tr>
     </table>
 </div>
+[% END %]
+[% ctx.results_count_header = PROCESS results_count_header;
+    ctx.results_count_header %]
index ab5b9e6..1474fb6 100644 (file)
                                                             </td>
                                                             <td>[% attrs.isbn %]</td>
                                                         </tr>
-                                                        <tr name="results_edition_tr" class="hide_me">
+                                                        <tr name="results_edition_tr" class="[% attrs.edition ? '' : 'hide_me' %]">
                                                             <td valign="top">
                                                                 <strong>Edition:</strong>
                                                             </td>
-                                                            <td> <span name="results_edition"></span></td>
+                                                            <td>[% attrs.edition %]</td>
                                                         </tr>
-                                                        <tr name="results_phys_desc_tr" class="hide_me">
+                                                        <tr name="results_phys_desc_tr" class="[% attrs.phys_desc ? '' : 'hide_me' %]">
                                                             <td nowrap="nowrap" valign="top">
                                                                 <strong>Phys. Desc.:</strong>
                                                             </td>
                                                             <td>
-                                                                <span name="results_phys_desc"></span>
+                                                                [% args.phys_desc %]
                                                             </td>
                                                         </tr>
                                                     </table>
                                                     <div style="float:right;">
                                                         <div style="border-bottom:1px dotted #ccc;padding-top:10px;"
                                                             class="results_aux_utils"><a
-                                                                href="javascript:;" name="place_hold_link"><img
+                                                                href="place_hold?hold_target=[% rec.bre.id %]&hold_type=T" name="place_hold_link"><img
                                                                 src="[% ctx.media_prefix %]/images/green_check.png"
                                                                 alt="place hold" /><span
                                                                     style="position:relative;top:-3px;left:3px;">Place Hold</span></a>
         </tr>
     </table>
 </div>
-
 <div>
-    <table id='' style="width:100%;">
-        <tbody id=''>
-            <tr class="hide_me">
-                <td class='result_table_row' width="100%">
-                    <!--#include virtual="result_info.xml"-->
-                </td>
-            </tr>
-            <!-- Template for displaying a search result.  This row template
-            is cloned and inserted for each result returned -->
-        </tbody>
-    </table>
-    <!-- ====================== -->
-    <div class="">
-        <table
-            style='width: 100%;margin-top:20px;border-top:1px dotted #ccc;padding-top:8px;'
-            id='result_info_2' class='hide_me'>
-            <tbody>
-                <tr>
-                    <td valign="top">
-                        <span class='hide_me' id='result_info_div2'
-                            style='font-size: 11px;'>
-                            <span> [% l("Results") %] </span>
-                            <b id='offset_start2'> </b>
-                            <span>&nbsp;- </span>
-                            <b id='offset_end2'> </b>
-                            <span>&nbsp;[% l("of") %] </span>
-                            <b id='result_count2'> </b>
-                            <span style='padding-left: 6px;'> (page </span>
-                            <span id='current_page2'> </span>
-                            <span>&nbsp;[% l("of") %] </span>
-                            <span id='num_pages2'> </span>
-                        </span>
-                    </td>
-                    <td valign="top" id='next_prev_links2' align="right">
-                    <span id='start_end_links_span2' class='hide_me'>
-                        <a class='search_page_nav_link' id='prev_link2'
-                            title='[% l("Previous page") %]' style="cursor:pointer;">
-                            <span class="nav_arrow_fix">&#9668;</span> Previous
-                        </a>
-                        <span id="nav_pages2"
-                            style='padding-left: 11px; padding-right:13px;'></span>
-                        <a class='search_page_nav_link' id='next_link2'
-                            title='[% l("Next page") %]' style="cursor:pointer;">
-                            Next <span class="nav_arrow_fix">&#9658;</span>
-                        </a>
-                        </span>
-                    </td>
-                </tr>
-            </tbody>
-        </table>
-    </div>
+    [% ctx.results_count_header %]
     <!-- ChiliFresh XXX script TODO -->
 </div>
 <!-- ****************** end: result_table.xml ***************************** -->
-
index c24eb35..25eafc8 100644 (file)
@@ -18,7 +18,7 @@
         <div id="results_header_bar">
             <div id="results_header_inner">
                 <div class="results_header_btns">
-                    <a href="index.xml"><img alt="Another Search"
+                    <a href="home"><img alt="Another Search"
                         src="[% ctx.media_prefix %]/images/another_search.png"
                         onmouseover="this.src='[% ctx.media_prefix %]/images/another_search_hover.png';"
                         onmouseout="this.src='[% ctx.media_prefix %]/images/another_search.png';" /></a>
                 </div>
                 <div class="results_header_div"></div>
                 <div class="results_header_lbl">Sort by</div>
-        <!--#if expr="$OILS_PAGE='rresult.xml' || $OILS_PAGE='mresult.xml'"-->
-        <!--#include virtual="result/filtersort.xml" -->
-        <!--#endif -->
+                [% INCLUDE "default/opac/parts/result/filtersort.tt2" %]
                 <div class="results_header_div"></div>
-                <div class="results_header_lbl">View</div>
+                <!-- XXX still needed?<div class="results_header_lbl">View</div>
                 <select class="results_header_sel">
                     <option>Simple</option>
                     <option>Detailed</option>
                 </select>
-                <div class="results_header_div"></div>
+                <div class="results_header_div"></div> -->
                 <input type="checkbox" id="limit_to_available" />
                 <label for="limit_to_available" class="results_header_lbl">
                     Limit to available items