claim task works fine now
authorNishanth Amuluru <nishanth@fossee.in>
Sun, 09 Jan 2011 11:25:08 +0530
changeset 356 f88135529c74
parent 355 c693def6510f
child 357 ec7f2f4256f5
claim task works fine now
pytask/taskapp/urls.py
pytask/taskapp/views.py
pytask/templates/task/claim.html
pytask/templates/task/view.html
--- a/pytask/taskapp/urls.py	Sun Jan 09 11:15:21 2011 +0530
+++ b/pytask/taskapp/urls.py	Sun Jan 09 11:25:08 2011 +0530
@@ -1,10 +1,11 @@
 from django.conf.urls.defaults import *
 
-from pytask.taskapp.views import create_task, view_task
+from pytask.taskapp.views import create_task, view_task, claim_task
 
 urlpatterns = patterns('',
 
             (r'^create/$', create_task),
             (r'^view/tid=(\w+)', view_task),
+            (r'^claim/tid=(\w+)', claim_task),
 )
 
--- a/pytask/taskapp/views.py	Sun Jan 09 11:15:21 2011 +0530
+++ b/pytask/taskapp/views.py	Sun Jan 09 11:25:08 2011 +0530
@@ -10,8 +10,8 @@
 from pytask.utils import make_key
 from pytask.views import show_msg
 
-from pytask.taskapp.models import Task, TaskComment
-from pytask.taskapp.forms import CreateTaskForm, EditTaskForm, TaskCommentForm
+from pytask.taskapp.models import Task, TaskComment, TaskClaim
+from pytask.taskapp.forms import CreateTaskForm, EditTaskForm, TaskCommentForm, ClaimTaskForm
 from pytask.taskapp.utils import getTask
 from pytask.profile.utils import get_notification
 
@@ -138,7 +138,7 @@
         return render_to_response('task/view.html', context)
 
 @login_required
-def claim_task(response, tid):
+def claim_task(request, tid):
 
     task_url = "/task/view/tid=%s"%tid
     claim_url = "/task/claim/tid=%s"%tid
@@ -159,7 +159,7 @@
 
     reviewers = task.reviewers.all()
     claimed_users = task.claimed_users.all()
-    assigned_users = task.assigned_users.all()
+    selected_users = task.selected_users.all()
 
     is_creator = True if user == task.created_by else False
     is_reviewer = True if user in reviewers else False
--- a/pytask/templates/task/claim.html	Sun Jan 09 11:15:21 2011 +0530
+++ b/pytask/templates/task/claim.html	Sun Jan 09 11:25:08 2011 +0530
@@ -3,9 +3,9 @@
     {% if can_claim %}
     Propose a claim to work on this task.<br />
     {% endif %}
-    {% if claims %}
+    {% if old_claims %}
         List of all the claims for the task <a href="/task/view/tid={{task.uniq_key}}">{{task.title}}</a><br />
-        {% for claim in claims %}
+        {% for claim in old_claims %}
             <hr />
             <a href="/user/view/uid={{claim.claimed_by.id}}">{{claim.claimed_by.username}}</a>
             on {{claim.claim_datetime|date:"D d M Y"}} at {{claim.claim_datetime|time:"H:i"}} wrote:<br />
@@ -20,7 +20,6 @@
         {% else %}
             The task cannot be claimed at this stage.<br />
         {% endif %}
-        <a href="/task/view/tid={{task.id}}">Click here</a> to view the task.<br />
     {% endif %}
     {% if task_claimed and is_creator %}
         <a href="/task/select/tid={{task.id}}">Select a user to assign the work.</a>
--- a/pytask/templates/task/view.html	Sun Jan 09 11:15:21 2011 +0530
+++ b/pytask/templates/task/view.html	Sun Jan 09 11:25:08 2011 +0530
@@ -106,8 +106,8 @@
         <a href="/task/report/tid={{task.uniq_key}}">Submit Work</a>
     {% endif %}
     
+        <hr />
     {% if comments %}
-        <hr />
         comments:<br /><br />
         {% for comment in comments %}
             <a href="/user/view/uid={{comment.commented_by.uniq_key}}">{{ comment.commented_by.username }}</a>