{% extends "base.html" %} {% block content %}

Task Board

Manage fabrication, machining, and engineering tasks

{% if view_type == "admin" %}
Admin View: Showing all tasks across all departments
{% elif view_type == "department_head" and department_info %}
{{ current_user.department }} Department View: Showing tasks for your department only
{% else %}
My Tasks: Showing tasks assigned to you
{% endif %}
Total Tasks

{{ stats.total }}

In Progress

{{ stats.in_progress }}

Completed

{{ stats.completed }}

Overdue

{{ overdue_count }}

Blocked

{{ stats.blocked }}

Review

{{ stats.review }}

New Request {{ tasks_by_status['New Request']|length }}
{% for task in tasks_by_status['New Request'] %}
{{ task.title }}
{{ task.priority }}
{{ task.task_type or "General" }}
{{ task.assigned_to or "Unassigned" }} {% if task.due_date %}
{{ task.due_date.strftime('%d %b %Y') }} {% endif %} {% if task.comment_count > 0 %} {{ task.comment_count }} {% endif %}
{% else %}

No tasks

{% endfor %}
Assigned {{ tasks_by_status['Assigned']|length }}
{% for task in tasks_by_status['Assigned'] %}
{{ task.title }}
{{ task.priority }}
{{ task.task_type or "General" }}
{{ task.assigned_to or "Unassigned" }} {% if task.due_date %}
{{ task.due_date.strftime('%d %b %Y') }} {% endif %} {% if task.comment_count > 0 %} {{ task.comment_count }} {% endif %}
{% else %}

No tasks

{% endfor %}
Design {{ tasks_by_status['Design']|length }}
{% for task in tasks_by_status['Design'] %}
{{ task.title }}
{{ task.priority }}
{{ task.task_type or "General" }}
{{ task.assigned_to or "Unassigned" }} {% if task.due_date %}
{{ task.due_date.strftime('%d %b %Y') }} {% endif %} {% if task.comment_count > 0 %} {{ task.comment_count }} {% endif %}
{% else %}

No tasks

{% endfor %}
Material Planning {{ tasks_by_status['Material Planning']|length }}
{% for task in tasks_by_status['Material Planning'] %}
{{ task.title }}
{{ task.priority }}
{{ task.task_type or "General" }}
{{ task.assigned_to or "Unassigned" }} {% if task.due_date %}
{{ task.due_date.strftime('%d %b %Y') }} {% endif %} {% if task.comment_count > 0 %} {{ task.comment_count }} {% endif %}
{% else %}

No tasks

{% endfor %}
In Progress {{ tasks_by_status['In Progress']|length }}
{% for task in tasks_by_status['In Progress'] %}
{{ task.title }}
{{ task.priority }}
{{ task.task_type or "General" }}
{{ task.assigned_to or "Unassigned" }} {% if task.due_date %}
{{ task.due_date.strftime('%d %b %Y') }} {% endif %} {% if task.comment_count > 0 %} {{ task.comment_count }} {% endif %}
{% else %}

No tasks

{% endfor %}
QA/Review {{ tasks_by_status['QA/Review']|length }}
{% for task in tasks_by_status['QA/Review'] %}
{{ task.title }}
{{ task.priority }}
{{ task.task_type or "General" }}
{{ task.assigned_to or "Unassigned" }} {% if task.due_date %}
{{ task.due_date.strftime('%d %b %Y') }} {% endif %} {% if task.comment_count > 0 %} {{ task.comment_count }} {% endif %}
{% else %}

No tasks

{% endfor %}
Completed {{ tasks_by_status['Completed']|length }}
{% for task in tasks_by_status['Completed'] %}
{{ task.title }}
{{ task.priority }}
{{ task.task_type or "General" }}
{{ task.assigned_to or "Unassigned" }} Completed: {{ task.updated_at.strftime('%d %b %Y') if task.updated_at else "" }}
{% else %}

No tasks

{% endfor %}
Blocked {{ tasks_by_status['Blocked']|length }}
{% for task in tasks_by_status['Blocked'] %}
{{ task.title }}
{{ task.priority }}
{{ task.task_type or "General" }}
{{ task.assigned_to or "Unassigned" }}
{% else %}

No blocked tasks

{% endfor %}
{% set all_tasks = [] %} {% for task_list in tasks_by_status.values() %} {% for task in task_list %} {% set _ = all_tasks.append(task) %} {% endfor %} {% endfor %} {# Sort and get first 8 #} {% set recent_tasks = [] %} {% for task in all_tasks|sort(attribute='created_at', reverse=True) %} {% if loop.index0 < 8 %} {% set _ = recent_tasks.append(task) %} {% endif %} {% endfor %}
Recent Tasks (Last 8) {{ recent_tasks|length }}
View All
{% for task in recent_tasks %} {% else %} {% endfor %}
Task Type Status Priority Assigned To Due Date Progress Actions
{{ task.title|truncate(30) }}
#{{ task.id }}
{{ task.task_type or "General" }} {% if task.status == 'New Request' %}📋{% elif task.status == 'Assigned' %}🔧{% elif task.status == 'Design' %}📐{% elif task.status == 'Material Planning' %}📦{% elif task.status == 'In Progress' %}⚙️{% elif task.status == 'QA/Review' %}✅{% elif task.status == 'Completed' %}🚀{% elif task.status == 'Blocked' %}🛑{% endif %} {{ task.status }} {{ task.priority }} {{ task.assigned_to or "Unassigned" }} {% if task.due_date %} {{ task.due_date.strftime('%d %b %Y') }} {% if task.is_overdue %} {% endif %} {% else %} Not set {% endif %}
{{ task.completion_percentage|round(0) }}%
{% if current_user.role in ["Admin", "Director"] or current_user.is_department_head %} {% if not current_user.is_department_head or current_user.department == task.department %} {% endif %} {% else %} - {% endif %}
No tasks found
Archived / Canceled Tasks
{% for task in tasks_by_status['Cancelled'] %}
{{ task.title }}
{{ task.assigned_to or "Unassigned" }}
{% else %}

No archived tasks

{% endfor %}
{% endblock %}