diff --git a/todo/templates/todo/list_detail.html b/todo/templates/todo/list_detail.html index 6ab8c46..12a0fe5 100644 --- a/todo/templates/todo/list_detail.html +++ b/todo/templates/todo/list_detail.html @@ -34,64 +34,68 @@ {% endif %} - {% if list_slug == "mine" %} + {% if items %} + {% if list_slug == "mine" %}

Tasks assigned to me (in all groups)

- {% else %} + {% else %}

Tasks filed under "{{ task_list.name }}"

This list belongs to group {{ task_list.group }}

Tasks :: Drag rows to set priorities

+ {% endif %} + +
+ {% csrf_token %} + + + + + + + + + + + + + {% for task in items %} + + + + + + + + + + + + {% endfor %} +
DoneTaskCreatedDue onOwnerAssignedNoteCommDel
+ + + {{ task.title|truncatewords:20 }} + + {{ task.created_date|date:"m/d/Y" }} + + + {{ task.due_date|date:"m/d/Y" }} + + + {{ task.created_by }} + + {% if task.assigned_to %}{{ task.assigned_to }}{% else %}Anyone{% endif %} + + {% if task.note %}≈{% endif %} + + {% if task.comment_set.all.count > 0 %}{{ task.comment_set.all.count }}{% endif %} + + +
+

+
+ {% else %} +

No items on this list yet (add one!)

{% endif %} - -
- {% csrf_token %} - - - - - - - - - - - - - {% for task in items %} - - - - - - - - - - - - {% endfor %} -
DoneTaskCreatedDue onOwnerAssignedNoteCommDel
- - - {{ task.title|truncatewords:20 }} - - {{ task.created_date|date:"m/d/Y" }} - - - {{ task.due_date|date:"m/d/Y" }} - - - {{ task.created_by }} - - {% if task.assigned_to %}{{ task.assigned_to }}{% else %}Anyone{% endif %} - - {% if task.note %}≈{% endif %} - - {% if task.comment_set.all.count > 0 %}{{ task.comment_set.all.count }}{% endif %} - - -
-

-
{% if list_slug != "mine" %} {% if view_completed %} @@ -103,7 +107,6 @@

Delete this list

{% endif %} - {% endblock %} @@ -136,4 +139,4 @@ }); }); -{% endblock extra_js %} \ No newline at end of file +{% endblock extra_js %} diff --git a/todo/views.py b/todo/views.py index e890c00..2c839eb 100644 --- a/todo/views.py +++ b/todo/views.py @@ -22,7 +22,7 @@ from todo.utils import toggle_done, toggle_deleted, send_notify_mail def check_user_allowed(user): """ Verifies user is logged in, and in staff if that setting is enabled. - Per-object permission checks (e.g. to view a particular list) must be in the views that handle those objects. + Per-object permission checks (e.g. to view a particular list) are in the views that handle those objects. """ if settings.STAFF_ONLY: @@ -106,7 +106,6 @@ def list_detail(request, list_id=None, list_slug=None, view_completed=False): task_list = get_object_or_404(TaskList, id=list_id) items = Item.objects.filter(task_list=task_list.id) - # Apply filters to base queryset if view_completed: items = items.filter(completed=True) else: