From db3912cc63e72db68decf01f9f6357ad3f0739c7 Mon Sep 17 00:00:00 2001 From: bashmak Date: Sun, 16 Apr 2017 12:40:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=82=D0=B0=D1=80=D1=8B=D0=B5=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B4=D0=B0=D1=87=D0=B8=20=D0=BF=D0=BE=D0=B4=D1=81=D0=B2?= =?UTF-8?q?=D0=B5=D1=87=D0=B8=D0=B2=D0=B0=D1=8E=D1=82=D1=81=D1=8F=20=D1=81?= =?UTF-8?q?=D0=B5=D1=80=D1=8B=D0=BC=20=D0=B1=D0=BB=D0=B5=D0=B4=D0=BD=D1=8B?= =?UTF-8?q?=D0=BC=20=D1=81=D0=B2=D0=B5=D1=82=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- taskapp/templates/taskapp/tasklist_all.html | 15 ++++++++++----- taskapp/views.py | 4 +++- 2 files changed, 13 insertions(+), 6 deletions(-) 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() })