feat: improved teamer status label in overview
This commit is contained in:
+20
-2
@@ -25,9 +25,27 @@ class AppRuntime implements RuntimeExtensionInterface
|
|||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function teamerStatusLabel(string $status): string
|
public function teamerStatusLabel(Teamer $teamer): string
|
||||||
{
|
{
|
||||||
if (Teamer::STATUS_NEW === $status) {
|
$labelItems = [];
|
||||||
|
|
||||||
|
if ($teamer->getUser()->hasRole('ROLE_ADMIN')) {
|
||||||
|
$labelItems[] = 'Admin';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($teamer->getUser()->hasRole('ROLE_MANAGER')) {
|
||||||
|
$labelItems[] = 'Reisemanagement';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($teamer->getUser()->hasRole('ROLE_HOUSE_MANAGER')) {
|
||||||
|
$labelItems[] = 'Hausleitung';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0 < count($labelItems)) {
|
||||||
|
return implode(', ', $labelItems);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Teamer::STATUS_NEW === $teamer->getStatus()) {
|
||||||
return 'Neuteamer:in';
|
return 'Neuteamer:in';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
Status:
|
Status:
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{ teamer.status|teamer_status_label }}
|
{{ teamer|teamer_status_label }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ teamer.status|teamer_status_label }}
|
{{ teamer|teamer_status_label }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ teamer.communication.email }}
|
{{ teamer.communication.email }}
|
||||||
|
|||||||
Reference in New Issue
Block a user