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"),
}
@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:
return {"project_id" : project_id,
"project_name" : projects[project_id][0],
"bugs" : bugs,
+ "show_closed" : show_closed,
}
@turbogears.expose(html="beweb.templates.edit_bug")
margin-bottom:0;
color: #990;
}
-tr.closed
-{
- display: none
-}
+
tr.closed td
{
background-color: #ccc;
<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>
?>
<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>
<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>