Added stripey table support
authorAaron Bentley <abentley@panoramicfeedback.com>
Fri, 31 Mar 2006 22:02:43 +0000 (17:02 -0500)
committerAaron Bentley <abentley@panoramicfeedback.com>
Fri, 31 Mar 2006 22:02:43 +0000 (17:02 -0500)
.be/bugs/cb56c990-a757-4aef-9888-a30918a7b3d7/values
beweb/beweb/static/css/style.css
beweb/beweb/templates/bugs.kid

index 4e346e72ccc8ce0699f12856759e22a4cfb8849c..790c8c6ecf9ba48df0fc7175d5d502704b12fc6b 100644 (file)
@@ -15,7 +15,7 @@ severity=minor
 
 
 
-status=open
+status=closed
 
 
 
index 160beff15e1987fa68ed7ba3938d07b69a0d86d0..986950f67b292f234c39af78831d43cc3badfc98 100644 (file)
@@ -98,3 +98,7 @@ pre.traceback
 {
   font-family: Verdana, Ariel, Helvetica, sanserif;
 }
+tr.even td
+{
+  background-color: #eee;
+}
index d4d783cbc1b8a4ab96a682098a7103c7d17423ce..b83a5930309400a14f4835a98de2a8c061299ef1 100644 (file)
@@ -3,14 +3,16 @@
 from libbe.cmdutil import unique_name
 from beweb.controllers import bug_url, project_url, bug_list_url
 from beweb.config import people
-def row_class(bug):
+def row_class(bug, num):
     if not bug.active is True:
         return "closed"
+    elif num % 2 == 0:
+        return "even"
     else:
-        return ""
+        return "odd"
 
 
-def match(bug, show_closed=False, search=None):
+def match(bug, show_closed, search):
     if not show_closed and not bug.active:
         return False
     elif search is None:
@@ -30,7 +32,7 @@ def match(bug, show_closed=False, search=None):
 <h1>Bug list for ${project_name}</h1>
 <table>
 <tr><td>ID</td><td>Status</td><td>Severity</td><td>Assigned To</td><td>Comments</td><td>Summary</td></tr>
-<div py:for="bug in bugs" py:strip="True"><tr class="${row_class(bug)}" py:if="match(bug, show_closed, search)"><td><a href="${bug_url(project_id, bug.uuid)}">${unique_name(bug, bugs[:])}</a></td><td>${bug.status}</td><td>${bug.severity}</td><td>${people.get(bug.assigned, bug.assigned)}</td><td>${len(list(bug.iter_comment_ids()))}</td><td>${bug.summary}</td></tr>
+<div py:for="num, bug in enumerate([b for b in bugs if match(b, show_closed, search)])" py:strip="True"><tr class="${row_class(bug, num)}"><td><a href="${bug_url(project_id, bug.uuid)}">${unique_name(bug, bugs[:])}</a></td><td>${bug.status}</td><td>${bug.severity}</td><td>${people.get(bug.assigned, bug.assigned)}</td><td>${len(list(bug.iter_comment_ids()))}</td><td>${bug.summary}</td></tr>
 </div>
 </table>
 <a href="${project_url()}">Project list</a>