From 7dbb738da8877ccaa92f67c285a5c6ba796f7e0d Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 4 Jul 2026 20:48:48 +0200 Subject: [PATCH] Show marketing opt-in status in admin users overview Adds a Marketing column to the admin users table and a total opt-in count in the header, so admins can see who signed up for updates on future projects. Co-Authored-By: Claude Sonnet 5 --- src/Game/Controller/GameAdminUserController.php | 5 ++++- templates/game/admin/users/index.html.twig | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Game/Controller/GameAdminUserController.php b/src/Game/Controller/GameAdminUserController.php index 1030149..fab833e 100644 --- a/src/Game/Controller/GameAdminUserController.php +++ b/src/Game/Controller/GameAdminUserController.php @@ -22,8 +22,11 @@ final class GameAdminUserController extends AbstractController #[Route('', name: 'game_admin_users', methods: ['GET'])] public function index(UserRepository $userRepository): Response { + $users = $userRepository->findBy([], ['id' => 'ASC']); + return $this->render('game/admin/users/index.html.twig', [ - 'users' => $userRepository->findBy([], ['id' => 'ASC']), + 'users' => $users, + 'marketingOptInCount' => count(array_filter($users, static fn (User $user) => $user->isMarketingOptIn())), ]); } diff --git a/templates/game/admin/users/index.html.twig b/templates/game/admin/users/index.html.twig index db650c9..115bdfc 100644 --- a/templates/game/admin/users/index.html.twig +++ b/templates/game/admin/users/index.html.twig @@ -5,7 +5,7 @@ {% block admin_body %}

Users

- {{ users|length }} total + {{ users|length }} total · {{ marketingOptInCount }} opted in to marketing
@@ -17,6 +17,7 @@ Email Roles Verified + Marketing Actions @@ -49,6 +50,13 @@ ✗ No {% endif %} + + {% if user.marketingOptIn %} + ✓ Yes + {% else %} + ✗ No + {% endif %} + No users found. + No users found. {% endfor %}