Browse Source

Старые задачи подсвечиваются серым бледным светом

devel
bashmak 9 years ago
parent
commit
db3912cc63
  1. 15
      taskapp/templates/taskapp/tasklist_all.html
  2. 4
      taskapp/views.py

15
taskapp/templates/taskapp/tasklist_all.html

@ -32,14 +32,19 @@
<tbody> <tbody>
{% for task in tasks %} {% for task in tasks %}
{% if task.priority == 'E' %}
<tr class="success">
{% if task.out_date > current_date %}
<tr class="text-muted">
{% else %}
{% if task.priority == 'E' %}
<tr class="success">
{% elif task.priority == 'C' %} {% elif task.priority == 'C' %}
<tr>
<tr>
{% elif task.priority == 'A' %} {% elif task.priority == 'A' %}
<tr class="danger">
<tr class="danger">
{% else %} {% else %}
<tr>{% endif %}
<tr>
{% endif %}
{% endif %}
<td><a href="{% url 'taskapp:view' task.id %}" target="_blank">{{ task.id }}</a></td> <td><a href="{% url 'taskapp:view' task.id %}" target="_blank">{{ task.id }}</a></td>
<td>{{ task.descr }}</td> <td>{{ task.descr }}</td>

4
taskapp/views.py

@ -5,6 +5,7 @@ from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages from django.contrib import messages
from abonapp.models import Abon from abonapp.models import Abon
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.utils import timezone
from datetime import date from datetime import date
from .models import Task from .models import Task
from mydefs import pag_mn, only_admins, safe_int, MultipleException from mydefs import pag_mn, only_admins, safe_int, MultipleException
@ -67,7 +68,8 @@ def all_tasks(request):
tasks = Task.objects.all() tasks = Task.objects.all()
tasks = pag_mn(request, tasks) tasks = pag_mn(request, tasks)
return render(request, 'taskapp/tasklist_all.html', { return render(request, 'taskapp/tasklist_all.html', {
'tasks': tasks
'tasks': tasks,
'current_date': timezone.now()
}) })

Loading…
Cancel
Save