# HG changeset patch # User Nishanth Amuluru # Date 1294552508 -19800 # Node ID f88135529c742ef0697ce1a268ca1723ad4d3004 # Parent c693def6510f0dc6a1e6c387bb8a053f3dfaf77a claim task works fine now diff -r c693def6510f -r f88135529c74 pytask/taskapp/urls.py --- 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), ) diff -r c693def6510f -r f88135529c74 pytask/taskapp/views.py --- 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 diff -r c693def6510f -r f88135529c74 pytask/templates/task/claim.html --- 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.
{% endif %} - {% if claims %} + {% if old_claims %} List of all the claims for the task {{task.title}}
- {% for claim in claims %} + {% for claim in old_claims %}
{{claim.claimed_by.username}} on {{claim.claim_datetime|date:"D d M Y"}} at {{claim.claim_datetime|time:"H:i"}} wrote:
@@ -20,7 +20,6 @@ {% else %} The task cannot be claimed at this stage.
{% endif %} - Click here to view the task.
{% endif %} {% if task_claimed and is_creator %} Select a user to assign the work. diff -r c693def6510f -r f88135529c74 pytask/templates/task/view.html --- 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 @@ Submit Work {% endif %} +
{% if comments %} -
comments:

{% for comment in comments %} {{ comment.commented_by.username }}