{% extends "base.html" %} {% block title %}Задачи{% endblock %} {% block page_title %}Задачи{% endblock %} {% block content %}

Задачи

{% if current_user.role in ('admin', 'senior_expert') %} Новая задача {% endif %}
{% macro task_table(tasks, show_assigner=False) %}
{% if tasks %}
{% if show_assigner %}{% endif %} {% for t in tasks %} {% if show_assigner %}{% endif %} {% endfor %}
ЗадачаОт кого{% if show_assigner %}Кому{% else %}Назначена{% endif %} Приоритет Статус Срок Действия
{{ t.title }} {% if t.rework_comment %} {% endif %} {{ t.assigner.full_name if t.assigner else '—' }}{% if show_assigner %}{{ t.assignee.full_name }}{% else %}{{ t.assigner.full_name if t.assigner else '—' }}{% endif %} {{ {'high': 'Высокий', 'medium': 'Средний', 'low': 'Низкий'}.get(t.priority, t.priority) }} {{ {'pending': 'Ожидает', 'in_progress': 'В работе', 'completed': 'Готово', 'cancelled': 'Отменено'}.get(t.status, t.status) }} {{ t.due_date.strftime('%d.%m.%Y') if t.due_date else '—' }}
{% if t.assigned_to == current_user.id or current_user.role == 'admin' %} 🔄 {% endif %} {% if t.assigned_by == current_user.id or current_user.role == 'admin' %} {% endif %} {% if current_user.role == 'admin' %} {% endif %} {% if t.description %}{% endif %}
{% else %}

Нет задач

{% endif %}
{% endmacro %} {% if current_user.role == 'admin' %} {{ task_table(tasks=assigned_tasks, show_assigner=False) }} {% else %} {% if assigned_tasks %}

Мои задачи

{{ task_table(tasks=assigned_tasks, show_assigner=True) }} {% endif %} {% if created_tasks %}

Я назначил

{{ task_table(tasks=created_tasks, show_assigner=False) }} {% endif %} {% if not assigned_tasks and not created_tasks %}

Нет задач

{% endif %} {% endif %} {% endblock %} {% block scripts %} {% endblock %}