{% 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 == 'approved_pending' %} Pending Approval {% elif submission.status == 'rejected' %} Rejected {% elif submission.status == 'withdrawn' %} Withdrawn {% endif %} {% with pdf=submission.form_definition.pdf_generation %} {% if pdf == 'anytime' and submission.status != 'draft' %} View PDF Download PDF {% elif pdf == 'post_approval' and submission.status == 'approved' %} View PDF Download PDF {% elif pdf == 'post_approval' and can_approve_pdf and submission.status != 'draft' %} View PDF (Pending) Download PDF (Pending) {% endif %} {% endwith %}
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 entry in form_data_ordered %} {% if entry.key not in approval_field_names %} {% endif %}{# /approval_field_names check #} {% endfor %}
{{ entry.label }} {% if entry.value.url %} {# Single file upload with URL #} {% if entry.value.content_type and 'image' in entry.value.content_type %}
{{ entry.value.filename }}
{% endif %} {{ entry.value.filename }} {% if entry.value.size %}({{ entry.value.size|filesizeformat }}){% endif %} {% elif entry.value.path %} {# Single file with path but no URL #} {{ entry.value.filename }} (File stored but URL unavailable) {% elif entry.value.0.filename %} {# Multi-file upload: list of file dicts #}
    {% for f in entry.value %}
  • {% if f.url %} {% if f.content_type and 'image' in f.content_type %}
    {{ f.filename }}
    {% endif %} {{ f.filename }} {% if f.size %}({{ f.size|filesizeformat }}){% endif %} {% else %} {{ f.filename }} {% endif %}
  • {% endfor %}
{% else %} {{ entry.value }} {% endif %}
{% if approval_step_sections and not hide_approval_history %}
Approval Step Responses
{% for section in approval_step_sections %}
{{ section.step_name }}
{% if section.status == "approved" %} ✓ Approved {% elif section.status == "rejected" %} ✗ Rejected {% endif %}
{% if section.completed_by %}
by {{ section.completed_by }}{% if section.completed_at %} · {{ section.completed_at|date:"N j, Y \a\t g:i a" }}{% endif %}
{% endif %} {% if section.comments %}

“{{ section.comments }}”

{% endif %}
{% if section.fields %}
{% for field in section.fields %} {% endfor %}
{{ field.label }} {{ field.value }}
{% endif %}
{% endfor %}
{% endif %} {% if approval_tasks %} {% if hide_approval_history %} {# ---- Privacy mode: submitter sees only the final decision ---- #}
Approval Status
{% if submission.status == 'approved' %} Approved {% if submission.completed_at %}

Decision made on {{ submission.completed_at|date:"F d, Y g:i A" }}

{% endif %} {% elif submission.status == 'rejected' %} Rejected {% if submission.completed_at %}

Decision made on {{ submission.completed_at|date:"F d, Y g:i A" }}

{% endif %} {% for task in approval_tasks %} {% if task.status == 'rejected' and task.comments %}
Reason: {{ task.comments }}
{% endif %} {% endfor %} {% else %} Under Review

Your submission is being reviewed. You will be notified when a decision is made.

{% endif %}
{% elif stage_groups %} {# ---- Staged workflow: one card per stage ---- #}
Approval History
{% for stage in stage_groups %}
{% if workflow_name_label %}{{ workflow_name_label }}{% else %}Stage {{ stage.number }}{% if not stage.has_multiple_stages %}: {{ stage.name }}{% endif %}{% endif %} {{ stage.approved_count }}/{{ stage.total_count }} approved {% if stage.rejected_count > 0 %} · {{ stage.rejected_count }} rejected{% endif %}
{% for task in stage.tasks %} {% endfor %}
Step Assigned To Status Completed By Completed At Comments
{{ task.step_display_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) {% 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 %} {% if sub_workflow_instance_stages %} {# ---- One table per sub-workflow instance, steps as rows ---- #} {% for section in sub_workflow_instance_stages %}
{{ section.label }} {{ section.approved_count }}/{{ section.total_count }} approved {% if section.rejected_count > 0 %} · {{ section.rejected_count }} rejected{% endif %}
{% for stage in section.stage_groups %} {% for task in stage.tasks %} {% endfor %} {% endfor %}
Step Assigned To Status Completed By Completed At Comments
{{ stage.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) {% 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 %} {% endif %} {% 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 %} {% if submission.status == 'rejected' or submission.status == 'withdrawn' %} {% if submission.form_definition.allow_resubmit and submission.submitter == user %} Resubmit {% endif %} {% endif %}
{% endblock %}