{% extends '@Communication/communication/layout.html.twig' %} {% block communication_title %}Tableau de bord Communication{% endblock %} {% block communication_header %}{% endblock %} {% set platformLabels = { linkedin: 'LinkedIn', twitter: 'X / Twitter', instagram: 'Instagram', facebook: 'Facebook', generic: 'Autre réseau' } %} {% set platformIcons = { linkedin: 'mdi:linkedin', twitter: 'ri:twitter-x-fill', instagram: 'mdi:instagram', facebook: 'mdi:facebook', generic: 'solar:global-broken' } %} {% set activityLabels = { post_created: 'Publication créée', post_updated: 'Publication mise à jour', post_submitted: 'Publication envoyée pour validation', post_approved: 'Publication approuvée', post_rejected: 'Modifications demandées', publication_scheduled: 'Publication planifiée', publication_published: 'Publication publiée', publication_failed: 'Échec de publication', campaign_created: 'Campagne créée', idea_created: 'Idée ajoutée' } %} {% block communication_content %}

Tableau de bord Communication

{{ 'now'|date('d/m/Y') }} — Bienvenue{% if app.user and app.user.prenom %}, {{ app.user.prenom }}{% endif %} 👋

Nouvelle publication
{% set kpis = [ {label:'Ce mois-ci', value:stats.thisMonth, note:'publications créées', icon:'solar:calendar-bold-duotone', tone:'purple'}, {label:'Idées', value:stats.ideas, note:'dans la boîte à idées', icon:'solar:lightbulb-bolt-bold-duotone', tone:'blue'}, {label:'À valider', value:stats.toReview, note:'en attente de décision', icon:'solar:clipboard-check-bold-duotone', tone:'pink'}, {label:'Planifiées', value:stats.scheduled, note:'à publier prochainement', icon:'solar:clock-circle-bold-duotone', tone:'amber'}, {label:'Publiées', value:stats.published, note:stats.successRate is not null ? stats.successRate ~ '% de réussite' : 'aucun envoi terminé', icon:'solar:check-circle-bold-duotone', tone:'green'}, {label:'Échecs', value:stats.failed, note:stats.failed ? 'nécessitent votre attention' : 'aucun incident', icon:'solar:danger-circle-bold-duotone', tone:'red'} ] %} {% for kpi in kpis %} {% set capsuleTone = {purple:'violet',blue:'indigo',pink:'violet',amber:'orange',green:'green',red:'red'}[kpi.tone]|default('gray') %}
{{ kpi.label }}{{ kpi.value }}{{ kpi.note }}
{% endfor %}

Publications du jour

{{ stats.todayPublications|length }} publication{{ stats.todayPublications|length > 1 ? 's' }}
{% for publication in stats.todayPublications %} {{ publication.post.internalTitle }}Planifiée à {{ publication.scheduledAt|date('H:i') }} {% else %}
Aucune publication prévue aujourd’hui.
{% endfor %}

En attente de validation

{{ stats.approvals|length }} demande{{ stats.approvals|length > 1 ? 's' }}
{% for approval in stats.approvals %}
{{ approval.post.internalTitle }} Demandée{% if approval.requestedBy %} par {{ approval.requestedBy }}{% endif %} · {{ approval.requestedAt|date('d/m à H:i') }}
{% if is_granted('COMMUNICATION_POST_APPROVE', approval.post) %}
{% endif %} Examiner
{% else %}
Aucune validation en attente.
{% endfor %}

Comptes connectés

Gérer

Activité éditoriale

Publications des 7 derniers jours
PlanifiéesPubliées

Cette semaine

Tout voir
{% for day in stats.weekDays %}
{{ day.label }}{{ day.date|date('d') }}{% if day.count %}{% endif %}
{% endfor %}

À venir

{% for publication in stats.weekPublications|slice(0, 3) %} {{ publication.post.internalTitle }}{{ publication.scheduledAt|date('d/m/Y · H:i') }} {% else %}

Aucune publication planifiée cette semaine.

{% endfor %}

Campagnes

{{ stats.campaignList|length }} affichée{{ stats.campaignList|length > 1 ? 's' }}

Brouillons

{{ stats.drafts|length }} brouillon{{ stats.drafts|length > 1 ? 's' }}
{% for post in stats.drafts %} {{ post.internalTitle }}Modifié le {{ post.updatedAt|date('d/m/Y à H:i') }} {% else %}
Aucun brouillon.
{% endfor %} Nouveau brouillon

Planifiées cette semaine

{{ stats.weekPublications|length }} publication{{ stats.weekPublications|length > 1 ? 's' }}

Publications récentes

Tout voir
{% for publication in stats.recentPublications %} {{ loop.index }}{{ publication.post.internalTitle }}Publiée le {{ publication.publishedAt|date('d/m/Y à H:i') }} {% else %}
Aucune publication récente.
{% endfor %}

Idées à développer

{{ stats.ideaList|length }} idée{{ stats.ideaList|length > 1 ? 's' }}
{% for idea in stats.ideaList %} {{ idea.title }} {% else %}
Aucune idée à développer.
{% endfor %}
Créer une nouvelle idée

Activité récente

{% for log in stats.activity %}
{{ activityLabels[log.eventType]|default(log.message ?: 'Action de communication') }}{% if log.message and activityLabels[log.eventType]|default(null) %}{{ log.message }}{% endif %}
{% else %}
Aucune activité récente.
{% endfor %}
{% if stats.activeAccount %} {% else %} {% endif %}
{% endblock %}