chore: refactor menu building

This commit is contained in:
Björn Fromme committed 2024-02-07 11:53:07 +01:00
1 parent 0b1dd73902
commit 1ab36e6ce5
6 files changed
+349 -323

No files matched your search

+89 -76
View File
@@ -8,97 +8,110 @@ class TeamerMenuBuilder extends AbstractMenuBuilder
{
public function createMainMenu(array $options): ItemInterface
{
$menuItems = [
[
'route' => 'app_teamer_index',
$menu = $this->createRootElement();
$menu->addChild('Dashboard', [
'route' => 'app_teamer_index',
'linkAttributes' => [
'title' => 'Dashboard',
],
'extras' => [
'icon' => 'chart',
],
[
'route' => 'app_teamer_assignment_index',
]);
$menu->addChild('Einsatzübersicht', [
'route' => 'app_teamer_assignment_index',
'linkAttributes' => [
'title' => 'Einsatzübersicht',
],
'extras' => [
'icon' => 'calendar',
'hideChildren' => true,
'children' => [
[
'route' => 'app_teamer_assignment_detail',
'title' => 'Einsatzdetails',
'routeParameters' => $this->getDefaultRouteParameters('uuid'),
]
'routes' => [
['pattern' => '/^app_teamer_assignment_/']
],
],
[
'route' => false,
'title' => 'Mein Profil',
]);
$profileMenu = $menu->addChild('Mein Profil', [
'extras' => [
'icon' => 'profile',
'children' => [
[
'route' => 'app_teamer_profile_index',
'title' => 'Stammdaten und Foto',
],
[
'route' => 'app_teamer_profile_skills',
'title' => 'Jobprofile & Skills',
],
[
'route' => 'app_teamer_profile_availability_index',
'title' => 'Meine Verfügbarkeit',
],
],
],
[
'route' => false,
'title' => 'Meine Einsätze',
]);
$profileMenu->addChild('Stammdaten & Foto', [
'route' => 'app_teamer_profile_index',
'linkAttributes' => [
'title' => 'Stammdaten & Foto',
],
]);
$profileMenu->addChild('Jobprofile & Skills', [
'route' => 'app_teamer_profile_skills',
'linkAttributes' => [
'title' => 'Jobprofile & Skills',
],
]);
$profileMenu->addChild('Meine Verfügbarkeit', [
'route' => 'app_teamer_profile_availability_index',
'linkAttributes' => [
'title' => 'Meine Verfügbarkeit',
],
]);
$dispositionMenu = $menu->addChild('Meine Einsätze', [
'extras' => [
'icon' => 'bus',
'children' => [#
[
'route' => 'app_teamer_bookmark_index',
'title' => 'Merkliste',
'children' => [
[
'route' => 'app_teamer_assignment_detail',
'title' => 'Einsatzdetails',
'routeParameters' => $this->getDefaultRouteParameters('uuid'),
]
],
],
[
'route' => 'app_teamer_application_index',
'title' => 'Offene Bewerbungen',
],
[
'route' => 'app_teamer_disposition_upcoming',
'title' => 'Nächste Einsätze',
],
[
'route' => 'app_teamer_disposition_recent',
'title' => 'Letzte Einsätze',
],
],
],
[
'route' => 'app_teamer_document',
]);
$dispositionMenu->addChild('Merkliste', [
'route' => 'app_teamer_bookmark_index',
'linkAttributes' => [
'title' => 'Merkliste',
],
]);
$dispositionMenu->addChild('Offene Bewerbungen', [
'route' => 'app_teamer_application_index',
'linkAttributes' => [
'title' => 'Offene Bewerbungen',
],
]);
$dispositionMenu->addChild('Nächste Einsätze', [
'route' => 'app_teamer_disposition_upcoming',
'linkAttributes' => [
'title' => 'Nächste Einsätze',
],
]);
$dispositionMenu->addChild('Letze Einsätze', [
'route' => 'app_teamer_disposition_recent',
'linkAttributes' => [
'title' => 'Letze Einsätze',
],
]);
$menu->addChild('Dokumente', [
'route' => 'app_teamer_document',
'linkAttributes' => [
'title' => 'Dokumente',
],
'extras' => [
'icon' => 'document',
],
[
'route' => false,
'title' => 'FAQ & Kontakt',
'icon' => 'info',
'children' => [
[
'route' => 'app_teamer_faq',
'title' => 'FAQ',
],
[
'route' => 'app_teamer_contact',
'title' => 'Kontakt',
],
],
],
];
]);
$menu = $this->createMenu($menuItems);
$infoMenu = $menu->addChild('FAQ & Kontakt', [
'extras' => [
'icon' => 'info',
],
]);
$infoMenu->addChild('FAQ', [
'route' => 'app_teamer_faq',
'linkAttributes' => [
'title' => 'FAQ',
],
]);
$infoMenu->addChild('Kontakt', [
'route' => 'app_teamer_contact',
'linkAttributes' => [
'title' => 'Kontakt',
],
]);
$this->addAdminItem($menu);
$this->addHouseManagerItem($menu);