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

Review Submission

{% if workflow_mode != "none" %}
Approval Progress
{% if workflow_mode == "staged" %} {# ---- staged pipeline ---- #}
{% for stage in approval_stages %}
{% if stage.is_completed %} {% elif stage.is_rejected %} {% else %}{{ stage.number }}{% endif %}
{{ stage.name }}
{% if stage.approval_logic == "all" %}All must approve {% elif stage.approval_logic == "any" %}Any can approve {% else %}Sequential{% endif %} {% if stage.total_count > 0 %}
{{ stage.approved_count }}/{{ stage.total_count }} approved{% endif %}
{% if not forloop.last %}
{% endif %} {% endfor %}
{% if current_stage_number and total_stages %}

Stage {{ current_stage_number }} of {{ total_stages }}

{% endif %} {% elif workflow_mode == "sequence" %} {# ---- sequential legacy ---- #}
{% for step in approval_steps %}
{% if step.is_completed %} {% elif step.is_rejected %} {% else %}{{ step.number }}{% endif %}
{{ step.group_name }}
{% if not forloop.last %}
{% endif %} {% endfor %}
{% elif workflow_mode == "all" or workflow_mode == "any" %} {# ---- parallel legacy (all/any) ---- #} {% if workflow_mode == "all" %}

All groups listed below must approve this submission.

{% else %}

Any one of the groups below can approve this submission.

{% endif %}
{% for pt in parallel_tasks %}
{% if pt.task.status == 'approved' %} {% elif pt.task.status == 'rejected' %} {% else %}{% endif %}
{{ pt.group_name }}
{% endfor %}
{% endif %}
{% endif %}
Submission Information

Form: {{ submission.form_definition.name }}

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

Email: {{ submission.submitter.email }}

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

Status: {{ submission.get_status_display }}

{% if workflow_mode == "staged" and current_stage_number and total_stages %}

Current Stage: {{ current_stage_number }} of {{ total_stages }}

{% elif workflow_mode == "sequence" and current_step_number and total_steps %}

Current Step: {{ current_step_number }} of {{ total_steps }}

{% endif %}
{% if has_approval_step_fields and approval_step_form %}
Submission Data
{% for entry in form_data_ordered %} {% if entry.key not in approval_field_names %} {% endif %} {% endfor %}
{{ entry.label }} {% if entry.value.url %} {% if entry.value.content_type and 'image' in entry.value.content_type %} {{ entry.value.filename }} {% endif %} {{ entry.value.filename }} {% elif entry.value.path %} {{ entry.value.filename }} {% else %} {{ entry.value }} {% endif %}
{% for step in approval_steps %} {% if step.is_completed %}
Step {{ step.number }}: {{ step.group_name }} Completed
{% for field_info in step.fields %} {% with field_name=field_info.field_name %} {% if field_name in form_data %} {% endif %} {% endwith %} {% empty %} {% endfor %}
{{ field_info.field_label }} {{ form_data|get_item:field_name }}
No fields recorded for this step.
{% endif %} {% endfor %}
{% csrf_token %}
Step {{ current_step_number }}: {{ task.step_name }} Your Action Required

Please review the submission above and fill in the required fields below.

{{ approval_step_form|crispy }}
Your Decision
Back
{% for step in approval_steps %} {% if step.number > current_step_number %}
Step {{ step.number }}: {{ step.group_name }} Pending

This step will be available after all previous steps are approved.

{% endif %} {% endfor %} {% else %}
Submission Data
{% for entry in form_data_ordered %} {% endfor %}
{{ entry.label }} {% if entry.value.url %} {# File upload with URL - display as image or link #} {% 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 %} {# File upload with path but no URL #} {{ entry.value.filename }} (File stored but URL unavailable) {% else %} {{ entry.value }} {% endif %}
Your Decision
{% csrf_token %}
Back
{% endif %}
{% endblock %}