[open-ils-commits] r37 - in servres/trunk/conifer: . static templates

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Nov 20 15:45:15 EST 2008


Author: artunit
Date: 2008-11-20 15:45:10 -0500 (Thu, 20 Nov 2008)
New Revision: 37

Added:
   servres/trunk/conifer/genshi_namespace.py
Modified:
   servres/trunk/conifer/genshi_support.py
   servres/trunk/conifer/static/main.css
   servres/trunk/conifer/templates/open_courses.xhtml
   servres/trunk/conifer/templates/paginate.xhtml
Log:


Added: servres/trunk/conifer/genshi_namespace.py
===================================================================
--- servres/trunk/conifer/genshi_namespace.py	                        (rev 0)
+++ servres/trunk/conifer/genshi_namespace.py	2008-11-20 20:45:10 UTC (rev 37)
@@ -0,0 +1,2 @@
+from itertools import cycle, islice # etc.
+from os.path import isfile        # for example

Modified: servres/trunk/conifer/genshi_support.py
===================================================================
--- servres/trunk/conifer/genshi_support.py	2008-11-20 04:49:38 UTC (rev 36)
+++ servres/trunk/conifer/genshi_support.py	2008-11-20 20:45:10 UTC (rev 37)
@@ -1,3 +1,4 @@
+import genshi_namespace
 from django.http import HttpResponse, HttpRequest
 from genshi.template import TemplateLoader
 from genshi.filters import Translator
@@ -36,5 +37,4 @@
     ns['models'] = models
     ns['request'] = request
     ns['user'] = getattr(request, 'user', None)
-
-
+    ns.update(genshi_namespace.__dict__)

Modified: servres/trunk/conifer/static/main.css
===================================================================
--- servres/trunk/conifer/static/main.css	2008-11-20 04:49:38 UTC (rev 36)
+++ servres/trunk/conifer/static/main.css	2008-11-20 20:45:10 UTC (rev 37)
@@ -59,4 +59,7 @@
 }
 
 .pagetable td { border: #ddd 1px solid; padding: 4 8; }
-.pagetable thead th { font-size: smaller; text-align: left; padding: 2 8; }
\ No newline at end of file
+.pagetable .odd {
+    background-color: #F8F8F8;
+}
+.pagetable thead th { font-size: smaller; text-align: left; padding: 2 8; }

Modified: servres/trunk/conifer/templates/open_courses.xhtml
===================================================================
--- servres/trunk/conifer/templates/open_courses.xhtml	2008-11-20 04:49:38 UTC (rev 36)
+++ servres/trunk/conifer/templates/open_courses.xhtml	2008-11-20 20:45:10 UTC (rev 37)
@@ -18,11 +18,14 @@
   <tr py:def="pageheader()">
     <th>Term</th><th>Code</th><th>Title</th>
   </tr>
-  <tr py:def="pagerow(item)">
+  <span py:def="pagerow(item)">
     <td>${item.term}</td>
     <td><a href="../course/${item.id}/">${item.code}</a></td>
     <td><a href="../course/${item.id}/">${item.title}</a></td>
-  </tr>
+  </span>
+    <!--
   ${pagetable(paginator, start, count, pagerow, pageheader)}
+    -->
+  ${pagetable(paginator, count, pagerow, pageheader)}
 </body>
 </html>

Modified: servres/trunk/conifer/templates/paginate.xhtml
===================================================================
--- servres/trunk/conifer/templates/paginate.xhtml	2008-11-20 04:49:38 UTC (rev 36)
+++ servres/trunk/conifer/templates/paginate.xhtml	2008-11-20 20:45:10 UTC (rev 37)
@@ -2,15 +2,17 @@
       xmlns:py="http://genshi.edgewall.org/"
       xmlns:xi="http://www.w3.org/2001/XInclude"
       py:strip="">
-<div py:def="pagetable(paginator, start, count, pagerow, pagehead=None)"
+<div py:def="pagetable(paginator, count, pagerow, pagehead=None)"
      py:with="page = paginator.page(page_num)">
-  <table class="pagetable">
+  <table class="pagetable" py:with="cls = cycle(('odd', 'even'))"> 
     <thead py:if="pagehead">
       ${pagehead()}
     </thead>
     <tbody>
       <tr py:strip="True" py:for="item in page.object_list">
+    <tr class="${cls.next()}">
 	${pagerow(item)}
+    </tr>
       </tr>
     </tbody>
   </table>
@@ -29,4 +31,4 @@
     </span>
   </div>
 </div>
-</html>
\ No newline at end of file
+</html>



More information about the open-ils-commits mailing list