# HG changeset patch
# User anoop
# Date 1267099634 -19800
# Node ID cf94e35a9f99d8d83fadea2aeba1c6e397375e34
# Parent 3699550991c6b9350a32a1abdc5876c9bfb92f7a# Parent 2881ed1c52b0116aa688ac260792f96155faabc1
merged
diff -r 2881ed1c52b0 -r cf94e35a9f99 taskapp/views/user.py
--- a/taskapp/views/user.py Thu Feb 25 17:00:18 2010 +0530
+++ b/taskapp/views/user.py Thu Feb 25 17:37:14 2010 +0530
@@ -38,12 +38,16 @@
user_profile = user.get_profile()
is_mentor = True if user.task_mentors.all() else False
can_create_task = False if user_profile.rights == u"CT" else True
+ notifications = user.notification_to.filter(deleted=False,is_read=False)
+ requests = user.request_sent_to.filter(is_replied=False)
context = {'user':user,
'is_guest':is_guest,
'is_mentor':is_mentor,
'task_list':task_list,
'can_create_task':can_create_task,
+ 'notifications':notifications,
+ 'requests':requests,
}
return render_to_response('index.html', context)
diff -r 2881ed1c52b0 -r cf94e35a9f99 templates/index.html
--- a/templates/index.html Thu Feb 25 17:00:18 2010 +0530
+++ b/templates/index.html Thu Feb 25 17:37:14 2010 +0530
@@ -11,7 +11,52 @@
{% else %}
Logged in as {{ user.username }}
{% endif %}
+
{% if can_create_task %}
Create a task
{% endif %}
+
+ {% if notifications.count %}
+
{{ notifications.count }} unread
+ {% ifnotequal notifications.count 1 %}
+ notifications!!
+ {% else %}
+ notification!!
+ {% endifnotequal %}
+ {% endif %}
+
+ {% if requests.count %}
+
{{ requests.count }} unreplied
+ {% ifnotequal requests.count 1 %}
+ requests!
+ {% else %}
+ request!
+ {% endifnotequal %}
+ {% endif %}
+
+ {% if user.task_claimed_users.count %}
+
{{ user.task_claimed_users.count }} claimed
+ {% ifnotequal user.task_claimed_users.count 1 %}
+ tasks!
+ {% else %}
+ task!
+ {% endifnotequal %}
+ {% endif %}
+
+ {% if user.task_assigned_users.count %}
+
You are currently working on {{ user.task_assigned_users.count }}
+ {% ifnotequal user.task_assigned_users.count 1 %}
+ tasks!
+ {% else %}
+ task!
+ {% endifnotequal %}
+ {% endif %}
+
+ {% if user.task_mentors.count %}
+
Mentoring {{ user.task_mentors.count }}
+ {% ifnotequal user.task_mentors.count 1 %}
+ tasks!
+ {% endifnotequal %}
+ task!
+ {% endif %}
{% endblock %}