{% extends 'django_forms_workflows/base.html' %} {% block title %}Submission #{{ submission.id }} - {{ site_name }}{% endblock %} {% block content %}

Submission #{{ submission.id }}

{% if submission.status == 'draft' %} Draft {% elif submission.status == 'submitted' %} Submitted {% elif submission.status == 'pending_approval' %} Pending Approval {% elif submission.status == 'approved' %} Approved {% elif submission.status == 'rejected' %} Rejected {% elif submission.status == 'withdrawn' %} Withdrawn {% endif %}
Submission Information

Form: {{ submission.form_definition.name }}

Submitter: {{ submission.submitter.get_full_name|default:submission.submitter.username }}

Created: {{ submission.created_at|date:"Y-m-d H:i" }}

Status: {{ submission.get_status_display }}

{% if submission.submitted_at %}

Submitted: {{ submission.submitted_at|date:"Y-m-d H:i" }}

{% endif %} {% if submission.completed_at %}

Completed: {{ submission.completed_at|date:"Y-m-d H:i" }}

{% endif %}
Form Data
{% for key, value in form_data.items %} {% endfor %}
{{ key|title }} {% if value.url %} {# File upload with URL - display as image or link #} {% if value.content_type and 'image' in value.content_type %}
{{ value.filename }}
{% endif %} {{ value.filename }} {% if value.size %}({{ value.size|filesizeformat }}){% endif %} {% elif value.path %} {# File upload with path but no URL #} {{ value.filename }} (File stored but URL unavailable) {% else %} {{ value }} {% endif %}
{% if approval_tasks %} {% if stage_groups %} {# ---- Staged workflow: one card per stage ---- #}
Approval History
{% for stage in stage_groups %}
Stage {{ stage.number }}: {{ stage.name }} {% if stage.approval_logic == "all" %} All must approve {% elif stage.approval_logic == "any" %} Any can approve {% else %} Sequential {% endif %} {{ stage.approved_count }}/{{ stage.total_count }} approved {% if stage.rejected_count > 0 %} ยท {{ stage.rejected_count }} rejected{% endif %}
{% for task in stage.tasks %} {% endfor %}
Assigned To Status Completed By Completed At Comments
{% if task.assigned_to %} {{ task.assigned_to.get_full_name|default:task.assigned_to.username }} {% elif task.assigned_group %} {{ task.assigned_group.name }} (Group) {% else %}-{% endif %} {% if task.status == 'pending' %}Pending {% elif task.status == 'approved' %}Approved {% elif task.status == 'rejected' %}Rejected {% elif task.status == 'expired' %}Expired {% elif task.status == 'skipped' %}Skipped {% endif %} {% if task.completed_by %}{{ task.completed_by.get_full_name|default:task.completed_by.username }}{% else %}-{% endif %} {% if task.completed_at %}{{ task.completed_at|date:"Y-m-d H:i" }}{% else %}-{% endif %} {{ task.comments|default:"-" }}
{% endfor %} {% else %} {# ---- Legacy flat workflow ---- #}
Approval History
{% for task in approval_tasks %} {% endfor %}
Step Assigned To Status Completed By Completed At Comments
{{ task.step_name }} {% if task.assigned_to %} {{ task.assigned_to.get_full_name|default:task.assigned_to.username }} {% elif task.assigned_group %} {{ task.assigned_group.name }} (Group) {% endif %} {% if task.status == 'pending' %}Pending {% elif task.status == 'approved' %}Approved {% elif task.status == 'rejected' %}Rejected {% elif task.status == 'expired' %}Expired {% elif task.status == 'skipped' %}Skipped {% endif %} {% if task.completed_by %}{{ task.completed_by.get_full_name|default:task.completed_by.username }}{% else %}-{% endif %} {% if task.completed_at %}{{ task.completed_at|date:"Y-m-d H:i" }}{% else %}-{% endif %} {{ task.comments|default:"-" }}
{% endif %} {% endif %}
Back to My Submissions {% if submission.status == 'submitted' or submission.status == 'pending_approval' %} {% if submission.form_definition.allow_withdrawal and submission.submitter == user %} Withdraw Submission {% endif %} {% endif %}
{% endblock %}