# HG changeset patch # User nishanth # Date 1267482338 -19800 # Node ID 42aba20cfe97f0b02cc6f1f4ba9108f792c6490b # Parent b61e45074ba14104b87c8af9868da915b2adcc5d made the home page look clean. diff -r b61e45074ba1 -r 42aba20cfe97 taskapp/views/user.py --- a/taskapp/views/user.py Tue Mar 02 03:21:20 2010 +0530 +++ b/taskapp/views/user.py Tue Mar 02 03:55:38 2010 +0530 @@ -46,7 +46,7 @@ if not user.is_authenticated(): is_guest = True disp_num = 10 - task_list = Task.objects.exclude(status="UP").order_by('published_datetime').reverse()[:10] + task_list = Task.objects.exclude(status="UP").exclude(status="CD").exclude("CM").order_by('published_datetime').reverse()[:10] return render_to_response('index.html', {'user':user, 'is_guest':is_guest, 'task_list':task_list}) else: @@ -63,6 +63,9 @@ } context["unpublished_tasks"] = user.task_mentors.filter(status="UP") + context["mentored_tasks"] = user.task_mentors.exclude(status="UP").exclude(status="CM").exclude(status="CD").exclude(status="DL") + context["claimed_tasks"] = user.task_claimed_users.exclude(status="UP").exclude(status="CM").exclude(status="CD").exclude(status="DL") + context["working_tasks"] = user.task_assigned_users.filter(status="WR") return render_to_response('index.html', context) diff -r b61e45074ba1 -r 42aba20cfe97 templates/index.html --- a/templates/index.html Tue Mar 02 03:21:20 2010 +0530 +++ b/templates/index.html Tue Mar 02 03:55:38 2010 +0530 @@ -9,27 +9,46 @@ {{ task.title }}
{% endfor %} {% else %} - Logged in as {{ user.username }}
+ Logged in as {{ user.username }}

+ {% endif %} + + {% if can_create_task %} + Create a task
{% endif %} - +
+ {% ifequal user.get_profile.rights "MG" %} + Request another user to be a Developer
+ Request another user to act as manager
+ {% endifequal %} + {% ifequal user.get_profile.rights "AD" %} + Request another user to be a Developer
+ Request another user to act as a Manager
+ Request another user to act as an Admin
+ {% endifequal %} +
+ {% if user.unread_notifications.count %} You have {{ user.unread_notifications.count }} unread {% ifnotequal user.unread_notifications.count 1 %} notifications {% else %} notification - {% endifnotequal %}
+ {% endifnotequal %} +
{% endif %} - + {% if user.unread_requests.count %} - You have {{ user.unread_requests.count }} unreplied + You have {{ user.unread_requests.count }} unread {% ifnotequal user.unread_requests.count 1 %} requests {% else %} request - {% endifnotequal %}
+ {% endifnotequal %} +
{% endif %} +
+ + {% if unpublished_tasks %} -
Unpublished tasks viewable by you:
+ Unpublished tasks viewable by you:
{% for a_task in unpublished_tasks %} {{a_task.title}}    {% endfor %} +

{% endif %} -

- {% if can_create_task %} - Create a task
+ + {% if mentored_tasks %} + Tasks you are mentoring:
+ {% for a_task in mentored_tasks %} + {{a_task.title}}    + {% endfor %} +

{% endif %} -
- {% ifequal user.get_profile.rights "MG" %} - Request another user to be a Developer
- Request another user to act as manager
- {% endifequal %} - {% ifequal user.get_profile.rights "AD" %} - Request another user to be a Developer
- Request another user to act as a Manager
- Request another user to act as an Admin
- {% endifequal %} + + {% if working_tasks %} + Tasks that have been assigned to you:
+ {% for a_task in working_tasks %} + {{a_task.title}}    + {% endfor %} +

+ {% endif %} + + {% if claimed_tasks %} + Tasks claimed but still not assigned to you:
+ {% for a_task in claimed_tasks %} + {{a_task.title}}    + {% endfor %} +

+ {% endif %} + {% endblock %}