More web UI tweaks
authorAaron Bentley <abentley@panoramicfeedback.com>
Thu, 1 Dec 2005 22:46:33 +0000 (22:46 +0000)
committerAaron Bentley <abentley@panoramicfeedback.com>
Thu, 1 Dec 2005 22:46:33 +0000 (22:46 +0000)
beweb/beweb/config.py
beweb/beweb/controllers.py
beweb/beweb/static/css/style.css
beweb/beweb/templates/bugs.kid
beweb/beweb/templates/projects.kid

index 25cb01badbee1cce5516e366fe8ee59d3168eeaf..063b97768edf8693c1b87e8f3089733be06c3d38 100644 (file)
@@ -1,3 +1,4 @@
 projects = {"be": ("Bugs Everywhere","/home/abentley/be"),
-            "devel": ("PF devel","/home/abentley/devel"),
+            "devel": ("PF Devel","/home/abentley/devel"),
+            "release": ("PF Release","/home/abentley/release"),
 }
index 3111d2fd2f4ebbf50fe43d1a828ce89a0d559aff..b8e28547f2ad70687124220033ad19145c7d0d66 100644 (file)
@@ -25,7 +25,9 @@ class Root(controllers.Root):
             
 
     @turbogears.expose(html="beweb.templates.bugs")
-    def bugs(self, project_id, sort_by=None):
+    def bugs(self, project_id, sort_by=None, show_closed=False):
+        if show_closed == "False":
+            show_closed = False
         bug_tree = project_tree(project_id)
         bugs = list(bug_tree.list())
         if sort_by is None:
@@ -36,6 +38,7 @@ class Root(controllers.Root):
         return {"project_id"      : project_id,
                 "project_name"    : projects[project_id][0],
                 "bugs"            : bugs,
+                "show_closed"     : show_closed,
                }
 
     @turbogears.expose(html="beweb.templates.edit_bug")
index 9d9745e600d08f968611d9c2af1581c6650405b5..6f437770f66e39b5b918816098288bad8fbcde77 100644 (file)
@@ -14,10 +14,7 @@ h1
     margin-bottom:0;
     color: #990;
 }
-tr.closed
-{
-    display: none
-}
+
 tr.closed td
 {
     background-color: #ccc;
index 0001a778aa195b14ce5e2ed8a874db39f7e60df1..ef89b0f21ffe64152a6b2695ed0b8fd500b19e22 100644 (file)
@@ -19,9 +19,10 @@ def row_class(bug):
 <h1>Bug list for ${project_name}</h1>
 <table>
 <tr><td>ID</td><td>Status</td><td>Severity</td><td>Assigned To</td><td>Summary</td></tr>
-<div py:for="bug in bugs" py:strip="True"><tr class="${row_class(bug)}"><td><a href="${'/%s/%s' % (project_id, bug.uuid)}">${unique_name(bug, bugs[:])}</a></td><td>${bug.status}</td><td>${bug.severity}</td><td>${bug.assigned}</td><td>${bug.summary}</td></tr>
+<div py:for="bug in bugs" py:strip="True"><tr class="${row_class(bug)}" py:if="bug.status != 'closed' or show_closed"><td><a href="${'/%s/%s/' % (project_id, bug.uuid)}">${unique_name(bug, bugs[:])}</a></td><td>${bug.status}</td><td>${bug.severity}</td><td>${bug.assigned}</td><td>${bug.summary}</td></tr>
 </div>
 </table>
 <a href="/">Project list</a>
+<a href="${'/%s/?show_closed=%s' % (project_id, str(not show_closed))}">Toggle closed</a>
 </body>
 </html>
index 14199cbc2831a3f977562408cb07bf9a50fa45ed..21b2777b53742f282a894a87e6931a23ae42c9c3 100644 (file)
@@ -14,7 +14,10 @@ def select_among(name, options, default):
 ?>
 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"
     py:extends="'master.kid'">
-
+<?python
+project_triples = [(pn, pid, pl) for pid,(pn, pl) in projects.iteritems()]
+project_triples.sort()
+?>
 <head>
     <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
     <title>Project List</title>
@@ -23,7 +26,7 @@ def select_among(name, options, default):
 <body>
 <h1>Project List</h1>
 <table>
-<tr py:for="project_id,(project_name, project_loc) in projects.iteritems()"><td><a href="/${project_id}/">${project_name}</a></td></tr>
+<tr py:for="project_name, project_id, project_loc in project_triples"><td><a href="/${project_id}/">${project_name}</a></td></tr>
 </table>
 </body>
 </html>