{# Reusable Kanban board for tasks. Expects `tasks` and `kanban_columns` in context. #}
{{ _('Kanban Board') }}
{% if current_user.is_admin %}
{{ _('Manage Columns') }}
{% endif %}
{% for col in kanban_columns %}
{{ col.label }}
{{ tasks|selectattr('status', 'equalto', col.key)|list|length }}
{% for task in tasks if task.status == col.key %}
#{{ task.id }}
{% if current_user.active_timer and current_user.active_timer.task_id == task.id %}
{% else %}
{% endif %}
{{ task.name }}
{% if task.project %}
{{ task.project.code_display }}
{% endif %} {% if task.description %}

{{ task.description[:90] }}{% if task.description|length > 90 %}...{% endif %}

{% endif %}
{{ task.priority_display }} {% if current_user.active_timer and current_user.active_timer.task_id == task.id %} {{ _('Active') }} {% endif %} {% if task.is_overdue %} {{ _('Overdue') }} {% endif %}
{% if task.estimated_hours %}
{{ _('Progress') }} {{ task.progress_percentage }}%
{% endif %}
{% endfor %}
{% endfor %}