From 59b34a780e277ee5f540bd59ef0a33952a14bb2c Mon Sep 17 00:00:00 2001 From: Simon Kuehn Date: Tue, 19 May 2026 16:00:53 +0000 Subject: [PATCH] feat: show recognition photo on photo management page Displays the original pipeline search photo (storedPhotoPath from AIPipelineJob input_data) as a read-only card above the editable photos. The photo is fetched only if the file still exists on disk. Co-Authored-By: Claude Sonnet 4.6 --- .../Admin/PhotoManagementController.php | 14 +++++++++++ templates/admin/photo_management.html.twig | 24 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/src/Infrastructure/Http/Controller/Admin/PhotoManagementController.php b/src/Infrastructure/Http/Controller/Admin/PhotoManagementController.php index 4a9ec1e..cbc4874 100644 --- a/src/Infrastructure/Http/Controller/Admin/PhotoManagementController.php +++ b/src/Infrastructure/Http/Controller/Admin/PhotoManagementController.php @@ -7,6 +7,7 @@ namespace App\Infrastructure\Http\Controller\Admin; use App\Application\Article\PhotoService; use App\Domain\Article\Repository\ArticlePhotoRepositoryInterface; use App\Domain\Article\Repository\ArticleRepositoryInterface; +use App\Domain\Pipeline\Repository\AIPipelineJobRepositoryInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -23,6 +24,7 @@ final class PhotoManagementController extends AbstractController private readonly ArticleRepositoryInterface $articleRepository, private readonly ArticlePhotoRepositoryInterface $photoRepository, private readonly PhotoService $photoService, + private readonly AIPipelineJobRepositoryInterface $jobRepository, ) { } @@ -36,9 +38,21 @@ final class PhotoManagementController extends AbstractController $photos = $this->photoRepository->findByArticle(Uuid::fromString($id)); + $searchPhotoFilename = null; + $job = $this->jobRepository->findByArticleId(Uuid::fromString($id)); + if (null !== $job) { + $storedPath = \is_string($job->getInputData()['storedPhotoPath'] ?? null) + ? $job->getInputData()['storedPhotoPath'] + : ''; + if ('' !== $storedPath && file_exists($storedPath)) { + $searchPhotoFilename = basename($storedPath); + } + } + return $this->render('admin/photo_management.html.twig', [ 'article' => $article, 'photos' => $photos, + 'searchPhotoFilename' => $searchPhotoFilename, ]); } diff --git a/templates/admin/photo_management.html.twig b/templates/admin/photo_management.html.twig index 604e756..5f5308a 100644 --- a/templates/admin/photo_management.html.twig +++ b/templates/admin/photo_management.html.twig @@ -27,6 +27,30 @@
+ {# ── Search / recognition photo (read-only) ────────────────────────── #} + {% if searchPhotoFilename %} +
+
+
+ + Erkennungs-Foto + (vom KI-Pipeline-Einlesen — unveränderlich) +
+
+ Erkennungs-Foto +
+ + Dieses Foto wurde beim Einlesen für die KI-Erkennung (Typenschild) verwendet. + Es kann hier nicht geändert werden. +
+
+
+
+ {% endif %} + {# ── Current photos ────────────────────────────────────────────────── #}