From c7084b92ddd619bf3d384ae6c3738a3704643be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 19 Apr 2024 16:14:36 +0200 Subject: [PATCH] fix: avoid document name exceeding card width --- src/Entity/Upload.php | 12 ++++++++++++ templates/admin/index.html.twig | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Entity/Upload.php b/src/Entity/Upload.php index 9987b41..f4b1810 100644 --- a/src/Entity/Upload.php +++ b/src/Entity/Upload.php @@ -113,6 +113,18 @@ class Upload implements BlameableEntityInterface, TimestampableEntityInterface return $this; } + public function getTypeLabel(): string + { + return match($this->getType()) { + self::TYPE_PHOTO => 'Foto', + self::TYPE_CERTIFICATE => 'Lizenz', + self::TYPE_CONTRACT => 'Honorarvertrag', + self::TYPE_INVOICE => 'Honorarnote', + self::TYPE_DOCUMENT => 'Info', + default => 'Dokument', + }; + } + public function getStatus(): ?string { return $this->status; diff --git a/templates/admin/index.html.twig b/templates/admin/index.html.twig index 87fa392..425c8ee 100644 --- a/templates/admin/index.html.twig +++ b/templates/admin/index.html.twig @@ -56,7 +56,7 @@ {{ icon('download', 'w-4 h-4 shrink-0') }} {{ document.owner.teamer.fullName(true) }} {% include '_partials/_dot.html.twig' %} - {{ document.originalFilename }} + {{ document.typeLabel }} {% else %}