diff --git a/sources/AppBundle/Controller/Admin/HomeAction.php b/sources/AppBundle/Controller/Admin/HomeAction.php index aa49551ce..534b8c69c 100644 --- a/sources/AppBundle/Controller/Admin/HomeAction.php +++ b/sources/AppBundle/Controller/Admin/HomeAction.php @@ -20,6 +20,16 @@ class HomeAction extends AbstractController { + /** + * Explications pour les tooltips des stats « ventes de places » de l'événement, + * affichées sur la carte « Inscriptions » de la home admin. + */ + private const STAT_STATUS_DESCRIPTION = "Billets « payés » uniquement — y compris via billeterie privée ou token spécial (affilié, promo…)."; + + private const STAT_EXCLUDED_DESCRIPTION = "Exclus : invitations, places sponsors, billets en attente de règlement et annulés."; + + private const STAT_MONTANT_DESCRIPTION = "Billets « payés » ou « en attente de règlement » × prix public de chaque tarif. Billet acheté à prix réduit via un token : compté au prix public."; + public function __construct( private readonly EventRepository $eventRepository, private readonly EventStatsRepository $eventStatsRepository, @@ -60,9 +70,14 @@ public function __invoke(): Response } $info['statistics'][$ticketsLabel] = $tickets; + $info['statistics_help'][$ticketsLabel] = self::STAT_STATUS_DESCRIPTION + . "\nPourcentage calculé sur la jauge de l'événement (" . $event->getSeats() . ' places).' + . "\n" . self::STAT_EXCLUDED_DESCRIPTION; } else { $info['statistics']['entrées (premier jour)'] = $stats->firstDay->paid; $info['statistics']['entrées (deuxième jour)'] = $stats->secondDay->paid; + $info['statistics_help']['entrées (premier jour)'] = self::STAT_STATUS_DESCRIPTION . "\n" . self::STAT_EXCLUDED_DESCRIPTION; + $info['statistics_help']['entrées (deuxième jour)'] = self::STAT_STATUS_DESCRIPTION . "\n" . self::STAT_EXCLUDED_DESCRIPTION; } $info['title'] = $event->getTitle(); $info['subtitle'] = 'Inscriptions'; @@ -75,6 +90,7 @@ public function __invoke(): Response } $info['statistics']['montant total'] = number_format($montantTotal, 0, ',', "\u{a0}") . "\u{a0}€"; + $info['statistics_help']['montant total'] = self::STAT_MONTANT_DESCRIPTION . "\n" . self::STAT_EXCLUDED_DESCRIPTION; $info['url'] = $this->generateUrl('admin_event_ticket_list', ['id' => $event->getId()]); $cards[] = $info; diff --git a/templates/admin/home.html.twig b/templates/admin/home.html.twig index 69453c23b..3c5592e32 100644 --- a/templates/admin/home.html.twig +++ b/templates/admin/home.html.twig @@ -24,6 +24,20 @@ min-height: 700px; width: 100%; } + + /* Icône d'aide des statistiques (le texte est dans data-tooltip, tooltip Semantic UI comme les boutons) */ + #accueil-container .ui.statistic .help.circle.icon { + margin-left: 2px; + opacity: 0.6; + } + #accueil-container .ui.statistic .help.circle.icon:hover { + opacity: 1; + } + + /* les tooltips Semantic UI rend les \n du contenu (les tooltips des boutons, sans \n, ne changent pas) */ + .ui.popup { + white-space: pre-line; + } {% if cards %}
@@ -63,7 +77,14 @@ {{ statistic }} {% endif %}
-
+
+ {% if card.statistics_help is defined and card.statistics_help[label] is defined %}{% endif %} {{ label }}