diff options
author | Aaron Bentley <abentley@panoramicfeedback.com> | 2005-12-02 14:49:34 +0000 |
---|---|---|
committer | Aaron Bentley <abentley@panoramicfeedback.com> | 2005-12-02 14:49:34 +0000 |
commit | 4cbb5ea19b1423b57abc7c8a6b6f5f34603c44f5 (patch) | |
tree | f66c69da74e9aeb8f8b1f0e89863e90195342a49 | |
parent | 278aa38c3aa37f94c9927b54349ae1b53b7a17c9 (diff) | |
download | bugseverywhere-4cbb5ea19b1423b57abc7c8a6b6f5f34603c44f5.tar.gz |
Added ability to create bugs to web UI
-rw-r--r-- | .be/bugs/b1bc6f39-8166-46c5-a724-4c4a3e1e7d74/values | 28 | ||||
-rw-r--r-- | beweb/beweb/controllers.py | 15 | ||||
-rw-r--r-- | beweb/beweb/templates/bugs.kid | 3 |
3 files changed, 44 insertions, 2 deletions
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): </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> |