From ffc33cebc5a0205d84907e98444acf17ac7d8d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Thu, 4 Apr 2024 14:21:10 +0200 Subject: [PATCH] feat: legend of status colors in assignment overview --- src/Entity/Assignment.php | 10 +++++-- .../administrative/assignment/index.html.twig | 28 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/Entity/Assignment.php b/src/Entity/Assignment.php index 30eb21f..f52aa36 100644 --- a/src/Entity/Assignment.php +++ b/src/Entity/Assignment.php @@ -474,14 +474,20 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa return $this->availableDispositions === $this->dispositions->count(); } + public function isUnstaffed(): bool + { + return 0 === $this->dispositions->count(); + } + public function isPartlyStaffed(): bool { return $this->availableDispositions > $this->dispositions->count() - && 0 === $this->applications->count(); + && 0 < $this->dispositions->count(); } public function isStaffing(): bool { - return 0 === $this->dispositions->count() && 0 < $this->applications->count(); + return $this->availableDispositions > $this->dispositions->count() + && 0 < $this->applications->count(); } } diff --git a/templates/administrative/assignment/index.html.twig b/templates/administrative/assignment/index.html.twig index c45b901..901dc09 100644 --- a/templates/administrative/assignment/index.html.twig +++ b/templates/administrative/assignment/index.html.twig @@ -198,6 +198,34 @@ {{ knp_pagination_render(pagination) }} + +
+
+ + + + = unbesetzt +
+
+ + + + = voll besetzt +
+
+ + + + = teilweise besetzt +
+
+ + + + = in Bewerbung +
+
+ Neu