Skip to content

Commit bc60891

Browse files
committed
BO : tooltip explicatif sur les chiffres de vente de la home admin
1 parent 7992d91 commit bc60891

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

‎sources/AppBundle/Controller/Admin/HomeAction.php‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020

2121
class HomeAction extends AbstractController
2222
{
23+
/**
24+
* Explications pour les tooltips des stats « ventes de places » de l'événement,
25+
* affichées sur la carte « Inscriptions » de la home admin.
26+
*/
27+
private const STAT_STATUS_DESCRIPTION = "Billets « payés » uniquement — y compris via billeterie privée ou token spécial (affilié, promo…).";
28+
29+
private const STAT_EXCLUDED_DESCRIPTION = "Exclus : invitations, places sponsors, billets en attente de règlement et annulés.";
30+
31+
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.";
32+
2333
public function __construct(
2434
private readonly EventRepository $eventRepository,
2535
private readonly EventStatsRepository $eventStatsRepository,
@@ -60,9 +70,14 @@ public function __invoke(): Response
6070
}
6171

6272
$info['statistics'][$ticketsLabel] = $tickets;
73+
$info['statistics_help'][$ticketsLabel] = self::STAT_STATUS_DESCRIPTION
74+
. "\nPourcentage calculé sur la jauge de l'événement (" . $event->getSeats() . ' places).'
75+
. "\n" . self::STAT_EXCLUDED_DESCRIPTION;
6376
} else {
6477
$info['statistics']['entrées (premier jour)'] = $stats->firstDay->paid;
6578
$info['statistics']['entrées (deuxième jour)'] = $stats->secondDay->paid;
79+
$info['statistics_help']['entrées (premier jour)'] = self::STAT_STATUS_DESCRIPTION . "\n" . self::STAT_EXCLUDED_DESCRIPTION;
80+
$info['statistics_help']['entrées (deuxième jour)'] = self::STAT_STATUS_DESCRIPTION . "\n" . self::STAT_EXCLUDED_DESCRIPTION;
6681
}
6782
$info['title'] = $event->getTitle();
6883
$info['subtitle'] = 'Inscriptions';
@@ -75,6 +90,7 @@ public function __invoke(): Response
7590
}
7691

7792
$info['statistics']['montant total'] = number_format($montantTotal, 0, ',', "\u{a0}") . "\u{a0}€";
93+
$info['statistics_help']['montant total'] = self::STAT_MONTANT_DESCRIPTION . "\n" . self::STAT_EXCLUDED_DESCRIPTION;
7894
$info['url'] = $this->generateUrl('admin_event_ticket_list', ['id' => $event->getId()]);
7995

8096
$cards[] = $info;

‎templates/admin/home.html.twig‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@
2424
min-height: 700px;
2525
width: 100%;
2626
}
27+
28+
/* Sortie visuelle de l'icône d'aide des statistiques (le texte est dans l'attribut title, tooltip natif du navigateur) */
29+
#accueil-container .ui.statistic .help.circle.icon {
30+
margin-left: 2px;
31+
opacity: 0.6;
32+
}
33+
#accueil-container .ui.statistic .help.circle.icon:hover {
34+
opacity: 1;
35+
}
2736
</style>
2837
{% if cards %}
2938
<div class="ui basic right aligned segment" id="accueil-container">
@@ -63,7 +72,12 @@
6372
{{ statistic }}
6473
{% endif %}
6574
</div>
66-
<div class="label">
75+
<div class="label"
76+
{% if card.statistics_help is defined and card.statistics_help[label] is defined %}
77+
title="{{ card.statistics_help[label] }}"
78+
{% endif %}
79+
>
80+
{% if card.statistics_help is defined and card.statistics_help[label] is defined %}<i class="help circle outline icon"></i>{% endif %}
6781
{{ label }}
6882
</div>
6983
</div>

0 commit comments

Comments
 (0)