summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranoop2010-02-25 17:33:34 +0530
committeranoop2010-02-25 17:33:34 +0530
commit0f44b2c832a6a8266e4337b0a32190c3864633c6 (patch)
tree90dee8ae20911a51ca6aa9eb564bf41ea6de89c2
parenta3cda26f529a0994c7086e76d718c4aecc8ecc0b (diff)
downloadpytask-0f44b2c832a6a8266e4337b0a32190c3864633c6.tar.gz
pytask-0f44b2c832a6a8266e4337b0a32190c3864633c6.tar.bz2
pytask-0f44b2c832a6a8266e4337b0a32190c3864633c6.zip
changed the homepage view as well as index.html.
-rw-r--r--taskapp/views/user.py4
-rw-r--r--templates/index.html45
2 files changed, 49 insertions, 0 deletions
diff --git a/taskapp/views/user.py b/taskapp/views/user.py
index a7d39c7..d307890 100644
--- a/taskapp/views/user.py
+++ b/taskapp/views/user.py
@@ -38,12 +38,16 @@ def homepage(request):
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 --git a/templates/index.html b/templates/index.html
index 82840a1..03c12f4 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -11,7 +11,52 @@
{% else %}
Logged in as {{ user.username }} <br />
{% endif %}
+
{% if can_create_task %}
<a href="/task/create/">Create a task</a><br />
{% endif %}
+
+ {% if notifications.count %}
+ <br> {{ notifications.count }} unread <a href='/user/notifications/'>
+ {% ifnotequal notifications.count 1 %}
+ notifications</a>!!
+ {% else %}
+ notification</a>!!
+ {% endifnotequal %}
+ {% endif %}
+
+ {% if requests.count %}
+ <br>{{ requests.count }} unreplied <a href='/user/requests/'>
+ {% ifnotequal requests.count 1 %}
+ requests</a>!
+ {% else %}
+ request</a>!
+ {% endifnotequal %}
+ {% endif %}
+
+ {% if user.task_claimed_users.count %}
+ <br>{{ user.task_claimed_users.count }} <a href='/user/claimed/'>claimed</a>
+ {% ifnotequal user.task_claimed_users.count 1 %}
+ tasks!
+ {% else %}
+ task!
+ {% endifnotequal %}
+ {% endif %}
+
+ {% if user.task_assigned_users.count %}
+ <br>You are currently <a href='/user/assigned/'>working</a> on {{ user.task_assigned_users.count }}
+ {% ifnotequal user.task_assigned_users.count 1 %}
+ tasks!
+ {% else %}
+ task!
+ {% endifnotequal %}
+ {% endif %}
+
+ {% if user.task_mentors.count %}
+ <br><a href="/user/mentor/">Mentoring</a> {{ user.task_mentors.count }}
+ {% ifnotequal user.task_mentors.count 1 %}
+ tasks!
+ {% endifnotequal %}
+ task!
+ {% endif %}
{% endblock %}