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

Script Approval – {{ campaign.title }}

Brand review of all submitted scripts. Approve or request changes per unit. Approved creators can move to Content while others remain in Scripting.

{# Force recompute phases (upgrade only) #} {% if current_user and (current_user.has_permission is defined) and current_user.has_permission('campaign.manage') %}
{% endif %} Back to Scripting
{# ------------------------- Filter out removed creators in the UI ------------------------- #} {% set visible_scripts = [] %} {% for s in scripts %} {% set link = creator_links.get(s.creator_id) if creator_links is defined and creator_links else None %} {% if not link or not link.is_removed %} {% set _ = visible_scripts.append(s) %} {% endif %} {% endfor %}
Campaign Status: {{ campaign.status }}
{% set total_units = visible_scripts|length %} {% set total_approved = visible_scripts | selectattr("status","equalto","APPROVED") | list | length %} {% set total_remaining = total_units - total_approved %}
Total Script Units: {{ total_units }}
Approved: {{ total_approved }}
Pending: {{ total_remaining }}
{% if read_only %} Read-only (Go Live / Report) {% else %} Editable {% endif %}
{% set last_creator_id = namespace(v=None) %} {% for s in visible_scripts %} {% if last_creator_id.v != s.creator_id %} {% set last_creator_id.v = s.creator_id %} {% set link = creator_links.get(s.creator_id) if creator_links is defined and creator_links else None %} {% set phase_raw = (link.phase if link and link.phase else '') %} {% set phase = (phase_raw|string)|upper %} {# --- Per Creator Script Stats --- #} {% set creator_scripts = visible_scripts | selectattr("creator_id", "equalto", s.creator_id) | list %} {% set total_units = creator_scripts | length %} {% set approved_units = creator_scripts | selectattr("status", "equalto", "APPROVED") | list | length %} {% set changes_units = creator_scripts | selectattr("status", "equalto", "CHANGES_REQUESTED") | list | length %} {% set pending_units = total_units - approved_units - changes_units %} {# --- Upload Stats (to show "No scripts uploaded yet") --- #} {% set uploaded_text_units = creator_scripts | selectattr("script_text") | list | length %} {% set uploaded_file_units = creator_scripts | selectattr("script_file") | list | length %} {% set uploaded_any = uploaded_text_units + uploaded_file_units %} {% endif %} {% endfor %}
Creator Deliverable Platform Unit # Script (Text / File) Brand Status Brand Comment
{{ s.creator.name }} @{{ s.creator.handle }}
{{ approved_units }}/{{ total_units }} Approved {% if uploaded_any == 0 %} No scripts uploaded yet {% endif %} {% if changes_units > 0 %} {{ changes_units }} Changes {% endif %} {% if pending_units > 0 %} {{ pending_units }} Pending {% endif %} {% if approved_units == total_units %} Fully Approved {% endif %} {% if phase %} Phase: {{ phase }} {% endif %} {% if phase == 'CONTENT' %} Moved to Content {% endif %}
{{ s.creator.name }}
@{{ s.creator.handle }}
{{ s.campaign_deliverable.deliverable_type.name }} {{ s.campaign_deliverable.platform.name }} Unit {{ s.unit_index }} {% if s.script_text %}
{{ s.script_text }}
{% endif %} {% if s.script_file %} Download script file {% elif not s.script_text %} No script uploaded yet {% endif %}
{% set st = s.status %} {% if read_only %} {{ st }} {% else %} {% endif %} {% if read_only %}
{{ s.brand_comment or '—' }}
{% else %} {% endif %}
Use Changes Requested to send scripts back for revision.
{% if not read_only %} {% endif %}
{% endblock %}