From 59c742611d77ce59414d073e98782014dfb70d8f Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Sun, 1 Feb 2009 15:45:52 -0500 Subject: Implemented bug adding. --- cfbe.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'cfbe.py') diff --git a/cfbe.py b/cfbe.py index 8f0342f..b061d88 100755 --- a/cfbe.py +++ b/cfbe.py @@ -29,8 +29,13 @@ class WebInterface: possible_targets = list(set([bug.target for bug in self.bd if bug.target != None])) possible_targets.sort(key=unicode.lower) + possible_statuses = [u'open', u'assigned', u'test', u'unconfirmed', + u'wishlist', u'closed', u'disabled', u'fixed', + u'wontfix'] + return {'possible_assignees': possible_assignees, 'possible_targets': possible_targets, + 'possible_statuses': possible_statuses, 'repository_name': self.repository_name,} def filter_bugs(self, status, assignee, target): @@ -70,6 +75,7 @@ class WebInterface: return template.render(bugs=bugs, bd=self.bd, label=label, assignees=common_info['possible_assignees'], targets=common_info['possible_targets'], + statuses=common_info['possible_statuses'], repository_name=common_info['repository_name']) @cherrypy.expose @@ -85,9 +91,16 @@ class WebInterface: return template.render(bug=bug, bd=self.bd, assignees=common_info['possible_assignees'], targets=common_info['possible_targets'], + statuses=common_info['possible_statuses'], repository_name=common_info['repository_name']) - + + @cherrypy.expose + def create(self, summary): + """The view that handles the creation of a new bug.""" + if summary.strip() != '': + self.bd.new_bug(summary=summary).save() + raise cherrypy.HTTPRedirect('/', status=302) config = '/Users/sjl/Documents/cherryflavoredbugseverywhere/cfbe.config' -bug_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/.be' +bug_root = '/Users/sjl/Desktop/be/.be' cherrypy.quickstart(WebInterface(bug_root), '/', config) -- cgit