aboutsummaryrefslogtreecommitdiffstats
path: root/beweb
diff options
context:
space:
mode:
authorAaron Bentley <abentley@panoramicfeedback.com>2005-12-02 14:49:34 +0000
committerAaron Bentley <abentley@panoramicfeedback.com>2005-12-02 14:49:34 +0000
commit4cbb5ea19b1423b57abc7c8a6b6f5f34603c44f5 (patch)
treef66c69da74e9aeb8f8b1f0e89863e90195342a49 /beweb
parent278aa38c3aa37f94c9927b54349ae1b53b7a17c9 (diff)
downloadbugseverywhere-4cbb5ea19b1423b57abc7c8a6b6f5f34603c44f5.tar.gz
Added ability to create bugs to web UI
Diffstat (limited to 'beweb')
-rw-r--r--beweb/beweb/controllers.py15
-rw-r--r--beweb/beweb/templates/bugs.kid3
2 files changed, 16 insertions, 2 deletions
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):
</table>
<a href="/">Project list</a>
<a href="${'/%s/?show_closed=%s' % (project_id, str(not show_closed))}">Toggle closed</a>
+<form action="/$project_id/new/" method="post">
+<input type="submit" name="action" value="New bug"/>
+</form>
</body>
</html>