From 4cbb5ea19b1423b57abc7c8a6b6f5f34603c44f5 Mon Sep 17 00:00:00 2001 From: Aaron Bentley Date: Fri, 2 Dec 2005 14:49:34 +0000 Subject: [PATCH] Added ability to create bugs to web UI --- .../values | 28 +++++++++++++++++++ beweb/beweb/controllers.py | 15 ++++++++-- beweb/beweb/templates/bugs.kid | 3 ++ 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 .be/bugs/b1bc6f39-8166-46c5-a724-4c4a3e1e7d74/values diff --git a/.be/bugs/b1bc6f39-8166-46c5-a724-4c4a3e1e7d74/values b/.be/bugs/b1bc6f39-8166-46c5-a724-4c4a3e1e7d74/values new file mode 100644 index 0000000..c767d0f --- /dev/null +++ b/.be/bugs/b1bc6f39-8166-46c5-a724-4c4a3e1e7d74/values @@ -0,0 +1,28 @@ + + + +creator=abentley + + + + + + +severity=minor + + + + + + +status=open + + + + + + +summary=Comments do not appear in web UI + + + diff --git a/beweb/beweb/controllers.py b/beweb/beweb/controllers.py index b8e2854..cdcf1e7 100644 --- a/beweb/beweb/controllers.py +++ b/beweb/beweb/controllers.py @@ -1,6 +1,8 @@ import turbogears from turbogears import controllers +import cherrypy from libbe.bugdir import tree_root, cmp_severity +from libbe import names from config import projects def project_tree(project): @@ -45,10 +47,19 @@ class Root(controllers.Root): def bug(self, project_id, bug_uuid, action=None, status=None, severity=None, summary=None): bug_tree = project_tree(project_id) - bug = bug_tree.get_bug(bug_uuid) + 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() - return {"bug": bug, "project_id": project_id} + + return {"bug": bug, "project_id": project_id, "new":True} diff --git a/beweb/beweb/templates/bugs.kid b/beweb/beweb/templates/bugs.kid index ef89b0f..c5014c8 100644 --- a/beweb/beweb/templates/bugs.kid +++ b/beweb/beweb/templates/bugs.kid @@ -24,5 +24,8 @@ def row_class(bug): Project list Toggle closed +
+ +
-- 2.26.2