{% extends "base.html" %} {% block title %}تفاصيل الحملة - {{ ad_camp.name }}{% endblock %} {% block content %}

{{ ad_camp.name }}

← قائمة الحملات
{% if ad_camp.status == 'pending_approval' %}في انتظار المراجعة {% elif ad_camp.status == 'approved' %}معتمدة {% elif ad_camp.status == 'active' %}نشطة {% elif ad_camp.status == 'paused' %}متوقفة {% elif ad_camp.status == 'completed' %}مكتملة {% elif ad_camp.status == 'rejected' %}مرفوضة {% else %}{{ ad_camp.status }}{% endif %}

معلومات الحملة

المستخدم{{ ad_camp.user.name if ad_camp.user else 'N/A' }}
البريد{{ ad_camp.user.email if ad_camp.user else '' }}
الميزانية${{ "%.2f"|format(ad_camp.budget_amount) }}
الميزانية اليومية${{ "%.2f"|format(ad_camp.daily_budget) }}
المدة{{ ad_camp.duration_days }} يوم
تاريخ الإنشاء{{ ad_camp.created_at.strftime('%Y-%m-%d %H:%M') }}
المنصات
{% for p in ad_camp.platforms_list %}{{ p }}{% endfor %}
{% if ad_camp.ad_caption %}
نص الإعلان{{ ad_camp.ad_caption }}
{% endif %} {% if ad_camp.ad_cta %}
CTA{{ ad_camp.ad_cta }}
{% endif %}

الاستهداف

{% if ad_camp.targeting_json %}
{% set t = ad_camp.targeting_json %}
العمر{{ t.get('age_min', '?') }} - {{ t.get('age_max', '?') }}
الجنس{{ t.get('gender', 'all') }}
المناطق
{% for loc in t.get('locations', []) %}{{ loc }}{% endfor %}
الاهتمامات
{% for i in t.get('interests', []) %}{{ i }}{% endfor %}
{% if t.get('budget_split') %}
توزيع الميزانية {% for plat, pct in t.get('budget_split', {}).items() %}
{{ plat }}{{ pct }}%
{% endfor %}
{% endif %}
{% else %}

لا يوجد استهداف محدد

{% endif %} {% if ad_camp.ai_suggestions_json %}
اقتراحات AI
{% if ad_camp.ai_suggestions_json.get('reasoning') %}

{{ ad_camp.ai_suggestions_json.reasoning }}

{% endif %} {% for w in ad_camp.ai_suggestions_json.get('warnings', []) %}

⚠ {{ w }}

{% endfor %}
{% endif %}
{% if ad_camp.campaign and ad_camp.campaign.video_url %}

الفيديو

{% endif %} {% if ad_camp.status == 'pending_approval' %}

تعديل قبل الاعتماد

✓ اعتماد الحملة

✕ رفض الحملة

{% endif %} {% if ad_camp.status == 'rejected' and ad_camp.rejection_reason %}

سبب الرفض

{{ ad_camp.rejection_reason }}

{% if ad_camp.reviewer %}

بواسطة: {{ ad_camp.reviewer.name }} | {{ ad_camp.reviewed_at.strftime('%Y-%m-%d %H:%M') if ad_camp.reviewed_at else '' }}

{% endif %}
{% endif %}

سجل العمليات

{% for log in ad_camp.audit_logs.order_by(ad_camp.audit_logs._entity_zero().entity.audit_logs.property.mapper.class_.created_at.desc()) if false %} {% endfor %} {% for log in ad_camp.audit_logs %}
{{ log.action }} {{ log.created_at.strftime('%Y-%m-%d %H:%M') }} {% if log.admin %}بواسطة: {{ log.admin.name }}{% endif %}
{% else %}

لا توجد عمليات مسجلة

{% endfor %}
{% endblock %}