raise cherrypy.HTTPRedirect(bug_url(bug_data['project'], bug.uuid))
@provide_action("action", "Update")
- def update(self, bug_data, bug, status, severity, summary, action):
+ def update(self, bug_data, bug, status, severity, summary, assigned,
+ action):
bug.status = status
bug.severity = severity
bug.summary = summary
+ if assigned == "":
+ assigned = None
+ bug.assigned = assigned
bug.save()
raise cherrypy.HTTPRedirect(bug_list_url(bug_data["project"]))
<?python
from libbe.cmdutil import unique_name
from beweb.controllers import bug_url, project_url, bug_list_url
+from beweb.config import people
def row_class(bug):
if bug.status == "closed":
return "closed"
<h1>Bug list for ${project_name}</h1>
<table>
<tr><td>ID</td><td>Status</td><td>Severity</td><td>Assigned To</td><td>Summary</td></tr>
-<div py:for="bug in bugs" py:strip="True"><tr class="${row_class(bug)}" py:if="bug.status != 'closed' or show_closed"><td><a href="${bug_url(project_id, bug.uuid)}">${unique_name(bug, bugs[:])}</a></td><td>${bug.status}</td><td>${bug.severity}</td><td>${bug.assigned}</td><td>${bug.summary}</td></tr>
+<div py:for="bug in bugs" py:strip="True"><tr class="${row_class(bug)}" py:if="bug.status != 'closed' or show_closed"><td><a href="${bug_url(project_id, bug.uuid)}">${unique_name(bug, bugs[:])}</a></td><td>${bug.status}</td><td>${bug.severity}</td><td>${people.get(bug.assigned, bug.assigned)}</td><td>${bug.summary}</td></tr>
</div>
</table>
<a href="${project_url()}">Project list</a>
from libbe.bugdir import severity_levels
from libbe.utility import time_to_str
from beweb.controllers import bug_list_url, comment_url
-def select_among(name, options, default):
+from beweb.config import people
+def select_among(name, options, default, display_names=None):
output = ['<select name="%s">' % name]
for option in options:
if option == default:
selected = ' selected="selected"'
else:
selected = ""
- output.append("<option%s>%s</option>" % (selected, option))
+ if display_names is None:
+ display_name = None
+ else:
+ display_name = display_names.get(option)
+
+ if option is None:
+ option = ""
+ if display_name is None:
+ display_name = option
+ value = ""
+ else:
+ value = ' value="%s"' % option
+ output.append("<option%s%s>%s</option>" % (selected, value,
+ display_name))
output.append("</select>")
return XML("".join(output))
?>
<form method="post">
<table>
<tr><td>Status</td><td>Severity</td><td>Assigned To</td><td>Summary</td></tr>
-<tr><td>${select_among("status", ["open", "closed", "in-progress"], bug.status)}</td><td>${select_among("severity", severity_levels, bug.severity)}</td><td>${bug.assigned}</td><td><input name="summary" value="${bug.summary}" size="80" /></td></tr>
+<tr><td>${select_among("status", ["open", "closed", "in-progress"], bug.status)}</td><td>${select_among("severity", severity_levels, bug.severity)}</td>
+<td>${select_among("assigned", people.keys()+[None], bug.assigned, people)}</td><td><input name="summary" value="${bug.summary}" size="80" /></td></tr>
</table>
<div py:for="comment in bug.list_comments()" class="comment">
<insetbox>