From 04fc5b6614cb8c421a474b40b98618c22404098c Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 11 Jul 2022 14:10:45 +0200 Subject: [PATCH] flash menu rapid action built with chill_menu() --- .../AccompanyingCourseQuickMenuBuilder.php | 34 ++++++++++++++++ .../AccompanyingCourseQuickMenuBuilder.php | 34 ++++++++++++++++ .../ChillMainBundle/Menu/quick_menu.html.twig | 17 ++++++++ .../Menu/PersonQuickMenuBuilder.php | 32 +++++++++++++++ .../views/Person/list_with_period.html.twig | 39 ++++++------------- 5 files changed, 129 insertions(+), 27 deletions(-) create mode 100644 src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseQuickMenuBuilder.php create mode 100644 src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseQuickMenuBuilder.php create mode 100644 src/Bundle/ChillMainBundle/Menu/quick_menu.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Menu/PersonQuickMenuBuilder.php diff --git a/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseQuickMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseQuickMenuBuilder.php new file mode 100644 index 000000000..5d0f95e14 --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseQuickMenuBuilder.php @@ -0,0 +1,34 @@ +addChild('Create a new activity in accompanying course', [ + 'route' => 'chill_activity_activity_new', + 'routeParameters' => [ + //'accompanying_course_id' => $accompanyingCourse->getId() + ] + ]) + ->setExtras([ + 'order' => 10, + 'icon' => 'plus' + ]) + ; + + } +} \ No newline at end of file diff --git a/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseQuickMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseQuickMenuBuilder.php new file mode 100644 index 000000000..d98e9f2c8 --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseQuickMenuBuilder.php @@ -0,0 +1,34 @@ +addChild('Create a new calendar in accompanying course', [ + 'route' => 'chill_calendar_calendar_new', + 'routeParameters' => [ + //'accompanying_course_id' => $accompanyingCourse->getId() + ] + ]) + ->setExtras([ + 'order' => 20, + 'icon' => 'plus' + ]) + ; + + } +} \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/Menu/quick_menu.html.twig b/src/Bundle/ChillMainBundle/Menu/quick_menu.html.twig new file mode 100644 index 000000000..f431674c7 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Menu/quick_menu.html.twig @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Menu/PersonQuickMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/PersonQuickMenuBuilder.php new file mode 100644 index 000000000..82d3c4574 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Menu/PersonQuickMenuBuilder.php @@ -0,0 +1,32 @@ +addChild('Create Accompanying Course', [ + 'route' => 'chill_person_accompanying_course_new', + 'routeParameters' => [ + 'person_id' => $person->getId(), + ], ]) + ->setExtras([ + 'order' => 10, + 'icon' => 'plus' + ]) + ; + } + +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig index 4a8e6ed7f..bfbbe88e1 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig @@ -9,16 +9,12 @@ {% endif %} - + + {{ chill_menu('person_quick_menu', { + 'layout': '@ChillMainBundle/Menu/quick_menu.html.twig', + 'args' : { 'person': person } + }) }} + {% endmacro %} {% macro accompanying_period(acp, person) %} @@ -181,23 +177,12 @@ > - + + {{ chill_menu('accompanying_course_quick_menu', { + 'layout': '@ChillMainBundle/Menu/quick_menu.html.twig', + 'args' : { 'accompanying-course': acp } + }) }} +