summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornishanth2010-03-02 03:55:38 +0530
committernishanth2010-03-02 03:55:38 +0530
commit8b25ebe4a6427c5cf4136d0588037b3de6ffcf39 (patch)
tree34e9010d08583eeab330ac8f1e0145017c2fa6cb
parent26c34400dcbf963086e3cc5d812dc7f1333d5cc5 (diff)
downloadpytask-8b25ebe4a6427c5cf4136d0588037b3de6ffcf39.tar.gz
pytask-8b25ebe4a6427c5cf4136d0588037b3de6ffcf39.tar.bz2
pytask-8b25ebe4a6427c5cf4136d0588037b3de6ffcf39.zip
made the home page look clean.
-rw-r--r--taskapp/views/user.py5
-rw-r--r--templates/index.html71
2 files changed, 56 insertions, 20 deletions
diff --git a/taskapp/views/user.py b/taskapp/views/user.py
index e85b66a..e5ee28b 100644
--- a/taskapp/views/user.py
+++ b/taskapp/views/user.py
@@ -46,7 +46,7 @@ def homepage(request):
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 @@ def homepage(request):
}
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 --git a/templates/index.html b/templates/index.html
index b14457d..d8e3c25 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -9,27 +9,46 @@
<a href="/task/view/tid={{ task.id }}">{{ task.title }}</a><br />
{% endfor %}
{% else %}
- Logged in as {{ user.username }} <br />
+ Logged in as {{ user.username }} <br /><br />
{% endif %}
-
+
+ {% if can_create_task %}
+ <a href="/task/create/">Create a task</a><br />
+ {% endif %}
+ <br />
+ {% ifequal user.get_profile.rights "MG" %}
+ <a href="/user/make/dv/">Request another user to be a Developer</a><br />
+ <a href="/user/make/mg/">Request another user to act as manager</a><br />
+ {% endifequal %}
+ {% ifequal user.get_profile.rights "AD" %}
+ <a href="/user/make/dv/">Request another user to be a Developer</a><br />
+ <a href="/user/make/mg/">Request another user to act as a Manager</a><br />
+ <a href="/user/make/ad">Request another user to act as an Admin</a><br />
+ {% endifequal %}
+ <br />
+
{% if user.unread_notifications.count %}
You have {{ user.unread_notifications.count }} <a href='/user/notifications/'>unread</a>
{% ifnotequal user.unread_notifications.count 1 %}
notifications
{% else %}
notification
- {% endifnotequal %}<br />
+ {% endifnotequal %}
+ <br />
{% endif %}
-
+
{% if user.unread_requests.count %}
- You have {{ user.unread_requests.count }} <a href='/user/requests/'>unreplied</a>
+ You have {{ user.unread_requests.count }} <a href='/user/requests/'>unread</a>
{% ifnotequal user.unread_requests.count 1 %}
requests
{% else %}
request
- {% endifnotequal %}<br />
+ {% endifnotequal %}
+ <br />
{% endif %}
+ <br />
+<!--
{% if user.task_claimed_users.count %}
{{ user.task_claimed_users.count }} <a href='/user/claimed/'>claimed</a>
{% ifnotequal user.task_claimed_users.count 1 %}
@@ -58,24 +77,38 @@
<br />
{% endif %}
+ -->
+
{% if unpublished_tasks %}
- <br />Unpublished tasks viewable by you:<br />
+ Unpublished tasks viewable by you:<br />
{% for a_task in unpublished_tasks %}
<a href="/task/view/tid={{a_task.id}}">{{a_task.title}}</a>&nbsp;&nbsp;&nbsp;
{% endfor %}
+ <br /><br />
+ {% endif %}
+
+ {% if mentored_tasks %}
+ Tasks you are mentoring:<br />
+ {% for a_task in mentored_tasks %}
+ <a href="/task/view/tid={{a_task.id}}">{{a_task.title}}</a>&nbsp;&nbsp;&nbsp;
+ {% endfor %}
+ <br /><br >
{% endif %}
+
+ {% if working_tasks %}
+ Tasks that have been assigned to you:<br />
+ {% for a_task in working_tasks %}
+ <a href="/task/view/tid={{a_task.id}}">{{a_task.title}}</a>&nbsp;&nbsp;&nbsp;
+ {% endfor %}
<br /><br />
- {% if can_create_task %}
- <a href="/task/create/">Create a task</a><br />
{% endif %}
- <br />
- {% ifequal user.get_profile.rights "MG" %}
- <a href="/user/make/dv/">Request another user to be a Developer</a><br />
- <a href="/user/make/mg/">Request another user to act as manager</a><br />
- {% endifequal %}
- {% ifequal user.get_profile.rights "AD" %}
- <a href="/user/make/dv/">Request another user to be a Developer</a><br />
- <a href="/user/make/mg/">Request another user to act as a Manager</a><br />
- <a href="/user/make/ad">Request another user to act as an Admin</a><br />
- {% endifequal %}
+
+ {% if claimed_tasks %}
+ Tasks claimed but still not assigned to you:<br />
+ {% for a_task in claimed_tasks %}
+ <a href="/task/view/tid={{a_task.id}}">{{a_task.title}}</a>&nbsp;&nbsp;&nbsp;
+ {% endfor %}
+ <br /><br />
+ {% endif %}
+
{% endblock %}