{# templates/campaigns/list.html #} {% extends "base.html" %} {% block content %} {% set is_brand_user_global = (current_user and current_user.brand_id) %}

Campaigns

Manage all campaigns, track status, and access detailed workflows.

{% if current_user and (current_user.has_permission is defined) and current_user.has_permission('campaign.create') %} Create Campaign {% endif %}
{% if current_user and (not current_user.brand_id) and (not current_user.creator_id) %}
{% endif %}
Clear
{% if not is_brand_user_global %} {% endif %} {% if not is_brand_user_global %} {% endif %} {% if not is_brand_user_global %} {% endif %} {% if campaigns %} {% for c in campaigns %} {% set st = (c.status or '') %} {% set platforms_list = [] %} {% for link in (c.platform_links or []) %} {% if link.platform and link.platform.name %} {% set _ = platforms_list.append(link.platform.name) %} {% endif %} {% endfor %} {% set val_from_quotes = value_map.get(c.id) if value_map is defined else None %} {% set display_value = val_from_quotes if (val_from_quotes is not none and (val_from_quotes|float) != 0) else (c.total_budget or 0) %} {% set computed_end = end_date_map.get(c.id) if end_date_map is defined else None %} {% set end_date = computed_end if computed_end else (c.content_usage_end if c.content_usage_end else None) %} {% set pi_cnt = pi_count_map.get(c.id, 0) if pi_count_map is defined else 0 %} {% set ti_cnt = ti_count_map.get(c.id, 0) if ti_count_map is defined else 0 %} {% set rev_dt = revenue_month_map.get(c.id) if revenue_month_map is defined else None %} {% set content_unlocked = (content_unlocked_map.get(c.id) if content_unlocked_map is defined else False) %} {% set unlocked_cnt = (content_unlocked_count_map.get(c.id, 0) if content_unlocked_count_map is defined else 0) %} {% set is_creator_user = (current_user and current_user.creator_id) %} {% set is_brand_user = (current_user and current_user.brand_id) %} {% set is_internal_user = (current_user and (not current_user.brand_id) and (not current_user.creator_id)) %} {% set can_manage = (current_user and (current_user.has_permission is defined) and current_user.has_permission('campaign.manage')) %} {% set can_view = (current_user and (current_user.has_permission is defined) and current_user.has_permission('campaign.view')) %} {% set can_invoice = (current_user and (current_user.has_permission is defined) and current_user.has_permission('invoice.manage')) %} {% set can_brand_approve = (current_user and (current_user.has_permission is defined) and current_user.has_permission('campaign.brand_approve')) %} {% set next_label = None %} {% set next_url = None %} {% set next_icon = "bi-arrow-right-circle" %} {% if is_brand_user and can_brand_approve and (current_user.brand_id == c.brand_id) %} {% if st == 'CREATE' %} {% set next_label = "Shortlist" %} {% set next_url = url_for('campaign_shortlist', campaign_id=c.id) %} {% set next_icon = "bi-list-check" %} {% elif st == 'SHORTLIST' %} {% set next_label = "Proposed Creators" %} {% set next_url = url_for('campaign_proposed_creators', campaign_id=c.id) %} {% set next_icon = "bi-people" %} {% elif st == 'APPROVED' %} {% set next_label = "Costing Approval" %} {% set next_url = url_for('campaign_brand_approval', campaign_id=c.id) %} {% set next_icon = "bi-calculator" %} {% elif st == 'SCRIPTING' %} {% set next_label = "Script Approval" %} {% set next_url = url_for('campaign_script_brand_approval', campaign_id=c.id) %} {% set next_icon = "bi-file-earmark-check" %} {% elif st == 'CONTENT' %} {% set next_label = "Content Approval" %} {% set next_url = url_for('campaign_content_brand_approval', campaign_id=c.id) %} {% set next_icon = "bi-patch-check" %} {% elif st == 'GO_LIVE' %} {% set next_label = "Go Live Ops" %} {% set next_url = url_for('campaign_go_live_ops', campaign_id=c.id) %} {% set next_icon = "bi-megaphone" %} {% elif st == 'REPORT' %} {% set next_label = "Performance Report" %} {% set next_url = url_for('campaign_performance_report', campaign_id=c.id) %} {% set next_icon = "bi-graph-up" %} {% endif %} {% elif is_internal_user %} {% if st == 'CREATE' %} {% set next_label = "Shortlist" %} {% set next_url = url_for('campaign_shortlist', campaign_id=c.id) %} {% set next_icon = "bi-list-check" %} {% elif st == 'SHORTLIST' %} {% set next_label = "Brand Approval" %} {% set next_url = url_for('campaign_brand_approval', campaign_id=c.id) %} {% set next_icon = "bi-check2-square" %} {% elif st == 'SCRIPTING' %} {% set next_label = "Script Approval" %} {% set next_url = url_for('campaign_script_brand_approval', campaign_id=c.id) %} {% set next_icon = "bi-file-earmark-check" %} {% elif st == 'CONTENT' %} {% set next_label = "Go Live Ops" %} {% set next_url = url_for('campaign_go_live_ops', campaign_id=c.id) %} {% set next_icon = "bi-megaphone" %} {% elif st == 'GO_LIVE' %} {% set next_label = "Performance Update" %} {% set next_url = url_for('campaign_performance_update', campaign_id=c.id) %} {% set next_icon = "bi-graph-up-arrow" %} {% elif st == 'REPORT' %} {% set next_label = "Performance Report" %} {% set next_url = url_for('campaign_performance_report', campaign_id=c.id) %} {% set next_icon = "bi-graph-up" %} {% elif content_unlocked %} {% set next_label = "Content" %} {% set next_url = url_for('campaign_content', campaign_id=c.id) %} {% set next_icon = "bi-collection-play" %} {% endif %} {% endif %} {% if not is_brand_user_global %} {% endif %} {% if not is_brand_user_global %} {% endif %} {% if not is_brand_user_global %} {% endif %} {% endfor %} {% else %} {% endif %}
CID Date of Creation Campaign NameBrand BIDLocation Genre Platforms Value Status End DateAssigned To BDID Campaign Brief PI TI Revenue MonthActionRemarks
{{ c.campaign_code or '-' }} {% if c.created_at and c.created_at.strftime is defined %} {{ c.created_at.strftime("%d %b %Y") }} {% else %} {{ c.created_at or '-' }} {% endif %}
{% if st %} {% endif %} {% set title_url = url_for('campaign_costing', campaign_id=c.id) %} {% if is_brand_user and can_brand_approve and (current_user.brand_id == c.brand_id) and st == 'SHORTLIST' %} {% set title_url = url_for('campaign_proposed_creators', campaign_id=c.id) %} {% endif %} {% if is_brand_user and can_brand_approve and (current_user.brand_id == c.brand_id) and st == 'APPROVED' %} {% set title_url = url_for('campaign_brand_approval', campaign_id=c.id) %} {% endif %} {{ c.title }} {% if is_internal_user and open_fetch_more_campaign_ids is defined and c.id in open_fetch_more_campaign_ids %}
More Creators Requested
{% endif %}
{{ c.brand.name if c.brand else '-' }} {{ c.brand.brand_code if c.brand and c.brand.brand_code else '-' }} {{ c.preferred_location or '-' }} {{ c.creator_genre or '-' }} {% if platforms_list %}{{ platforms_list|join(', ') }}{% else %}-{% endif %} ₹ {{ "{:,.2f}".format((display_value or 0)|float) }} {% if st == 'CREATE' %}Create {% elif st == 'SHORTLIST' %}Shortlist {% elif st == 'APPROVED' %}Approved {% elif st == 'SCRIPTING' %}Scripting {% elif st == 'CONTENT' %}Content {% elif st == 'GO_LIVE' %}Go Live {% elif st == 'REPORT' %}Report {% elif st == 'CANCELLED' %}Cancelled {% else %}{{ st or '-' }} {% endif %} {% if end_date and end_date.strftime is defined %} {{ end_date.strftime("%d %b %Y") }} {% else %} {{ end_date or '-' }} {% endif %} {% if is_internal_user and can_manage %}
{% else %} {% if c.assigned_to %} {{ c.assigned_to.full_name or c.assigned_to.username or c.assigned_to.email }} {% else %} - {% endif %} {% endif %}
- - PI: {{ pi_cnt }} TI: {{ ti_cnt }} {% if rev_dt and rev_dt.strftime is defined %} {{ rev_dt.strftime("%b %Y") }} {% else %} {{ rev_dt or '-' }} {% endif %} {% if is_creator_user %} — {% else %}
{% if is_internal_user and can_manage %} Manage {% endif %} {% if next_label and next_url %} {{ next_label }} {% if next_label == 'Content' and unlocked_cnt %} ({{ unlocked_cnt }}) {% endif %} {% endif %}
{% endif %}
-
No campaigns found.
{% endblock %}