From: Steve Losh Date: Sun, 1 Feb 2009 22:28:05 +0000 (-0500) Subject: Got bug detail editing working, except for the summary. X-Git-Tag: 1.0.0~53^2~4^2~33 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f2e64e8c05e9255be619ae4ce47e9419088b5005;p=be.git Got bug detail editing working, except for the summary. --- diff --git a/.be/bugs/0be47243-c172-4de9-b71b-d5dea60f91d5/values b/.be/bugs/0be47243-c172-4de9-b71b-d5dea60f91d5/values new file mode 100644 index 0000000..93bc968 --- /dev/null +++ b/.be/bugs/0be47243-c172-4de9-b71b-d5dea60f91d5/values @@ -0,0 +1,49 @@ + + + +assigned=Steve Losh + + + + + + +creator=Steve Losh + + + + + + +severity=minor + + + + + + +status=open + + + + + + +summary=Fix the null creation date bug. See bug ee6 in the BE repo for an example that breaks things. + + + + + + +target=alpha + + + + + + +time=Sun, 01 Feb 2009 21:26:49 +0000 + + + diff --git a/.be/bugs/cfb52b6c-d1a6-4018-a255-27cc1c878193/values b/.be/bugs/cfb52b6c-d1a6-4018-a255-27cc1c878193/values new file mode 100644 index 0000000..49fa830 --- /dev/null +++ b/.be/bugs/cfb52b6c-d1a6-4018-a255-27cc1c878193/values @@ -0,0 +1,49 @@ + + + +assigned=Steve Losh + + + + + + +creator=Steve Losh + + + + + + +severity=minor + + + + + + +status=open + + + + + + +summary=Change the write operations to be inline/AJAJ operations. + + + + + + +target=beta + + + + + + +time=Sun, 01 Feb 2009 21:15:35 +0000 + + + diff --git a/cfbe.py b/cfbe.py index 0a8db77..9724fe7 100755 --- a/cfbe.py +++ b/cfbe.py @@ -23,19 +23,22 @@ class WebInterface: self.repository_name = self.bd.root.split('/')[-1] def get_common_information(self): - possible_assignees = list(set([bug.assigned for bug in self.bd if bug.assigned != None])) + possible_assignees = list(set([bug.assigned for bug in self.bd if unicode(bug.assigned) != 'None'])) possible_assignees.sort(key=unicode.lower) - possible_targets = list(set([bug.target for bug in self.bd if bug.target != None])) + possible_targets = list(set([bug.target for bug in self.bd if unicode(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'] + u'closed', u'disabled', u'fixed', u'wontfix'] + + possible_severities = [u'minor', u'serious', u'critical', u'fatal', + u'wishlist'] return {'possible_assignees': possible_assignees, 'possible_targets': possible_targets, 'possible_statuses': possible_statuses, + 'possible_severities': possible_severities, 'repository_name': self.repository_name,} def filter_bugs(self, status, assignee, target): @@ -77,6 +80,7 @@ class WebInterface: assignees=common_info['possible_assignees'], targets=common_info['possible_targets'], statuses=common_info['possible_statuses'], + severities=common_info['possible_severities'], repository_name=common_info['repository_name']) @@ -94,6 +98,7 @@ class WebInterface: assignees=common_info['possible_assignees'], targets=common_info['possible_targets'], statuses=common_info['possible_statuses'], + severities=common_info['possible_severities'], repository_name=common_info['repository_name']) @@ -117,7 +122,26 @@ class WebInterface: raise cherrypy.HTTPRedirect('/bug?id=%s' % (shortname,), status=302) + @cherrypy.expose + def edit(self, id, status, target, assignee, severity, summary=''): + """The view that handles editing bug details.""" + bug = self.bd.bug_from_uuid(id) + shortname = self.bd.bug_shortname(bug) + + if summary.strip() != '': + bug.summary = summary + else: + bug.status = status if status != 'None' else None + bug.target = target if target != 'None' else None + bug.assigned = assignee if assignee != 'None' else None + bug.severity = severity if severity != 'None' else None + + bug.save() + + raise cherrypy.HTTPRedirect('/bug?id=%s' % (shortname,), status=302) + config = '/Users/sjl/Documents/cherryflavoredbugseverywhere/cfbe.config' bug_root = '/Users/sjl/Desktop/be/.be' +# bug_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/.be' cherrypy.quickstart(WebInterface(bug_root), '/', config) diff --git a/static/style/cfbe.css b/static/style/cfbe.css index 2ad25fc..8c7cef9 100644 --- a/static/style/cfbe.css +++ b/static/style/cfbe.css @@ -23,6 +23,8 @@ span#filters a { margin-left: 1.5em; } a:link, a:visited, a:active { color: #d03; text-decoration: none; font-weight: bold; } a:hover { color: #60b305; } +.header-with-link { display: inline-block; } +.header-link { margin-left: 1em; } table#bug-list { width: 100%; border-collapse: collapse; border: 0.084em solid #ccc; } table#bug-list td, table#bug-list th { border: 0em; border-bottom: 0.084em solid #ccc; text-align: left; } @@ -48,4 +50,8 @@ form#create-form input#create-summary { width: 30em; font-weight: 700; } form#create-form button#create-button { } form#add-comment-form { display: none; margin-top: 1.5em; } -p#add-comment-link {margin-top: 1.5em; } \ No newline at end of file +p#add-comment-link {margin-top: 1.5em; } + +form#bug-details-edit-form { display: none; } +form#bug-details-edit-form label { font-weight: 700; width: 7.5em; margin-left: 0em; margin-right: 1em; text-align: right; } +form#bug-details-edit-form .field { padding-left: 0em;} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index c860e65..2503224 100644 --- a/templates/base.html +++ b/templates/base.html @@ -36,15 +36,11 @@ e.preventDefault(); }); - $('#add-comment').click(function(e) { - $('#add-comment-link').hide(); - $('#add-comment-form').fadeIn('fast'); - e.preventDefault(); - }); - $('table tr:odd').addClass('stripe'); }); + + {% block script %}{% endblock %} diff --git a/templates/bug.html b/templates/bug.html index 2cdbb28..01a2476 100644 --- a/templates/bug.html +++ b/templates/bug.html @@ -4,11 +4,38 @@ Bug {{ bd.bug_shortname(bug) }} – {{ bug.summary }} {% endblock %} +{% block script %} + +{% endblock %} + {% block content %}

Created on {{ bug.time|datetimeformat }} by {{ bug.creator|e }}

-

Bug Details

-

+

+ + edit + + +

Status: {{ bug.status }}
@@ -25,6 +52,50 @@ {{ bug.uuid }}

+
+
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+

Summary

{{ bug.summary }}