Visual improvements to facets and search results; better js handling of Amazon book...
authorOwen Leonard <oleonard@myacpl.org>
Wed, 12 Dec 2007 20:44:10 +0000 (14:44 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Thu, 13 Dec 2007 23:28:40 +0000 (17:28 -0600)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc
koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl

index b46584b..3c292b7 100644 (file)
@@ -1058,9 +1058,16 @@ span.required {
 .term {
     background-color: #FFC;
         color : #990000;
+}
+
+a .term {
         text-decoration : underline;
 }
 
+a:hover .term {
+       color : #FF9090;
+}
+
 div#menu {
        border-right: 1px solid #000;
        margin-right: .5em;
@@ -1177,3 +1184,74 @@ overflow :  hidden;
 /* Hides from IE-mac \*/
 * html .clearfix {height: 1%;}
 /* End hide from IE-mac */
+
+.title {
+       font-weight : bold;
+       font-size : 105%;
+}
+
+.reserve {
+       float : right;
+       font-weight : bold;
+}
+
+.thumbnail {
+       display : block;
+       margin : auto;
+}
+
+#searchresults ul li {
+       list-style : url(../../img/item-bullet.gif);
+}
+
+#searchheader {
+       background-color : #f3f3f3;
+       font-size : 80%;
+       margin-bottom : .5em;
+       padding : .1em 0 .1em 1em;
+}
+
+#searchheader h3 {
+}
+
+#searchheader form {
+       float : right;
+}
+
+#search-facets ul {
+       margin : 0;
+       padding : .3em;
+}
+
+#search-facets {
+       border : 1px solid #e8e8e8;
+}
+
+#search-facets h4 {
+       background-color : #F3F3F3;
+       border-bottom : 1px solid #e8e8e8;
+       font-size : 90%;
+       margin : 0;
+       padding : .4em .2em;
+       text-align : center;
+}
+
+#search-facets ul li {
+       font-weight : bold;
+       list-style-type : none;
+}
+
+#search-facets li li {
+       font-weight : normal;
+       font-size : 85%;
+       margin-bottom : 2px;
+       padding : .1em .2em;
+}
+
+#search-facets li li a {
+}
+
+#search-facets li.showmore {
+       font-weight : bold;
+       text-indent : 1em;
+}
\ No newline at end of file
index 5bb67ce..a71a2b4 100644 (file)
@@ -1,14 +1,16 @@
 <!-- TMPL_IF NAME="opacfacets" -->
 <!-- TMPL_IF NAME="facets_loop" -->
-<ul id="search_facets">
-<li><h4>Refine your search</h4></li>
+<div id="search-facets">
+<h4>Refine your search</h4>
+<ul>
 <!-- TMPL_LOOP NAME="facets_loop" -->
 <li id="<!-- TMPL_VAR NAME="type_id" -->"><!-- TMPL_VAR NAME="type_label" --><ul>
-        <!-- TMPL_LOOP NAME="facets" --><li><a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" --><!-- TMPL_IF NAME="sort_by" -->&sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;limit=<!-- TMPL_VAR NAME="type_link_value" -->:<!-- TMPL_VAR NAME="facet_link_value" -->" title="<!-- TMPL_VAR NAME="facet_title_value" -->"><!-- TMPL_VAR NAME="facet_label_value" --></a> <!-- (<!-- TMPL_VAR NAME="facet_count" -->)--></li><!-- /TMPL_LOOP --><!-- TMPL_IF NAME="expandable" -->
+        <!-- TMPL_LOOP NAME="facets" --><li><a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" --><!-- TMPL_IF NAME="sort_by" -->&sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;limit=<!-- TMPL_VAR NAME="type_link_value" -->:<!-- TMPL_VAR NAME="facet_link_value" -->" title="<!-- TMPL_VAR NAME="facet_title_value" -->"><!-- TMPL_VAR NAME="facet_label_value" --></a> <!-- (<!-- TMPL_VAR NAME="facet_count" -->) --></li><!-- /TMPL_LOOP --><!-- TMPL_IF NAME="expandable" -->
         <li class="showmore"><a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" -->&amp;expand=<!-- TMPL_VAR NAME="expand" -->#<!-- TMPL_VAR NAME="type_id" -->">Show More</a></li>
 <!-- /TMPL_IF -->
 </ul></li>
 <!-- /TMPL_LOOP -->
 </ul>
+</div>
 <!-- /TMPL_IF -->
 <!-- /TMPL_IF -->
index efa3525..05a2db1 100644 (file)
@@ -2,9 +2,28 @@
 <title>Koha &rsaquo; Catalogue &rsaquo; Details for <!-- TMPL_VAR NAME="title" --></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" --><script type="text/JavaScript" language="JavaScript">
 //<![CDATA[
+// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
+function verify_images() {
+       $("img").each(function(i){
+              if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0)) {
+            w = this.width;
+            h = this.height;
+            if ((w == 1) || (h == 1)) {
+                               $("#bookcoverimg").remove();
+                               $(".yui-gb").attr("class","yui-g");
+            } else if ((this.complete != null) && (!this.complete)) {
+                               $("#bookcoverimg").remove();
+                               $(".yui-gb").attr("class","yui-g");
+            }
+        }
+               });
+               }
         $(document).ready(function() {
                $('#bibliodetails').tabs();
         });
+        <!-- TMPL_IF NAME="AmazonContent" -->$(window).load(function() {
+               verify_images();
+        });<!-- /TMPL_IF -->
 //]]>
 </script>
 </head>
@@ -23,7 +42,7 @@
        <div class="yui-b">
 
 <!-- TMPL_INCLUDE NAME="cat-toolbar.inc" -->
-    <div class="yui-gb">
+    <!-- TMPL_IF NAME="AmazonContent" --><div class="yui-gb"><!-- TMPL_ELSE --><div class="yui-g"><!-- /TMPL_IF -->
        <div id="catalogue_detail_biblio" class="yui-u first">
                
     <h3><!-- TMPL_VAR NAME="title" --></h3>    
             <!-- TMPL_IF name="volume" -->, <!-- TMPL_VAR name="volume" --><!-- /TMPL_IF -->
             <!-- TMPL_IF name="volumedesc" -->, <!-- TMPL_VAR name="volumedesc" --><!-- /TMPL_IF --> <!-- TMPL_IF NAME="number" --> <!-- TMPL_VAR NAME="number" --> <!-- /TMPL_IF -->
             <!-- TMPL_IF name="unititle" -->, <!-- TMPL_VAR name="unititle" --><!-- /TMPL_IF -->
-            / <!-- TMPL_IF NAME="author" -->By <a href="/cgi-bin/koha/catalogue/search.pl?q=au:<!-- TMPL_VAR NAME="author" -->"><!-- TMPL_VAR NAME="author" --></a><!-- /TMPL_IF -->
+            / <!-- TMPL_VAR NAME="author" --> <!-- TMPL_VAR NAME="class" -->
+        </p>
+               
+               
+               
                <ul>
         <!-- TMPL_IF name="MARCAUTHORS" -->
             <li><strong>Additional Authors:</strong><ul>
@@ -47,7 +70,7 @@
                     <!-- TMPL_VAR NAME="value" -->
                 </a></li>
                 <!-- /TMPL_LOOP -->
-               </ul>
+                               </ul>
             </li>
         <!-- /TMPL_IF -->
                <!-- TMPL_IF name="publishercode" -->
                </ul>
                </div>
                
-<div class="yui-u"><!-- TMPL_IF NAME="AmazonContent" -->
-               <!-- TMPL_IF name="isbn" --><a href="http://www.amazon.com/gp/reader/<!-- TMPL_VAR NAME="isbn" -->/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/<!-- TMPL_VAR NAME="isbn" -->.01._PIdp-schmooS,TopRight,7,-26_SCMZZZZZZZ_.jpg" alt="Book Cover Image" /></a>
+<!-- TMPL_IF NAME="AmazonContent" --><div class="yui-u" id="bookcoverimg">
+               <!-- TMPL_IF name="isbn" --><a href="http://www.amazon.com/gp/reader/<!-- TMPL_VAR NAME="isbn" -->/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/<!-- TMPL_VAR NAME="isbn" -->.01._PIdp-schmooS,TopRight,7,-26_SCMZZZZZZZ_.jpg" alt="" /></a>
 <!-- TMPL_ELSE -->
-       <img src="http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif" alt="" border="0"/>
-<!-- /TMPL_IF --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></div>
+       <img src="http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif" alt="" border="0" />
+<!-- /TMPL_IF --></div><!-- /TMPL_IF -->
                
                <div class="yui-u" style="margin-top: 1em;">
                <ul>
index bd567b0..eb6eb21 100644 (file)
@@ -1,6 +1,33 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Koha &rsaquo; Catalog &rsaquo; <!-- TMPL_IF NAME="searchdesc" -->Results of Search for '<!-- TMPL_VAR NAME="query_desc" --><!-- TMPL_VAR NAME="limit_desc" -->'<!-- TMPL_ELSE -->You did not specify any search criteria<!-- /TMPL_IF --></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<!-- TMPL_IF NAME="AmazonContent" --><script type="text/javascript">
+//<![CDATA[
+// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
+function verify_images() {
+       $("img").each(function(i){
+              if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0)) {
+            w = this.width;
+            h = this.height;
+            if ((w == 1) || (h == 1)) {
+                this.src = 'http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
+            } else if ((this.complete != null) && (!this.complete)) {
+                this.src = 'http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
+            }
+        }
+               });
+               }
+$(document).ready(function() {
+       $('#sortbyform').find("input:submit").hide();
+       $('#sort_by').change(function() {
+               $('#sortbyform').submit();
+       });
+});
+$(window).load(function() {
+               verify_images();
+        });
+        //]]>
+        </script><!-- /TMPL_IF -->
 </head>
 <body>
 <!-- TMPL_INCLUDE NAME="header.inc" -->
@@ -8,7 +35,7 @@
 
 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalogue</a>  &rsaquo; Search for <i><!-- TMPL_VAR NAME="query_desc" --><!-- TMPL_VAR NAME="limit_desc" --></i></div>
 
-<div id="doc3" class="yui-t2">
+<div id="doc3" class="yui-t1">
    
    <div id="bd">
        <div id="yui-main">
         </div>
     <!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="total" -->
+<div id="searchheader">        <form action="/cgi-bin/koha/catalogue/search.pl" method="get" id="sortbyform">
+                <!-- TMPL_IF NAME="searchdesc" -->
+                                       <!-- TMPL_LOOP NAME="QUERY_INPUTS"-->
+                                       <input type="hidden" name="<!-- TMPL_VAR NAME="input_name" -->" value="<!-- TMPL_VAR NAME="input_value" -->"/>
+                                       <!-- /TMPL_LOOP -->
+                                       <!-- TMPL_LOOP NAME="LIMIT_INPUTS"-->
+                                       <input type="hidden" name="<!-- TMPL_VAR NAME="input_name" -->" value="<!-- TMPL_VAR NAME="input_value" -->"/>
+                    <!-- /TMPL_LOOP -->
+
+
+                <!-- /TMPL_IF -->
+                               <!-- RE-SORT START -->
+                    <label for="sort_by">Sort By: </label>
+                    <select id="sort_by" name="sort_by">
+                                       <!-- TMPL_INCLUDE NAME="resort_form.inc" -->
+                                       </select>
+                                       <input type="submit" value="Go" />
+                    <!-- RESORT END -->
+                               </form>
     <h3>
         <!-- TMPL_VAR NAME="total" --> results found for '<!-- TMPL_VAR NAME="query_desc" --><!-- TMPL_VAR NAME="limit_desc" -->'
-    </h3>
+    </h3></div>
        <!-- TMPL_IF NAME="stopwords_removed" --><div><p class="tip">Ignored the following common words: "<!-- TMPL_VAR NAME="stopwords_removed" -->"<p></div><!-- /TMPL_IF -->
     <!-- TMPL_ELSE -->
         <!-- TMPL_IF NAME="searchdesc" -->
             <!-- ######### -->
 
             <div id="searchresults">
-                               <form action="/cgi-bin/koha/catalogue/search.pl" method="get" name="myform" id="mainform">
-                <!-- TMPL_IF NAME="searchdesc" -->
-                                       <!-- TMPL_LOOP NAME="QUERY_INPUTS"-->
-                                       <input type="hidden" name="<!-- TMPL_VAR NAME="input_name" -->" value="<!-- TMPL_VAR NAME="input_value" -->"/>
-                                       <!-- /TMPL_LOOP -->
-                                       <!-- TMPL_LOOP NAME="LIMIT_INPUTS"-->
-                                       <input type="hidden" name="<!-- TMPL_VAR NAME="input_name" -->" value="<!-- TMPL_VAR NAME="input_value" -->"/>
-                    <!-- /TMPL_LOOP -->
-
-
-                <!-- /TMPL_IF -->
-                               <!-- RE-SORT START -->
-                    <p>
-                    Re-sort results
-                    <select id="sort_by" name="sort_by" onchange="document.myform.submit();">
-                                       <!-- TMPL_INCLUDE NAME="resort_form.inc" -->
-                                       </select>
-                    </p>
-                    <!-- RESORT END -->
-                               </form>
-       
+                                       
                     <!-- TABLE RESULTS START -->
 
                 <table>
                     <tr>
-                        <th>&nbsp;</th>
+                        <!-- TMPL_IF NAME="AmazonContent" --><th>&nbsp;</th><!-- /TMPL_IF -->
                         <th>Results</th>
-                        <th>&nbsp;</th>
+                                               <th>Location</th>
                     </tr>
                         <!-- Actual Search Results -->
                         <!-- TMPL_LOOP NAME="SEARCH_RESULTS" -->
                             <!-- TMPL_ELSE -->
                                 <tr>
                             <!-- /TMPL_IF -->
-                                <td>
                             <!-- TMPL_IF NAME="AmazonContent" -->
+                                <td>
                                     <a class="p1" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
                                         <img src="<!-- TMPL_IF NAME="isbn" -->http://images.amazon.com/images/P/<!-- TMPL_VAR name="isbn" -->.01.TZZZZZZZ.jpg<!-- TMPL_ELSE -->http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif<!-- /TMPL_IF -->" alt="image" class="thumbnail" />
-                                    </a>
-                            <!-- TMPL_ELSE -->
-                                <!-- TMPL_IF name="imageurl" -->
-                                    <img src="<!-- TMPL_VAR name="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" />
-                                <!-- TMPL_ELSE -->
-                                    <!-- TMPL_VAR name="description" -->
-                                <!-- /TMPL_IF -->
+                                    </a></td>                           
                             <!-- /TMPL_IF -->
-                                </td>
                             <td>
-                                <p><!-- TMPL_VAR NAME="result_number" -->.
+                                <p>
                                     <!-- TMPL_IF name="BiblioDefaultViewmarc" -->
                                         <a class="title" href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
                                             <b><!-- TMPL_VAR NAME="title" --></b>
                                 <!-- TMPL_IF name="summary" -->
                                     <p><!-- TMPL_VAR name="summary" --></p>
                                 <!-- TMPL_ELSE -->
-                                    <p>
+                                    <p> <!-- TMPL_IF name="imageurl" -->
+                                    <img src="<!-- TMPL_VAR name="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" style="float: left; margin: .1em;" />
+                                                                       <!-- /TMPL_IF -->                                
                                         <!-- TMPL_IF NAME="author" -->
                                             <a href="/cgi-bin/koha/catalogue/search.pl?q=au:<!-- TMPL_VAR NAME="author_nospan" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="author" --></a>
                                         <!-- TMPL_ELSE -->
                                         <!-- TMPL_IF name="place" --> ; <!-- TMPL_VAR name="place" --><!-- /TMPL_IF -->
                                         <!-- TMPL_IF name="pages" --> - <!-- TMPL_VAR name="pages" --><!-- /TMPL_IF -->
                                         <!-- TMPL_IF name="size" --> ; <!-- TMPL_VAR name="size" --><!-- /TMPL_IF -->
+                                                                               <!-- TMPL_VAR name="description" -->
                                         <!-- TMPL_IF name="timestamp" --> <i>(modified on <!-- TMPL_VAR name="timestamp" -->)</i><!-- /TMPL_IF -->
                                     </p>
                                 <!-- /TMPL_IF -->
-                                                                       <p class="availability">
+                                                                 <!-- TMPL_IF NAME="norequests" -->
+                                        No holds allowed
+                                    <!-- TMPL_ELSE -->
+                                        <a class="reserve" href="/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Holds</a>
+                                    <!-- /TMPL_IF -->
+                                </td>
+                                                               <td style="white-space : nowrap"><p class="availability">
                                                                        <!-- TMPL_IF NAME="items_loop" -->
-                                                                       <span class="available"><strong><!-- TMPL_IF NAME="items_count" --><!-- TMPL_VAR NAME="items_count" --><!-- /TMPL_IF --> copies available at:</strong> <!-- TMPL_LOOP NAME="items_loop" --><!-- <!-- TMPL_VAR NAME="branchcode" --> --><!-- TMPL_VAR NAME="branchname" --> <!-- TMPL_IF name="location" --><!-- TMPL_VAR name="location" --><!-- /TMPL_IF --> <!-- TMPL_IF name="itemcallnumber" --><!-- TMPL_VAR name="itemcallnumber" --><!-- /TMPL_IF --> <!-- TMPL_IF name="cn_class" -->[<a href="/cgi-bin/koha/opac-search.pl?q=callnum:<!-- TMPL_VAR NAME="cn_class" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="cn_class" --></a>]<!-- /TMPL_IF -->(<!-- TMPL_VAR NAME="count" -->),<!-- /TMPL_LOOP --></span>
+                                                                       <span class="available"><strong><!-- TMPL_IF NAME="items_count" --><!-- TMPL_VAR NAME="items_count" --><!-- /TMPL_IF --> copies available at:</strong> <ul><!-- TMPL_LOOP NAME="items_loop" --><li><!-- TMPL_VAR NAME="branchname" --> <!-- TMPL_IF name="location" --><!-- TMPL_VAR name="location" --><!-- /TMPL_IF --> <!-- TMPL_IF name="itemcallnumber" --><!-- TMPL_VAR name="itemcallnumber" --><!-- /TMPL_IF --> <!-- TMPL_IF name="cn_class" -->[<a href="/cgi-bin/koha/opac-search.pl?q=callnum:<!-- TMPL_VAR NAME="cn_class" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="cn_class" --></a>]<!-- /TMPL_IF -->(<!-- TMPL_VAR NAME="count" -->)</li><!-- /TMPL_LOOP --></ul></span>
                                                                        <!-- TMPL_ELSE -->
                                                                        <span class="unavailable">No copies available: </span>
                                                                        <!-- /TMPL_IF -->
                                                                        <!-- TMPL_IF NAME="itemlostcount" --> Lost (<!-- TMPL_VAR NAME="itemlostcount" -->)<!-- /TMPL_IF -->
                                                                        <!-- TMPL_IF NAME="orderedcount" --> On order (<!-- TMPL_VAR NAME="orderedcount" -->)<!-- /TMPL_IF -->
                                                                        </span>
-                                                       </p>
-                                </td>
-                                <td>
-                                    <!-- TMPL_IF NAME="norequests" -->
-                                        No holds allowed
-                                    <!-- TMPL_ELSE -->
-                                        <a class="reserve" href="/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">
-                                            Holds
-                                        </a>
-                                    <!-- /TMPL_IF -->
-                                </td>
+                                                       </p></td>
+
                             </tr>
                         <!-- /TMPL_LOOP -->
                 </table>