[open-ils-commits] r86 - in servres/trunk/conifer: static syrup templates

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Dec 22 22:11:19 EST 2008


Author: artunit
Date: 2008-12-22 22:11:17 -0500 (Mon, 22 Dec 2008)
New Revision: 86

Modified:
   servres/trunk/conifer/static/main.css
   servres/trunk/conifer/syrup/views.py
   servres/trunk/conifer/templates/search_results.xhtml
Log:


Modified: servres/trunk/conifer/static/main.css
===================================================================
--- servres/trunk/conifer/static/main.css	2008-12-16 21:47:17 UTC (rev 85)
+++ servres/trunk/conifer/static/main.css	2008-12-23 03:11:17 UTC (rev 86)
@@ -88,3 +88,14 @@
   text-align: left;
   margin-right: 5px;
 }
+
+.topbox {
+  border: 1px solid #ccc;
+  width: 50%;
+  line-height: 1em;
+  text-align: left;
+}
+
+.topheading th {
+    background-color: #ddf;
+}

Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py	2008-12-16 21:47:17 UTC (rev 85)
+++ servres/trunk/conifer/syrup/views.py	2008-12-23 03:11:17 UTC (rev 86)
@@ -174,7 +174,9 @@
         #item search - this will be expanded
         item_query = get_query(query_string, ['title', 'author'])
         #need to think about sort order here, probably better by author (will make sortable at display level)
-        paginator = Paginator( models.Item.objects.filter(item_query).order_by('-date_created'), 
+        results_list = models.Item.objects.filter(item_query).order_by('-date_created')
+        results_len = len(results_list)
+        paginator = Paginator( results_list,
             count)
 
         #course search
@@ -189,7 +191,9 @@
         instructor_list = models.Member.objects.filter(instr_query).filter(role='INSTR').order_by('user__last_name')[0:5]
         instr_len = len(models.Member.objects.filter(instr_query).filter(role='INSTR'))
     else:
-        paginator = Paginator( models.Item.objects.order_by('-date_created'),
+        results_list = models.Item.objects.order_by('-date_created')
+        results_len = len(results_list)
+        paginator = Paginator( results_list,
             count)
         course_list = models.Course.objects.filter(active=True).order_by('title')[0:5]
         course_len = len(models.Course.objects.filter(active=True))
@@ -211,6 +215,7 @@
                     course_list=course_list,
                     instructor_list=instructor_list,
                     norm_query=norm_query, 
+                    results_len=results_len,
                     course_len=course_len,
                     instr_len=instr_len)
 

Modified: servres/trunk/conifer/templates/search_results.xhtml
===================================================================
--- servres/trunk/conifer/templates/search_results.xhtml	2008-12-16 21:47:17 UTC (rev 85)
+++ servres/trunk/conifer/templates/search_results.xhtml	2008-12-23 03:11:17 UTC (rev 86)
@@ -16,21 +16,21 @@
   </script>
 </head>
 <body>
-<h1>${title}</h1>
+    <h1>${title}</h1>
     
-<h3 py:if="query_string">
-    You searched: <i>${query_string}</i>
-</h3>
+    <h3 py:if="query_string">
+        You searched: <i>${query_string}</i>
+    </h3>
 
-<!-- not sure if this is the best way to do this -->
-<!-- 
-    probably need a simple css option to hide instructors and course info
--->
-<table py:if="instructors or courses">
-    <tr>
+    <!-- not sure if this is the best way to do this -->
+    <!-- 
+        probably need a simple css option to hide instructors and course info
+    -->
+    <table py:if="instructors or courses">
+        <tr>
         <!-- instructors -->
-        <td py:if="instructors" valign="top">
-        <table>
+        <td py:if="instructors" valign="top" class="topbox">
+        <table class="topheading">
         <tr>
         <th>Last Name</th><th>First Name</th>
         </tr>
@@ -42,7 +42,7 @@
         </td>
 
         <!-- courses -->
-        <td py:if="courses" valign="top">
+        <td py:if="courses" valign="top" class="topbox">
         <table>
         <tr>
         <th>Course</th>
@@ -53,10 +53,10 @@
         </tr>
         </table>
         </td>
-    </tr>
-</table>
+        </tr>
+    </table>
   
-    <tr py:def="pageheader()">
+    <tr py:if="results_len > 0" py:def="pageheader()">
         <th>Author</th><th>Title</th>
     </tr>
   



More information about the open-ils-commits mailing list