{# templates/dashboard.html #} {% extends "base.html" %} {% block content %} {# =========================================================== BRAND DASHBOARD (brand-side users) =========================================================== #} {% if current_user.brand_id %}
Welcome, {{ current_user.full_name or current_user.username }} · Brand: {{ current_user.brand.name if current_user.brand else 'My Brand' }}
| ID | Title | Status | Created | Action |
|---|---|---|---|---|
| #{{ c.id }} | {{ c.title }} | {% set st = c.status %} {% if st == 'CREATE' %}{{ st }} {% elif st == 'SHORTLIST' %}{{ st }} {% elif st == 'APPROVED' %}{{ st }} {% elif st == 'SCRIPTING' %}{{ st }} {% elif st == 'CONTENT' %}{{ st }} {% elif st == 'GO_LIVE' %}{{ st }} {% elif st == 'REPORT' %}{{ st }} {% else %}{{ st }} {% endif %} | {{ c.created_at }} | {# FIXED: Proper routing per status #} {% if c.status == 'SHORTLIST' %} Brand Approval {% elif c.status == 'SCRIPTING' %} Script Approval {% elif c.status in ['CONTENT','GO_LIVE','REPORT'] %} Content Approval {% else %} Open {% endif %} |
No campaigns found for your filters.
{% endif %}| Title | Status | Created | Actions |
|---|---|---|---|
| {{ c.title }} | {{ c.status }} | {{ c.created_at }} | Open |
No campaigns yet for this brand.
{% endif %}No scheduled go-live posts yet.
{% else %}| 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 }}) |
Welcome, {{ current_user.full_name or current_user.username }}.
No scheduled go-live items yet.
{% else %}| Date | Campaign | Deliverable |
|---|---|---|
| {{ row.go_live_date }} | {{ row.campaign.title if row.campaign else '-' }} | {{ row.campaign_deliverable.platform.name }} – {{ row.campaign_deliverable.deliverable_type.name }} (Unit {{ row.unit_index }}) |
Welcome, {{ current_user.full_name or current_user.username }}.
No pending invoices older than 7 days.
{% else %}| Invoice | Brand | Total | Paid | Balance | Status | Created |
|---|---|---|---|---|---|---|
| {{ inv.invoice_number }} | {{ inv.brand.name if inv.brand else '-' }} | ₹ {{ "{:,.2f}".format((inv.total_amount or 0)|float) }} | ₹ {{ "{:,.2f}".format((inv.amount_paid or 0)|float) }} | ₹ {{ "{:,.2f}".format((inv.balance_amount or 0)|float) }} | {% set ps = inv.payment_status %} {% if ps == 'UNPAID' %} UNPAID {% elif ps == 'PARTIAL' %} PARTIAL {% else %} {{ ps }} {% endif %} | {{ inv.created_at }} |
No data.
{% else %}| Ops | Campaigns | Value (Budget) |
|---|---|---|
|
{{ row.full_name or ('User #' ~ row.user_id) }}
OpsID: {{ row.user_id }}
|
{{ row.campaigns or 0 }} | ₹ {{ "{:,.2f}".format((row.value_sum or 0)|float) }} |
| Brand | Title | Status | Created |
|---|---|---|---|
| {{ c.brand.name if c.brand else '-' }} | {{ c.title }} | {{ c.status }} | {{ c.created_at }} |
No campaigns found for filters.
{% endif %}No invoice data.
{% else %}| Brand | Invoices | Revenue |
|---|---|---|
| {{ b.name }} | {{ b.invoices or 0 }} | ₹ {{ "{:,.2f}".format((b.revenue or 0)|float) }} |
No scheduled go-live yet.
{% else %}| 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 }}) |