--- /dev/null
+
+
+
+assigned=Steve Losh <steve@stevelosh.com>
+
+
+
+
+
+
+creator=Steve Losh <steve@stevelosh.com>
+
+
+
+
+
+
+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
+
+
+
--- /dev/null
+
+
+
+assigned=Steve Losh <steve@stevelosh.com>
+
+
+
+
+
+
+creator=Steve Losh <steve@stevelosh.com>
+
+
+
+
+
+
+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
+
+
+
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):
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'])
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'])
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)
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; }
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
e.preventDefault();
});
- $('#add-comment').click(function(e) {
- $('#add-comment-link').hide();
- $('#add-comment-form').fadeIn('fast');
- e.preventDefault();
- });
-
$('table tr:odd').addClass('stripe');
});
</script>
+
+ {% block script %}{% endblock %}
</head>
<body>
Bug {{ bd.bug_shortname(bug) }} – {{ bug.summary }}
{% endblock %}
+{% block script %}
+ <script type="text/javascript">
+ $(function() {
+ $('#add-comment').click(function(e) {
+ $('#add-comment-link').hide();
+ $('#add-comment-form').fadeIn('fast');
+ e.preventDefault();
+ });
+
+ $('#edit-bug-details').click(function(e) {
+ $('#bug-details').hide();
+ $('#bug-details-edit-form').fadeIn('fast');
+ e.preventDefault();
+ });
+
+ $('#bug-details-edit-status option[value="{{ bug.status }}"]').attr('selected', 'yes');
+ $('#bug-details-edit-target option[value="{{ bug.target }}"]').attr('selected', 'yes');
+ $('#bug-details-edit-assignee option[value="{{ bug.assigned }}"]').attr('selected', 'yes');
+ $('#bug-details-edit-severity option[value="{{ bug.severity }}"]').attr('selected', 'yes');
+ });
+ </script>
+{% endblock %}
+
{% block content %}
<p class="creation-info">Created on {{ bug.time|datetimeformat }} by {{ bug.creator|e }}</p>
- <h3>Bug Details</h3>
- <p>
+ <h3 class="header-with-link">Bug Details</h3>
+ <span class="header-link">
+ <a href="" id="edit-bug-details">edit</a>
+ </span>
+
+ <p id="bug-details">
<span class="detail-field-header">Status:</span>
<span class="detail-field-contents">{{ bug.status }}</span><br />
<span class="detail-field-contents">{{ bug.uuid }}</span><br />
</p>
+ <form id="bug-details-edit-form" class="horizontal" action="/edit" method="post">
+ <fieldset>
+ <input type="hidden" name="id" value="{{ bug.uuid }}" />
+ <div class="field">
+ <label for="bug-details-edit-status">Status:</label>
+ <select id="bug-details-edit-status" name="status">
+ {% for status in statuses %}
+ <option value="{{ status }}">{{ status }}</option>
+ {% endfor %}
+ </select>
+ </div>
+ <div class="field">
+ <label for="bug-details-edit-severity">Severity:</label>
+ <select id="bug-details-edit-severity" name="severity">
+ {% for severity in severities %}
+ <option value="{{ severity }}">{{ severity }}</option>
+ {% endfor %}
+ </select>
+ </div>
+ <div class="field">
+ <label for="bug-details-edit-target">Scheduled for:</label>
+ <select id="bug-details-edit-target" name="target">
+ <option value="None">Unscheduled</option>
+ {% for target in targets %}
+ <option value="{{ target }}">{{ target }}</option>
+ {% endfor %}
+ </select>
+ </div>
+ <div class="field">
+ <label for="bug-details-edit-assignee">Assigned to:</label>
+ <select id="bug-details-edit-assignee" name="assignee">
+ <option value="None">Unassigned</option>
+ {% for assignee in assignees %}
+ <option value="{{ assignee }}">{{ assignee }}</option>
+ {% endfor %}
+ </select>
+ </div>
+ <div class="buttons">
+ <button type="submit">Save Changes</button>
+ <button type="reset">Discard Changes</button>
+ </div>
+ </fieldset>
+ </form>
+
<h3>Summary</h3>
<p>
{{ bug.summary }}