feat: show recognition photo on photo management page
Some checks are pending
CI / test (push) Waiting to run
Some checks are pending
CI / test (push) Waiting to run
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 <noreply@anthropic.com>
This commit is contained in:
parent
f1d3ee6b1e
commit
59b34a780e
2 changed files with 38 additions and 0 deletions
|
|
@ -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,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,30 @@
|
|||
|
||||
<div class="row g-4">
|
||||
|
||||
{# ── Search / recognition photo (read-only) ────────────────────────── #}
|
||||
{% if searchPhotoFilename %}
|
||||
<div class="col-12">
|
||||
<div class="card border-secondary">
|
||||
<div class="card-header bg-secondary bg-opacity-10 d-flex align-items-center gap-2">
|
||||
<i class="fa fa-search text-secondary"></i>
|
||||
<span class="fw-semibold">Erkennungs-Foto</span>
|
||||
<span class="text-muted small">(vom KI-Pipeline-Einlesen — unveränderlich)</span>
|
||||
</div>
|
||||
<div class="card-body d-flex align-items-center gap-4">
|
||||
<img src="{{ path('admin_photo_serve', {filename: searchPhotoFilename}) }}"
|
||||
alt="Erkennungs-Foto"
|
||||
class="rounded border"
|
||||
style="max-height:160px;max-width:200px;object-fit:contain;">
|
||||
<div class="text-muted small">
|
||||
<i class="fa fa-info-circle me-1"></i>
|
||||
Dieses Foto wurde beim Einlesen für die KI-Erkennung (Typenschild) verwendet.
|
||||
Es kann hier nicht geändert werden.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# ── Current photos ────────────────────────────────────────────────── #}
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
|
|
|
|||
Loading…
Reference in a new issue