updated view task in views to suit the new design .
authornishanth
Wed, 24 Feb 2010 11:04:11 +0530
changeset 64 e743fe1f0f99
parent 63 1fc027bf99ee
child 65 8ac0ce6cfd66
child 66 f670de53402b
updated view task in views to suit the new design .
taskapp/views/task.py
templates/task/view.html
--- a/taskapp/views/task.py	Wed Feb 24 10:42:46 2010 +0530
+++ b/taskapp/views/task.py	Wed Feb 24 11:04:11 2010 +0530
@@ -38,7 +38,7 @@
     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 @@
                '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"]
--- a/templates/task/view.html	Wed Feb 24 10:42:46 2010 +0530
+++ b/templates/task/view.html	Wed Feb 24 11:04:11 2010 +0530
@@ -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 />