summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--taskapp/events/task.py2
-rw-r--r--taskapp/views/user.py2
-rw-r--r--templates/index.html13
3 files changed, 14 insertions, 3 deletions
diff --git a/taskapp/events/task.py b/taskapp/events/task.py
index 93bd78d..20bb1c6 100644
--- a/taskapp/events/task.py
+++ b/taskapp/events/task.py
@@ -25,7 +25,7 @@ def publishTask(task, rem_mentors=True, rem_comments=True):
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 --git a/taskapp/views/user.py b/taskapp/views/user.py
index 5baf09b..906616f 100644
--- a/taskapp/views/user.py
+++ b/taskapp/views/user.py
@@ -55,6 +55,8 @@ def homepage(request):
'notifications':notifications,
'requests':requests,
}
+
+ context["unpublished_tasks"] = user.task_mentors.filter(status="UP")
return render_to_response('index.html', context)
diff --git a/templates/index.html b/templates/index.html
index 03c12f4..435517c 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -55,8 +55,17 @@
{% if user.task_mentors.count %}
<br><a href="/user/mentor/">Mentoring</a> {{ user.task_mentors.count }}
{% ifnotequal user.task_mentors.count 1 %}
- tasks!
+ tasks!
+ {% else %}
+ task!
{% endifnotequal %}
- task!
+ <br />
+ {% endif %}
+
+ {% if unpublished_tasks %}
+ <br />Unpublished tasks:<br />
+ {% for a_task in unpublished_tasks %}
+ <a href="/task/view/tid={{a_task.id}}">{{a_task.title}}</a>&nbsp;&nbsp;&nbsp;
+ {% endfor %}
{% endif %}
{% endblock %}