From fabf23f1f029ae2d581463e3f719e26649b826cb Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 29 Apr 2022 21:21:09 +0200 Subject: [PATCH 1/4] admin: add custom template for userjob edit --- .../DependencyInjection/ChillMainExtension.php | 1 + .../ChillMainBundle/Resources/views/UserJob/edit.html.twig | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 src/Bundle/ChillMainBundle/Resources/views/UserJob/edit.html.twig diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 62a3d80d8..067a910c8 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -313,6 +313,7 @@ class ChillMainExtension extends Extension implements ], 'edit' => [ 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/UserJob/edit.html.twig', ], ], ], diff --git a/src/Bundle/ChillMainBundle/Resources/views/UserJob/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/UserJob/edit.html.twig new file mode 100644 index 000000000..1160220a3 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/UserJob/edit.html.twig @@ -0,0 +1,7 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block content -%} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock content %} From 8d62ce46c6c2ecf887098e4d75eccb17f2cf1619 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 29 Apr 2022 21:44:02 +0200 Subject: [PATCH 2/4] admin: order user job type --- .../ChillMainBundle/Resources/views/UserJob/index.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig index 8f037f150..392ae79fd 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig @@ -8,7 +8,7 @@   {% endblock %} {% block table_entities_tbody %} - {% for entity in entities %} + {% for entity in entities|sort((a, b) => a.label|localize_translatable_string <=> b.label|localize_translatable_string) %} {{ entity.id }} {{ entity.label|localize_translatable_string }} @@ -23,4 +23,4 @@ {% endfor %} {% endblock %} {% endembed %} -{% endblock content %} +{% endblock content %} \ No newline at end of file From 2263e7be73cc5a4bd7943e23dada873ce17c6aff Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 29 Apr 2022 22:02:19 +0200 Subject: [PATCH 3/4] admin: order user job by id --- .../Controller/UserJobController.php | 26 +++++++++++++++++++ .../ChillMainExtension.php | 2 ++ .../Resources/views/UserJob/index.html.twig | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/Bundle/ChillMainBundle/Controller/UserJobController.php diff --git a/src/Bundle/ChillMainBundle/Controller/UserJobController.php b/src/Bundle/ChillMainBundle/Controller/UserJobController.php new file mode 100644 index 000000000..0c1fd4b3d --- /dev/null +++ b/src/Bundle/ChillMainBundle/Controller/UserJobController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 067a910c8..66b6bfd70 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -16,6 +16,7 @@ use Chill\MainBundle\Controller\CivilityApiController; use Chill\MainBundle\Controller\LocationController; use Chill\MainBundle\Controller\LocationTypeController; use Chill\MainBundle\Controller\UserController; +use Chill\MainBundle\Controller\UserJobController; use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface; use Chill\MainBundle\Doctrine\DQL\GetJsonFieldByKey; use Chill\MainBundle\Doctrine\DQL\JsonAggregate; @@ -299,6 +300,7 @@ class ChillMainExtension extends Extension implements 'cruds' => [ [ 'class' => UserJob::class, + 'controller' => UserJobController::class, 'name' => 'admin_user_job', 'base_path' => '/admin/main/user-job', 'base_role' => 'ROLE_ADMIN', diff --git a/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig index 392ae79fd..3f48c46ac 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig @@ -8,7 +8,7 @@   {% endblock %} {% block table_entities_tbody %} - {% for entity in entities|sort((a, b) => a.label|localize_translatable_string <=> b.label|localize_translatable_string) %} + {% for entity in entities %} {{ entity.id }} {{ entity.label|localize_translatable_string }} From de362dcad70c0ab6b2f6ee8005f5cefae180b142 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 29 Apr 2022 22:04:36 +0200 Subject: [PATCH 4/4] upd CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90f4c2503..0dd33c7cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to ## Unreleased +* [main] admin user_job: improvements (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/588) + * [person] prevent circular references in PersonDocGenNormalizer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/527) * [person] add maritalStatusComment to PersonDocGenNormalizer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/582) * Load relationships without gender in french fixtures