# HG changeset patch
# User nishanth
# Date 1267206743 -19800
# Node ID d3cfceb8e120c8721343c2a5211c0110e4e3d942
# Parent 6d92b7cd2a3724f5a3249cc22f195a2ee4928e1a
homepage now displays a list of unpublished tasks
diff -r 6d92b7cd2a37 -r d3cfceb8e120 taskapp/events/task.py
--- a/taskapp/events/task.py Fri Feb 26 22:45:19 2010 +0530
+++ b/taskapp/events/task.py Fri Feb 26 23:22:23 2010 +0530
@@ -25,7 +25,7 @@
task.comment_set.update(is_deleted=True)
task.comment_set.update(deleted_by=task.created_by)
- task.published_datetime = datetime.datetime.now()
+ task.published_datetime = datetime.now()
task.save()
return task
diff -r 6d92b7cd2a37 -r d3cfceb8e120 taskapp/views/user.py
--- a/taskapp/views/user.py Fri Feb 26 22:45:19 2010 +0530
+++ b/taskapp/views/user.py Fri Feb 26 23:22:23 2010 +0530
@@ -55,6 +55,8 @@
'notifications':notifications,
'requests':requests,
}
+
+ context["unpublished_tasks"] = user.task_mentors.filter(status="UP")
return render_to_response('index.html', context)
diff -r 6d92b7cd2a37 -r d3cfceb8e120 templates/index.html
--- a/templates/index.html Fri Feb 26 22:45:19 2010 +0530
+++ b/templates/index.html Fri Feb 26 23:22:23 2010 +0530
@@ -55,8 +55,17 @@
{% if user.task_mentors.count %}
Mentoring {{ user.task_mentors.count }}
{% ifnotequal user.task_mentors.count 1 %}
- tasks!
+ tasks!
+ {% else %}
+ task!
{% endifnotequal %}
- task!
+
+ {% endif %}
+
+ {% if unpublished_tasks %}
+
Unpublished tasks:
+ {% for a_task in unpublished_tasks %}
+ {{a_task.title}}
+ {% endfor %}
{% endif %}
{% endblock %}