diff --git a/taskapp/templates/taskapp/tasklist_all.html b/taskapp/templates/taskapp/tasklist_all.html index 87b298d..4ed5c92 100644 --- a/taskapp/templates/taskapp/tasklist_all.html +++ b/taskapp/templates/taskapp/tasklist_all.html @@ -32,14 +32,19 @@ {% for task in tasks %} - {% if task.priority == 'E' %} - + {% if task.out_date > current_date %} + + {% else %} + {% if task.priority == 'E' %} + {% elif task.priority == 'C' %} - + {% elif task.priority == 'A' %} - + {% else %} - {% endif %} + + {% endif %} + {% endif %} {{ task.id }} {{ task.descr }} diff --git a/taskapp/views.py b/taskapp/views.py index 8200cf5..495ebbb 100644 --- a/taskapp/views.py +++ b/taskapp/views.py @@ -5,6 +5,7 @@ from django.shortcuts import render, redirect, get_object_or_404 from django.contrib import messages from abonapp.models import Abon from django.utils.translation import ugettext as _ +from django.utils import timezone from datetime import date from .models import Task from mydefs import pag_mn, only_admins, safe_int, MultipleException @@ -67,7 +68,8 @@ def all_tasks(request): tasks = Task.objects.all() tasks = pag_mn(request, tasks) return render(request, 'taskapp/tasklist_all.html', { - 'tasks': tasks + 'tasks': tasks, + 'current_date': timezone.now() })