Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions sources/AppBundle/Controller/Admin/HomeAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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…).";

Check failure on line 27 in sources/AppBundle/Controller/Admin/HomeAction.php

View workflow job for this annotation

GitHub Actions / PHPStan

Out of 212 possible constant types, only 209 - 98.5 % actually have it. Add more constant types to get over 100 %

private const STAT_EXCLUDED_DESCRIPTION = "Exclus : invitations, places sponsors, billets en attente de règlement et annulés.";

Check failure on line 29 in sources/AppBundle/Controller/Admin/HomeAction.php

View workflow job for this annotation

GitHub Actions / PHPStan

Out of 212 possible constant types, only 209 - 98.5 % actually have it. Add more constant types to get over 100 %

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.";

Check failure on line 31 in sources/AppBundle/Controller/Admin/HomeAction.php

View workflow job for this annotation

GitHub Actions / PHPStan

Out of 212 possible constant types, only 209 - 98.5 % actually have it. Add more constant types to get over 100 %

public function __construct(
private readonly EventRepository $eventRepository,
private readonly EventStatsRepository $eventStatsRepository,
Expand Down Expand Up @@ -59,10 +69,15 @@
$ticketsLabel = "entrées ($percentage%)";
}

$info['statistics'][$ticketsLabel] = $tickets;

Check failure on line 72 in sources/AppBundle/Controller/Admin/HomeAction.php

View workflow job for this annotation

GitHub Actions / PHPStan

Ignored error pattern #^Cannot access offset non\-falsy\-string on mixed\.$# (offsetAccess.nonOffsetAccessible) in path /home/runner/work/web/web/sources/AppBundle/Controller/Admin/HomeAction.php is expected to occur 1 time, but occurred 2 times.
$info['statistics_help'][$ticketsLabel] = self::STAT_STATUS_DESCRIPTION

Check failure on line 73 in sources/AppBundle/Controller/Admin/HomeAction.php

View workflow job for this annotation

GitHub Actions / PHPStan

Cannot access offset non-falsy-string on mixed.
. "\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;

Check failure on line 77 in sources/AppBundle/Controller/Admin/HomeAction.php

View workflow job for this annotation

GitHub Actions / PHPStan

Ignored error pattern #^Cannot access offset 'entrées \(premier jour\)' on mixed\.$# (offsetAccess.nonOffsetAccessible) in path /home/runner/work/web/web/sources/AppBundle/Controller/Admin/HomeAction.php is expected to occur 1 time, but occurred 2 times.
$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;

Check failure on line 79 in sources/AppBundle/Controller/Admin/HomeAction.php

View workflow job for this annotation

GitHub Actions / PHPStan

Cannot access offset 'entrées (premier jour)' on mixed.
$info['statistics_help']['entrées (deuxième jour)'] = self::STAT_STATUS_DESCRIPTION . "\n" . self::STAT_EXCLUDED_DESCRIPTION;
}
$info['title'] = $event->getTitle();
$info['subtitle'] = 'Inscriptions';
Expand All @@ -75,6 +90,7 @@
}

$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;
Expand Down
23 changes: 22 additions & 1 deletion templates/admin/home.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
</style>
{% if cards %}
<div class="ui basic right aligned segment" id="accueil-container">
Expand Down Expand Up @@ -63,7 +77,14 @@
{{ statistic }}
{% endif %}
</div>
<div class="label">
<div class="label"
{% if card.statistics_help is defined and card.statistics_help[label] is defined %}
data-tooltip="{{ card.statistics_help[label] }}"
data-position="top center"
data-variation="wide"
{% endif %}
>
{% if card.statistics_help is defined and card.statistics_help[label] is defined %}<i class="help circle outline icon"></i>{% endif %}
{{ label }}
</div>
</div>
Expand Down
Loading