Hide the "In Development" banner once a game is open

The badge on the homepage and briefing page was static markup, wired
to nothing - flipping a game's status to open in the admin panel had
no effect on it. It's now driven by GameRepository::hasOpenGame() and
only shows while every game is still in development/locked.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Frank
2026-08-28 20:19:00 +02:00
co-authored by Claude Sonnet 5
parent 996087ec4e
commit 4daaa8d102
4 changed files with 19 additions and 6 deletions
+6
View File
@@ -3,6 +3,7 @@
namespace App\Game\Repository;
use App\Game\Entity\Game;
use App\Game\Enum\GameStatus;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
@@ -15,4 +16,9 @@ class GameRepository extends ServiceEntityRepository
{
parent::__construct($registry, Game::class);
}
public function hasOpenGame(): bool
{
return $this->count(['status' => GameStatus::OPEN]) > 0;
}
}
+7 -4
View File
@@ -3,6 +3,7 @@ declare(strict_types=1);
namespace App\Website\Controller;
use App\Game\Repository\GameRepository;
use App\Game\Service\FeedbackService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
@@ -11,17 +12,19 @@ use Symfony\Component\Routing\Annotation\Route;
final class HomeController extends AbstractController
{
#[Route(path: '', name: 'website_home')]
public function index(): Response
public function index(GameRepository $gameRepository): Response
{
return $this->render(
'website/home/index.html.twig');
return $this->render('website/home/index.html.twig', [
'showDevBanner' => !$gameRepository->hasOpenGame(),
]);
}
#[Route(path: '/briefing', name: 'website_intro')]
public function intro(FeedbackService $feedbackService): Response
public function intro(FeedbackService $feedbackService, GameRepository $gameRepository): Response
{
return $this->render('website/home/intro.html.twig', [
'feedbackSummary' => $feedbackService->getFeedbackSummary(),
'showDevBanner' => !$gameRepository->hasOpenGame(),
]);
}