{% extends "base.html" %} {% block content %} {# =========================================================== BRAND DASHBOARD (brand-side users) =========================================================== #} {% if current_user.brand_id %}

Brand Dashboard

Welcome, {{ current_user.full_name or current_user.username }} · Brand: {{ current_user.brand.name if current_user.brand else 'My Brand' }}

View Campaigns View Invoices
{# Top summary cards for brand #}
Total Campaigns
{{ total_campaigns or 0 }}
{% set live_count = status_counts.get('GO_LIVE', 0) if status_counts else 0 %}
Live Campaigns
{{ live_count }}
{% set pipeline = 0 %} {% if status_counts %} {% set pipeline = status_counts.get('SCRIPTING', 0) + status_counts.get('CONTENT', 0) %} {% endif %}
In Pipeline
{{ pipeline }}
Scripting + Content phases
Creators Engaged
{{ total_creators|default(0) }}
Across all your campaigns
{# Recent campaigns + upcoming go-live #}
Recent Campaigns
View all
{% if recent_campaigns %}
{% for c in recent_campaigns %} {% endfor %}
Title Status Created Actions
{{ c.title }} {% if c.status == 'CREATE' %} {{ c.status }} {% elif c.status == 'SHORTLIST' %} {{ c.status }} {% elif c.status == 'APPROVED' %} {{ c.status }} {% elif c.status == 'SCRIPTING' %} {{ c.status }} {% elif c.status == 'CONTENT' %} {{ c.status }} {% elif c.status == 'GO_LIVE' %} {{ c.status }} {% else %} {{ c.status }} {% endif %} {{ c.created_at }} {% if c.status == 'GO_LIVE' %} Performance {% else %} Open {% endif %}
{% else %}

No campaigns yet for this brand.

{% endif %}
Upcoming Go-Live
{% if not upcoming_go_live %}

No scheduled go-live posts yet.

{% else %}
{% for c in upcoming_go_live %} {% endfor %}
Date Creator Deliverable
{{ c.go_live_date }} {{ c.creator.name }}
@{{ c.creator.handle }}
{{ c.campaign_deliverable.platform.name }} – {{ c.campaign_deliverable.deliverable_type.name }} (Unit {{ c.unit_index }})
{% endif %}
{# =========================================================== ADMIN / INTERNAL DASHBOARD (no brand_id) =========================================================== #} {% else %}

Admin Dashboard

Welcome, {{ current_user.full_name or current_user.username }}.

Campaigns
{{ total_campaigns }}
Brands
{{ total_brands }}
Creators
{{ total_creators }}
By Status
{% for s, label in { 'CREATE':'Create', 'SHORTLIST':'Shortlist', 'APPROVED':'Approved', 'SCRIPTING':'Scripting', 'CONTENT':'Content', 'GO_LIVE':'Go Live' }.items() %}
{{ label }} {{ status_counts.get(s, 0) }}
{% endfor %}
Recent Campaigns
{% if recent_campaigns %}
{% for c in recent_campaigns %} {% endfor %}
Brand Title Status Created At
{{ c.brand.name if c.brand else '-' }} {{ c.title }} {% if c.status == 'CREATE' %} {{ c.status }} {% elif c.status == 'SHORTLIST' %} {{ c.status }} {% elif c.status == 'APPROVED' %} {{ c.status }} {% elif c.status == 'SCRIPTING' %} {{ c.status }} {% elif c.status == 'CONTENT' %} {{ c.status }} {% elif c.status == 'GO_LIVE' %} {{ c.status }} {% else %} {{ c.status }} {% endif %} {{ c.created_at }}
{% else %}

No campaigns created yet.

{% endif %}
Upcoming Go-Live
{% if not upcoming_go_live %}

No scheduled go-live yet.

{% else %}
{% for c in upcoming_go_live %} {% endfor %}
Date Campaign Creator Deliverable
{{ c.go_live_date }} {{ c.campaign.title }} {{ c.creator.name }} {{ c.campaign_deliverable.platform.name }} – {{ c.campaign_deliverable.deliverable_type.name }} (Unit {{ c.unit_index }})
{% endif %}
{% endif %} {% endblock %}