summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornishanth2010-02-24 11:04:11 +0530
committernishanth2010-02-24 11:04:11 +0530
commitf98d30aa38f712f672947c6920920625e4c391eb (patch)
treef986e9c4996daa3169705805e0a8ef60e55d240c
parentfde938bb05d0444568b044487d6865b2dfc7608c (diff)
downloadpytask-f98d30aa38f712f672947c6920920625e4c391eb.tar.gz
pytask-f98d30aa38f712f672947c6920920625e4c391eb.tar.bz2
pytask-f98d30aa38f712f672947c6920920625e4c391eb.zip
updated view task in views to suit the new design .
-rw-r--r--taskapp/views/task.py9
-rw-r--r--templates/task/view.html8
2 files changed, 11 insertions, 6 deletions
diff --git a/taskapp/views/task.py b/taskapp/views/task.py
index 5a7c8e3..372e361 100644
--- a/taskapp/views/task.py
+++ b/taskapp/views/task.py
@@ -38,7 +38,7 @@ def view_task(request, tid):
is_guest = True if not user.is_authenticated() else False
is_mentor = True if user in task.mentors.all() else False
- task_claimable = True if task.status in ["OP", "RE"] else False
+ task_claimable = True if task.status in ["OP", "WR"] else False
context = {'user':user,
'task':task,
@@ -49,9 +49,10 @@ def view_task(request, tid):
'errors':errors,
}
- if task.status == "AS":
- context['assigned_user'] = task.assigned_users.all()[0]
-
+ assigned_users = task.assigned_users.all()
+ if assigned_users:
+ context['assigned_users'] = assigned_users
+
if request.method == 'POST':
if not is_guest:
data = request.POST["data"]
diff --git a/templates/task/view.html b/templates/task/view.html
index ebeacca..2343b20 100644
--- a/templates/task/view.html
+++ b/templates/task/view.html
@@ -20,8 +20,12 @@
<br />{{ task.desc }}<br />
<hr>
status of task is {{task.status}}<br />
- {% if assigned_user %}
- Task has been assigned to <a href="/user/view/uid={{assigned_user.id}}">{{assigned_user.username}}</a><br />
+ {% if assigned_users %}
+ Users working on this task:
+ {% for user in assigned_users %}
+ <a href="/user/view/uid={{user.id}}">{{user.username}}</a>|
+ {% endfor %}
+ <br />
{% endif %}
{% if not is_guest %}
<a href="/task/claim/tid={{task.id}}">View claims</a><br />