aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Bentley <abentley@panoramicfeedback.com>2006-01-02 15:53:32 -0500
committerAaron Bentley <abentley@panoramicfeedback.com>2006-01-02 15:53:32 -0500
commit74df8a9003736ca76dee3b94433edd4e9e04dbc3 (patch)
tree8683f5eaa1001ab48bdc490be6f3e08e2c7300af
parentbb1b72847742ebe56682b0f7f2bd5a3d8037fc4b (diff)
downloadbugseverywhere-74df8a9003736ca76dee3b94433edd4e9e04dbc3.tar.gz
Added assignment of bugs to people to web UI
-rw-r--r--beweb/beweb/controllers.py6
-rw-r--r--beweb/beweb/templates/bugs.kid3
-rw-r--r--beweb/beweb/templates/edit_bug.kid21
3 files changed, 25 insertions, 5 deletions
diff --git a/beweb/beweb/controllers.py b/beweb/beweb/controllers.py
index b0f13db..cbd0816 100644
--- a/beweb/beweb/controllers.py
+++ b/beweb/beweb/controllers.py
@@ -84,10 +84,14 @@ class Bug(PrestHandler):
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"]))
diff --git a/beweb/beweb/templates/bugs.kid b/beweb/beweb/templates/bugs.kid
index b8b2ff7..07d8dee 100644
--- a/beweb/beweb/templates/bugs.kid
+++ b/beweb/beweb/templates/bugs.kid
@@ -2,6 +2,7 @@
<?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"
@@ -20,7 +21,7 @@ def row_class(bug):
<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>
diff --git a/beweb/beweb/templates/edit_bug.kid b/beweb/beweb/templates/edit_bug.kid
index 49dbe52..57f1940 100644
--- a/beweb/beweb/templates/edit_bug.kid
+++ b/beweb/beweb/templates/edit_bug.kid
@@ -3,14 +3,28 @@
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))
?>
@@ -27,7 +41,8 @@ def select_among(name, options, default):
<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>