aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--beweb/beweb/controllers.py49
-rw-r--r--beweb/beweb/templates/edit_bug.kid3
2 files changed, 2 insertions, 50 deletions
diff --git a/beweb/beweb/controllers.py b/beweb/beweb/controllers.py
index 8ba1595..2fe3d3e 100644
--- a/beweb/beweb/controllers.py
+++ b/beweb/beweb/controllers.py
@@ -101,52 +101,3 @@ class Root(controllers.Root):
@turbogears.expose()
def index(self):
raise cherrypy.HTTPRedirect(project_url())
-
- @turbogears.expose()
- def default(self, *args, **kwargs):
- if len(args) == 1:
- return self.bugs(args[0], **kwargs)
- elif len(args) == 2:
- return self.bug(*args, **kwargs)
- else:
- return repr(args)
-
-
- @turbogears.expose(html="beweb.templates.bugs")
- 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:
- def cmp_date(bug1, bug2):
- return -cmp(bug1.time, bug2.time)
- bugs.sort(cmp_date)
- bugs.sort(cmp_severity)
- return {"project_id" : project_id,
- "project_name" : projects[project_id][0],
- "bugs" : bugs,
- "show_closed" : show_closed,
- }
-
- @turbogears.expose(html="beweb.templates.edit_bug")
- def bug(self, project_id, bug_uuid, action=None, status=None,
- severity=None, summary=None):
- bug_tree = project_tree(project_id)
- if action == "New bug":
- bug = bug_tree.new_bug()
- bug.creator = names.creator()
- bug.severity = "minor"
- bug.status = "open"
- bug.save()
- raise cherrypy.HTTPRedirect(turbogears.url("/%s/%s/" % (project_id, bug.uuid)))
- else:
- bug = bug_tree.get_bug(bug_uuid)
- if action == "Update":
- bug.status = status
- bug.severity = severity
- bug.summary = summary
- bug.save()
- raise cherrypy.HTTPRedirect(turbogears.url("/%s/" % project_id))
-
- return {"bug": bug, "project_id": project_id, "new":True}
diff --git a/beweb/beweb/templates/edit_bug.kid b/beweb/beweb/templates/edit_bug.kid
index d55ab2e..b328d82 100644
--- a/beweb/beweb/templates/edit_bug.kid
+++ b/beweb/beweb/templates/edit_bug.kid
@@ -2,6 +2,7 @@
<?python
from libbe.bugdir import severity_levels
from libbe.utility import time_to_str
+from beweb.controllers import bug_list_url
def select_among(name, options, default):
output = ['<select name="%s">' % name]
for option in options:
@@ -39,6 +40,6 @@ def select_among(name, options, default):
</div>
<p><input type="submit" name="action" value="Update"/></p>
</form>
-<a href="/${project_id}/">Bug List</a>
+<a href="${bug_list_url(project_id)}">Bug List</a>
</body>
</html>