From fabf23f1f029ae2d581463e3f719e26649b826cb Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 29 Apr 2022 21:21:09 +0200 Subject: [PATCH 01/49] 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 02/49] 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 03/49] 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 04/49] 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 From 64d459466ff448bdd4fa0f74124cdff91710d995 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 2 May 2022 12:16:46 +0200 Subject: [PATCH 05/49] activity admin: translations + remove label field for comment on admin activity type --- CHANGELOG.md | 2 ++ src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php | 5 ++++- .../ChillActivityBundle/translations/messages.fr.yml | 9 ++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90f4c2503..9bfee84ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to ## Unreleased +* [activity] activity admin: translations + remove label field for comment on admin activity type (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/587) + * [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 diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php index 28947d72b..17d2bb914 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php @@ -57,7 +57,7 @@ class ActivityTypeType extends AbstractType $fields = [ 'persons', 'user', 'date', 'location', 'persons', 'thirdParties', 'durationTime', 'travelTime', 'attendee', - 'reasons', 'comment', 'sentReceived', 'documents', + 'reasons', 'sentReceived', 'documents', 'emergency', 'socialIssues', 'socialActions', 'users', ]; @@ -69,6 +69,9 @@ class ActivityTypeType extends AbstractType 'empty_data' => '', ]); } + + $builder + ->add('commentVisible', ActivityFieldPresence::class); } public function configureOptions(OptionsResolver $resolver) diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index 9d7fdd288..3ca4def7c 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -113,7 +113,7 @@ Activity type configuration: Configuration des categories d'activités Activity Reasons: Sujets d'une activité Activity Reasons Category: Catégories de sujet d'activités Activity Types Categories: Catégories des types d'activité -Activity Presences: Presences des activités +Activity Presences: Presences aux activités # Crud @@ -124,6 +124,9 @@ crud: activity_type_category: title_new: Nouvelle catégorie de type d'activité title_edit: Edition d'une catégorie de type d'activité + activity_presence: + title_new: Nouvelle Présence aux activités + title_edit: Edition d'une Présence aux activités # activity reason admin ActivityReason list: Liste des sujets @@ -145,6 +148,10 @@ ActivityReasonCategory: Catégorie de sujet d'activité ActivityReasonCategory is active and will be proposed: La catégorie est active et sera proposée ActivityReasonCategory is inactive and won't be proposed: La catégorie est inactive et ne sera pas proposée +#activity presence admin +ActivityPresence list: Liste des Présences aux activités +Create a new activity presence: Créer une nouvelle "Présence aux activités" + # activity type type admin ActivityType list: Types d'activités Create a new activity type: Créer un nouveau type d'activité From 4c99abd6d3d15d8cfc63a98c711e9c2805d3e611 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 2 May 2022 16:51:41 +0200 Subject: [PATCH 06/49] Admin: Add country and languages to the admin --- .../Controller/AdminController.php | 5 ++ .../Controller/CountryController.php | 27 ++++++++ .../Controller/LanguageController.php | 27 ++++++++ .../ChillMainExtension.php | 61 +++++++++++++++++-- .../ChillMainBundle/Form/CountryType.php | 32 ++++++++++ .../ChillMainBundle/Form/LanguageType.php | 32 ++++++++++ .../views/Admin/Country/edit.html.twig | 7 +++ .../views/Admin/Country/index.html.twig | 28 +++++++++ .../views/Admin/Language/edit.html.twig | 7 +++ .../views/Admin/Language/index.html.twig | 27 ++++++++ .../views/{ => Admin}/Location/edit.html.twig | 0 .../{ => Admin}/Location/index.html.twig | 0 .../views/{ => Admin}/Location/new.html.twig | 0 .../{ => Admin}/LocationType/edit.html.twig | 0 .../{ => Admin}/LocationType/index.html.twig | 0 .../{ => Admin}/LocationType/new.html.twig | 0 .../Admin/layout_language_country.html.twig | 33 ++++++++++ .../menu_admin_language_country.html.twig | 20 ++++++ .../translations/messages.fr.yml | 18 ++++++ 19 files changed, 318 insertions(+), 6 deletions(-) create mode 100644 src/Bundle/ChillMainBundle/Controller/CountryController.php create mode 100644 src/Bundle/ChillMainBundle/Controller/LanguageController.php create mode 100644 src/Bundle/ChillMainBundle/Form/CountryType.php create mode 100644 src/Bundle/ChillMainBundle/Form/LanguageType.php create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Country/edit.html.twig create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Country/index.html.twig create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Language/edit.html.twig create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Language/index.html.twig rename src/Bundle/ChillMainBundle/Resources/views/{ => Admin}/Location/edit.html.twig (100%) rename src/Bundle/ChillMainBundle/Resources/views/{ => Admin}/Location/index.html.twig (100%) rename src/Bundle/ChillMainBundle/Resources/views/{ => Admin}/Location/new.html.twig (100%) rename src/Bundle/ChillMainBundle/Resources/views/{ => Admin}/LocationType/edit.html.twig (100%) rename src/Bundle/ChillMainBundle/Resources/views/{ => Admin}/LocationType/index.html.twig (100%) rename src/Bundle/ChillMainBundle/Resources/views/{ => Admin}/LocationType/new.html.twig (100%) create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/layout_language_country.html.twig create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_language_country.html.twig diff --git a/src/Bundle/ChillMainBundle/Controller/AdminController.php b/src/Bundle/ChillMainBundle/Controller/AdminController.php index efde1ae20..2055f0f22 100644 --- a/src/Bundle/ChillMainBundle/Controller/AdminController.php +++ b/src/Bundle/ChillMainBundle/Controller/AdminController.php @@ -24,6 +24,11 @@ class AdminController extends AbstractController return $this->render('@ChillMain/Admin/index.html.twig'); } + public function indexLanguageCountryAction() + { + return $this->render('@ChillMain/Admin/layout_language_country.html.twig'); + } + public function indexLocationsAction() { return $this->render('@ChillMain/Admin/layout_location.html.twig'); diff --git a/src/Bundle/ChillMainBundle/Controller/CountryController.php b/src/Bundle/ChillMainBundle/Controller/CountryController.php new file mode 100644 index 000000000..351a8d4c3 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Controller/CountryController.php @@ -0,0 +1,27 @@ +addOrderBy('e.countryCode', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } + +} diff --git a/src/Bundle/ChillMainBundle/Controller/LanguageController.php b/src/Bundle/ChillMainBundle/Controller/LanguageController.php new file mode 100644 index 000000000..33d88ab0e --- /dev/null +++ b/src/Bundle/ChillMainBundle/Controller/LanguageController.php @@ -0,0 +1,27 @@ +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 62a3d80d8..02c8589c8 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -13,6 +13,7 @@ namespace Chill\MainBundle\DependencyInjection; use Chill\MainBundle\Controller\AddressApiController; use Chill\MainBundle\Controller\CivilityApiController; +use Chill\MainBundle\Controller\CountryController; use Chill\MainBundle\Controller\LocationController; use Chill\MainBundle\Controller\LocationTypeController; use Chill\MainBundle\Controller\UserController; @@ -30,10 +31,14 @@ use Chill\MainBundle\Doctrine\DQL\Unaccent; use Chill\MainBundle\Doctrine\ORM\Hydration\FlatHierarchyEntityHydrator; use Chill\MainBundle\Doctrine\Type\NativeDateIntervalType; use Chill\MainBundle\Doctrine\Type\PointType; +use Chill\MainBundle\Entity\Country; +use Chill\MainBundle\Entity\Language; use Chill\MainBundle\Entity\Location; use Chill\MainBundle\Entity\LocationType; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\UserJob; +use Chill\MainBundle\Form\CountryType; +use Chill\MainBundle\Form\LanguageType; use Chill\MainBundle\Form\LocationFormType; use Chill\MainBundle\Form\LocationTypeType; use Chill\MainBundle\Form\UserJobType; @@ -348,15 +353,15 @@ class ChillMainExtension extends Extension implements 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Location/index.html.twig', + 'template' => '@ChillMain/Admin/Location/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Location/new.html.twig', + 'template' => '@ChillMain/Admin/Location/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Location/edit.html.twig', + 'template' => '@ChillMain/Admin/Location/edit.html.twig', ], ], ], @@ -370,15 +375,59 @@ class ChillMainExtension extends Extension implements 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/LocationType/index.html.twig', + 'template' => '@ChillMain/Admin/LocationType/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/LocationType/new.html.twig', + 'template' => '@ChillMain/Admin/LocationType/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/LocationType/edit.html.twig', + 'template' => '@ChillMain/Admin/LocationType/edit.html.twig', + ], + ], + ], + [ + 'class' => Country::class, + 'name' => 'main_country', + 'base_path' => '/admin/main/country', + 'base_role' => 'ROLE_ADMIN', + 'form_class' => CountryType::class, + 'controller' => CountryController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Admin/Country/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Admin/Country/edit.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Admin/Country/edit.html.twig', + ], + ], + ], + [ + 'class' => Language::class, + 'name' => 'main_language', + 'base_path' => '/admin/main/language', + 'base_role' => 'ROLE_ADMIN', + 'form_class' => LanguageType::class, + 'controller' => LanguageController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Admin/Language/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Admin/Language/edit.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Admin/Language/edit.html.twig', ], ], ], diff --git a/src/Bundle/ChillMainBundle/Form/CountryType.php b/src/Bundle/ChillMainBundle/Form/CountryType.php new file mode 100644 index 000000000..2eb979d85 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Form/CountryType.php @@ -0,0 +1,32 @@ +add('name', TranslatableStringFormType::class, [ + 'label' => 'Name', + 'required' => true, + ]) + ->add('countryCode', TextType::class, [ + 'label' => 'Country code', + 'required' => true, + ]); + } +} diff --git a/src/Bundle/ChillMainBundle/Form/LanguageType.php b/src/Bundle/ChillMainBundle/Form/LanguageType.php new file mode 100644 index 000000000..cb48d15ca --- /dev/null +++ b/src/Bundle/ChillMainBundle/Form/LanguageType.php @@ -0,0 +1,32 @@ +add('id', TextType::class, [ + 'label' => 'Id', + 'required' => true, + ]) + ->add('name', TranslatableStringFormType::class, [ + 'label' => 'Name', + 'required' => true, + ]); + } +} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/edit.html.twig new file mode 100644 index 000000000..1160220a3 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/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 %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/index.html.twig new file mode 100644 index 000000000..6e1279701 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/index.html.twig @@ -0,0 +1,28 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + id + name + countryCode + {% endblock %} + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.name|localize_translatable_string }} + {{ entity.countrycode }} + +
    +
  • + +
  • +
+ + + {% endfor %} + {% endblock %} + {% endembed %} +{% endblock content %} + diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/edit.html.twig new file mode 100644 index 000000000..1160220a3 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/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 %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/index.html.twig new file mode 100644 index 000000000..92e9ce8f5 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/index.html.twig @@ -0,0 +1,27 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + id + name +   + {% endblock %} + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.name|localize_translatable_string }} + +
    +
  • + +
  • +
+ + + {% endfor %} + {% endblock %} + {% endembed %} +{% endblock content %} + diff --git a/src/Bundle/ChillMainBundle/Resources/views/Location/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/edit.html.twig similarity index 100% rename from src/Bundle/ChillMainBundle/Resources/views/Location/edit.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Admin/Location/edit.html.twig diff --git a/src/Bundle/ChillMainBundle/Resources/views/Location/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/index.html.twig similarity index 100% rename from src/Bundle/ChillMainBundle/Resources/views/Location/index.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Admin/Location/index.html.twig diff --git a/src/Bundle/ChillMainBundle/Resources/views/Location/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/new.html.twig similarity index 100% rename from src/Bundle/ChillMainBundle/Resources/views/Location/new.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Admin/Location/new.html.twig diff --git a/src/Bundle/ChillMainBundle/Resources/views/LocationType/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/edit.html.twig similarity index 100% rename from src/Bundle/ChillMainBundle/Resources/views/LocationType/edit.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/edit.html.twig diff --git a/src/Bundle/ChillMainBundle/Resources/views/LocationType/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/index.html.twig similarity index 100% rename from src/Bundle/ChillMainBundle/Resources/views/LocationType/index.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/index.html.twig diff --git a/src/Bundle/ChillMainBundle/Resources/views/LocationType/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/new.html.twig similarity index 100% rename from src/Bundle/ChillMainBundle/Resources/views/LocationType/new.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/new.html.twig diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/layout_language_country.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/layout_language_country.html.twig new file mode 100644 index 000000000..b76e60861 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/layout_language_country.html.twig @@ -0,0 +1,33 @@ +{# + * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, + / + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} + +{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %} + +{% block vertical_menu_content %} + {{ chill_menu('admin_language_country', { + 'layout': '@ChillMain/Admin/menu_admin_language_country.html.twig', + }) }} +{% endblock %} + + + +{% block layout_wvm_content %} + {% block admin_content %} +

{{ 'Management of languages and countries' |trans }}

+ {% endblock %} +{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_language_country.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_language_country.html.twig new file mode 100644 index 000000000..e6b4fa5fe --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_language_country.html.twig @@ -0,0 +1,20 @@ +{# + * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, + / + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} + +{% extends "@ChillMain/Menu/verticalMenu.html.twig" %} +{% block v_menu_title %}{{ 'Language and countries menu'|trans }}{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 452ad306c..0d164075b 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -223,6 +223,12 @@ none: aucun person: usager thirdparty: tiers + +#admin section for language and country +Language and countries menu: Menu Langues & Pays +Management of languages and countries: Gestion des langues & Pays + + # circles / scopes Choose the circle: Choisir le cercle Scopes: Services @@ -344,6 +350,18 @@ crud: main_location: title_new: Nouvelle localisation title_edit: Modifier une localisation + main_language: + index: + title: Liste des langues + add_new: Ajouter une langue + title_new: Nouvelle langue + title_edit: Modifier une langue + main_country: + index: + title: Liste des pays + add_new: Ajouter un pays + title_new: Nouveau pays + title_edit: Modifier un pays No entities: Aucun élément From 04f27cc555dff1007d4fe7b99b409c596027dead Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 3 May 2022 09:27:04 +0200 Subject: [PATCH 07/49] admin: add menu for languages and countries section --- .../ChillMainExtension.php | 5 +-- .../views/Admin/Country/index.html.twig | 1 + .../views/Admin/Country/new.html.twig | 7 ++++ .../views/Admin/Language/new.html.twig | 7 ++++ .../MenuBuilder/AdminSectionMenuBuilder.php | 9 +++++ .../LanguageCountryMenuBuilder.php | 33 +++++++++++++++++++ src/Bundle/ChillMainBundle/config/routes.yaml | 4 +++ .../translations/messages.fr.yml | 7 ++-- 8 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Country/new.html.twig create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Language/new.html.twig create mode 100644 src/Bundle/ChillMainBundle/Routing/MenuBuilder/LanguageCountryMenuBuilder.php diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 02c8589c8..6a5ea7f5f 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -14,6 +14,7 @@ namespace Chill\MainBundle\DependencyInjection; use Chill\MainBundle\Controller\AddressApiController; use Chill\MainBundle\Controller\CivilityApiController; use Chill\MainBundle\Controller\CountryController; +use Chill\MainBundle\Controller\LanguageController; use Chill\MainBundle\Controller\LocationController; use Chill\MainBundle\Controller\LocationTypeController; use Chill\MainBundle\Controller\UserController; @@ -401,7 +402,7 @@ class ChillMainExtension extends Extension implements ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Country/edit.html.twig', + 'template' => '@ChillMain/Admin/Country/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', @@ -423,7 +424,7 @@ class ChillMainExtension extends Extension implements ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Language/edit.html.twig', + 'template' => '@ChillMain/Admin/Language/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/index.html.twig index 6e1279701..67aa70fd1 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/index.html.twig @@ -6,6 +6,7 @@ id name countryCode + {% endblock %} {% block table_entities_tbody %} {% for entity in entities %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/new.html.twig new file mode 100644 index 000000000..643de1ff4 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/new.html.twig @@ -0,0 +1,7 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block content -%} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock content %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/new.html.twig new file mode 100644 index 000000000..643de1ff4 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/new.html.twig @@ -0,0 +1,7 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block content -%} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock content %} diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php index 9bcc80ad2..b1326a85b 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php @@ -51,6 +51,15 @@ class AdminSectionMenuBuilder implements LocalMenuBuilderInterface 'order' => 205, 'explain' => 'Configure location and location type', ]); + + $menu->addChild('Languages and countries', [ + 'route' => 'chill_main_admin_language_country', + ]) + ->setExtras([ + 'icons' => ['key'], + 'order' => 210, + 'explain' => 'Configure languages and countries', + ]); } public static function getMenuIds(): array diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/LanguageCountryMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/LanguageCountryMenuBuilder.php new file mode 100644 index 000000000..540f1344e --- /dev/null +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/LanguageCountryMenuBuilder.php @@ -0,0 +1,33 @@ +addChild('Language list', [ + 'route' => 'chill_crud_main_language_index', + ])->setExtras(['order' => 205]); + + $menu->addChild('Country list', [ + 'route' => 'chill_crud_main_country_index', + ])->setExtras(['order' => 206]); + } + + public static function getMenuIds(): array + { + return ['admin_language_country']; + } +} diff --git a/src/Bundle/ChillMainBundle/config/routes.yaml b/src/Bundle/ChillMainBundle/config/routes.yaml index bebdf8f52..b0ee2c956 100644 --- a/src/Bundle/ChillMainBundle/config/routes.yaml +++ b/src/Bundle/ChillMainBundle/config/routes.yaml @@ -70,6 +70,10 @@ chill_main_admin_locations: path: /{_locale}/admin/locations controller: Chill\MainBundle\Controller\AdminController::indexLocationsAction +chill_main_admin_language_country: + path: /{_locale}/admin/language-country + controller: Chill\MainBundle\Controller\AdminController::indexLanguageCountryAction + chill_main_search: path: /{_locale}/search.{_format} controller: Chill\MainBundle\Controller\SearchController::searchAction diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 0d164075b..8c1d981b9 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -226,8 +226,11 @@ thirdparty: tiers #admin section for language and country Language and countries menu: Menu Langues & Pays -Management of languages and countries: Gestion des langues & Pays - +Languages and countries: Langues & Pays +Management of languages and countries: Gestion des langues & pays +Configure languages and countries: Configuration des langues & pays +Language list: Liste des langues +Country list: Liste des pays # circles / scopes Choose the circle: Choisir le cercle From 98086754552a7b48c22fbcf4e819e4498e110929 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 3 May 2022 09:28:33 +0200 Subject: [PATCH 08/49] upd CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90f4c2503..e80ea1e13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to ## Unreleased +* [admin] add admin section for languages and countries (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/596) + * [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 From 76af733bc3ee868f2f784312cd0c68fb25da7e33 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 3 May 2022 18:33:56 +0200 Subject: [PATCH 09/49] admin: add civility --- .../Controller/CivilityController.php | 27 ++++++++++++++ .../ChillMainExtension.php | 25 +++++++++++++ .../ChillMainBundle/Form/CivilityType.php | 36 +++++++++++++++++++ .../views/Admin/Civility/edit.html.twig | 7 ++++ .../views/Admin/Civility/index.html.twig | 33 +++++++++++++++++ .../views/Admin/Civility/new.html.twig | 7 ++++ .../translations/messages.fr.yml | 6 ++++ 7 files changed, 141 insertions(+) create mode 100644 src/Bundle/ChillMainBundle/Controller/CivilityController.php create mode 100644 src/Bundle/ChillMainBundle/Form/CivilityType.php create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/edit.html.twig create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/index.html.twig create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/new.html.twig diff --git a/src/Bundle/ChillMainBundle/Controller/CivilityController.php b/src/Bundle/ChillMainBundle/Controller/CivilityController.php new file mode 100644 index 000000000..52b16f634 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Controller/CivilityController.php @@ -0,0 +1,27 @@ +addOrderBy('e.order', '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 6a5ea7f5f..43d85f052 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -13,6 +13,7 @@ namespace Chill\MainBundle\DependencyInjection; use Chill\MainBundle\Controller\AddressApiController; use Chill\MainBundle\Controller\CivilityApiController; +use Chill\MainBundle\Controller\CivilityController; use Chill\MainBundle\Controller\CountryController; use Chill\MainBundle\Controller\LanguageController; use Chill\MainBundle\Controller\LocationController; @@ -32,12 +33,14 @@ use Chill\MainBundle\Doctrine\DQL\Unaccent; use Chill\MainBundle\Doctrine\ORM\Hydration\FlatHierarchyEntityHydrator; use Chill\MainBundle\Doctrine\Type\NativeDateIntervalType; use Chill\MainBundle\Doctrine\Type\PointType; +use Chill\MainBundle\Entity\Civility; use Chill\MainBundle\Entity\Country; use Chill\MainBundle\Entity\Language; use Chill\MainBundle\Entity\Location; use Chill\MainBundle\Entity\LocationType; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\UserJob; +use Chill\MainBundle\Form\CivilityType; use Chill\MainBundle\Form\CountryType; use Chill\MainBundle\Form\LanguageType; use Chill\MainBundle\Form\LocationFormType; @@ -410,6 +413,28 @@ class ChillMainExtension extends Extension implements ], ], ], + [ + 'class' => Civility::class, + 'name' => 'main_civility', + 'base_path' => '/admin/main/civility', + 'base_role' => 'ROLE_ADMIN', + 'form_class' => CivilityType::class, + 'controller' => CivilityController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Admin/Civility/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Admin/Civility/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Admin/Civility/edit.html.twig', + ], + ], + ], [ 'class' => Language::class, 'name' => 'main_language', diff --git a/src/Bundle/ChillMainBundle/Form/CivilityType.php b/src/Bundle/ChillMainBundle/Form/CivilityType.php new file mode 100644 index 000000000..7dc7959f5 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Form/CivilityType.php @@ -0,0 +1,36 @@ +add('name', TranslatableStringFormType::class, [ + 'required' => true, + ]) + ->add('abbreviation', TranslatableStringFormType::class) + ->add('active', ChoiceType::class, [ + 'choices' => [ + 'Active' => true, + 'Inactive' => false, + ], + ]) + ->add('order', IntegerType::class); + } +} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/edit.html.twig new file mode 100644 index 000000000..1160220a3 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/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 %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/index.html.twig new file mode 100644 index 000000000..278f53ba2 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/index.html.twig @@ -0,0 +1,33 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + id + name + abbreviation + active + ordering + + {% endblock %} + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.name|localize_translatable_string }} + {{ entity.abbreviation|localize_translatable_string }} + {{ entity.active }} + {{ entity.order }} + +
    +
  • + +
  • +
+ + + {% endfor %} + {% endblock %} + {% endembed %} +{% endblock content %} + diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/new.html.twig new file mode 100644 index 000000000..643de1ff4 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/new.html.twig @@ -0,0 +1,7 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block content -%} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock content %} diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 8c1d981b9..f23fa7382 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -365,6 +365,12 @@ crud: add_new: Ajouter un pays title_new: Nouveau pays title_edit: Modifier un pays + main_civility: + index: + title: Liste des civilités + add_new: Ajouter une civilité + title_new: Nouvelle civilité + title_edit: Modifier une civilité No entities: Aucun élément From 3f256ad9075eceffa6d00a332b039b463d5a1b35 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 3 May 2022 19:03:58 +0200 Subject: [PATCH 10/49] admin: update marital status --- .../views/Admin/Civility/new.html.twig | 2 +- .../AdminMaritalStatusController.php | 22 -------------- .../Controller/MaritalStatusController.php | 26 ++++++++++++++++ .../ChillPersonExtension.php | 6 ++-- .../views/MaritalStatus/edit.html.twig | 14 ++++----- .../views/MaritalStatus/index.html.twig | 30 +++++++++---------- .../views/MaritalStatus/new.html.twig | 12 ++++---- .../translations/messages.fr.yml | 2 +- 8 files changed, 59 insertions(+), 55 deletions(-) delete mode 100644 src/Bundle/ChillPersonBundle/Controller/AdminMaritalStatusController.php create mode 100644 src/Bundle/ChillPersonBundle/Controller/MaritalStatusController.php diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/new.html.twig index 643de1ff4..b16f2eeba 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/new.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/new.html.twig @@ -1,6 +1,6 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block content -%} +{% block content %} {% embed '@ChillMain/CRUD/_new_content.html.twig' %} {% block content_form_actions_save_and_show %}{% endblock %} {% endembed %} diff --git a/src/Bundle/ChillPersonBundle/Controller/AdminMaritalStatusController.php b/src/Bundle/ChillPersonBundle/Controller/AdminMaritalStatusController.php deleted file mode 100644 index d27ebe2e8..000000000 --- a/src/Bundle/ChillPersonBundle/Controller/AdminMaritalStatusController.php +++ /dev/null @@ -1,22 +0,0 @@ -addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index 6d2bf6d18..8fc17bf2a 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -166,10 +166,10 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], [ 'class' => \Chill\PersonBundle\Entity\MaritalStatus::class, - 'name' => 'marital_status', - 'base_path' => '/admin/marital-status', + 'name' => 'person_marital-status', + 'base_path' => '/admin/person/marital-status', 'form_class' => \Chill\PersonBundle\Form\MaritalStatusType::class, - 'controller' => \Chill\PersonBundle\Controller\AdminMaritalStatusController::class, + 'controller' => \Chill\PersonBundle\Controller\MaritalStatusController::class, 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', diff --git a/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/edit.html.twig index d132847f2..e61f3f7c0 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/edit.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/edit.html.twig @@ -1,12 +1,12 @@ -{% extends '@ChillPerson/Admin/layout.html.twig' %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} {% block title %} -{% include('@ChillMain/CRUD/_edit_title.html.twig') %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} {% endblock %} -{% block layout_wvm_content %} -{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} - {% block content_form_actions_view %}{% endblock %} - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} +{% block content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_view %}{% endblock %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} {% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/index.html.twig index 52c9d5307..ce8202fb2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/index.html.twig @@ -1,6 +1,6 @@ -{% extends '@ChillPerson/Admin/layout.html.twig' %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block layout_wvm_content %} +{% block content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} {{ 'Id'|trans }} @@ -9,19 +9,19 @@ {% endblock %} {% block table_entities_tbody %} - {% for entity in entities %} - - {{ entity.id }} - {{ entity.name|localize_translatable_string }} - -
    -
  • - -
  • -
- - - {% endfor %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.name|localize_translatable_string }} + +
    +
  • + +
  • +
+ + + {% endfor %} {% endblock %} {% endembed %} {% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/new.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/new.html.twig index cc6021021..52a1d140b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/new.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/new.html.twig @@ -1,11 +1,11 @@ -{% extends '@ChillPerson/Admin/layout.html.twig' %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} {% block title %} -{% include('@ChillMain/CRUD/_new_title.html.twig') %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} {% endblock %} -{% block layout_wvm_content %} -{% embed '@ChillMain/CRUD/_new_content.html.twig' %} - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} +{% block content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} {% endblock %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 70441965c..175505d88 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -372,7 +372,7 @@ crud: add_new: Ajouter un nouveau title_new: Nouveau motif de clotûre title_edit: Modifier le motif de clotûre - marital_status: + person_marital-status: index: title: Liste des états civils add_new: Ajouter un nouveau From e50e68a52bf2192f4dc7ce98dafd0cc2d27c2ad7 Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 4 May 2022 14:09:10 +0200 Subject: [PATCH 11/49] admin: add missing data_class option to form types --- .../ChillMainBundle/Controller/CivilityController.php | 1 - .../ChillMainBundle/Controller/CountryController.php | 1 - .../ChillMainBundle/Controller/LanguageController.php | 1 - src/Bundle/ChillMainBundle/Form/CivilityType.php | 11 ++++++++++- src/Bundle/ChillMainBundle/Form/CountryType.php | 11 ++++++++++- src/Bundle/ChillMainBundle/Form/LanguageType.php | 11 ++++++++++- 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Controller/CivilityController.php b/src/Bundle/ChillMainBundle/Controller/CivilityController.php index 52b16f634..afda9cc64 100644 --- a/src/Bundle/ChillMainBundle/Controller/CivilityController.php +++ b/src/Bundle/ChillMainBundle/Controller/CivilityController.php @@ -23,5 +23,4 @@ class CivilityController extends CRUDController return parent::orderQuery($action, $query, $request, $paginator); } - } diff --git a/src/Bundle/ChillMainBundle/Controller/CountryController.php b/src/Bundle/ChillMainBundle/Controller/CountryController.php index 351a8d4c3..fe56f3c13 100644 --- a/src/Bundle/ChillMainBundle/Controller/CountryController.php +++ b/src/Bundle/ChillMainBundle/Controller/CountryController.php @@ -23,5 +23,4 @@ class CountryController extends CRUDController return parent::orderQuery($action, $query, $request, $paginator); } - } diff --git a/src/Bundle/ChillMainBundle/Controller/LanguageController.php b/src/Bundle/ChillMainBundle/Controller/LanguageController.php index 33d88ab0e..4612a3728 100644 --- a/src/Bundle/ChillMainBundle/Controller/LanguageController.php +++ b/src/Bundle/ChillMainBundle/Controller/LanguageController.php @@ -23,5 +23,4 @@ class LanguageController extends CRUDController return parent::orderQuery($action, $query, $request, $paginator); } - } diff --git a/src/Bundle/ChillMainBundle/Form/CivilityType.php b/src/Bundle/ChillMainBundle/Form/CivilityType.php index 7dc7959f5..96469b216 100644 --- a/src/Bundle/ChillMainBundle/Form/CivilityType.php +++ b/src/Bundle/ChillMainBundle/Form/CivilityType.php @@ -11,14 +11,16 @@ declare(strict_types=1); namespace Chill\MainBundle\Form; +use Chill\MainBundle\Entity\Civility; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; class CivilityType extends \Symfony\Component\Form\AbstractType { - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', TranslatableStringFormType::class, [ @@ -33,4 +35,11 @@ class CivilityType extends \Symfony\Component\Form\AbstractType ]) ->add('order', IntegerType::class); } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Civility::class, + ]); + } } diff --git a/src/Bundle/ChillMainBundle/Form/CountryType.php b/src/Bundle/ChillMainBundle/Form/CountryType.php index 2eb979d85..a1792b0b6 100644 --- a/src/Bundle/ChillMainBundle/Form/CountryType.php +++ b/src/Bundle/ChillMainBundle/Form/CountryType.php @@ -11,13 +11,15 @@ declare(strict_types=1); namespace Chill\MainBundle\Form; +use Chill\MainBundle\Entity\Country; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; class CountryType extends \Symfony\Component\Form\AbstractType { - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', TranslatableStringFormType::class, [ @@ -29,4 +31,11 @@ class CountryType extends \Symfony\Component\Form\AbstractType 'required' => true, ]); } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Country::class, + ]); + } } diff --git a/src/Bundle/ChillMainBundle/Form/LanguageType.php b/src/Bundle/ChillMainBundle/Form/LanguageType.php index cb48d15ca..0c4f036de 100644 --- a/src/Bundle/ChillMainBundle/Form/LanguageType.php +++ b/src/Bundle/ChillMainBundle/Form/LanguageType.php @@ -11,13 +11,15 @@ declare(strict_types=1); namespace Chill\MainBundle\Form; +use Chill\MainBundle\Entity\Language; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; class LanguageType extends \Symfony\Component\Form\AbstractType { - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('id', TextType::class, [ @@ -29,4 +31,11 @@ class LanguageType extends \Symfony\Component\Form\AbstractType 'required' => true, ]); } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Language::class, + ]); + } } From 16d74eaa0c75d49eec564a16bf8fcc209cdb1f84 Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 4 May 2022 17:34:44 +0200 Subject: [PATCH 12/49] admin: reorganize twig templates and admin menu --- .../Controller/AdminController.php | 15 ---- .../Resources/public/chill/chillmain.scss | 5 +- .../views/Admin/Civility/index.html.twig | 12 ++- .../views/Admin/Language/index.html.twig | 13 +++- .../Resources/views/Admin/index.html.twig | 4 - .../Resources/views/Admin/layout.html.twig | 7 -- .../Admin/layoutWithVerticalMenu.html.twig | 7 +- .../Admin/layout_language_country.html.twig | 33 --------- .../views/Admin/layout_location.html.twig | 33 --------- .../views/Admin/layout_permissions.html.twig | 31 -------- .../views/Admin/menu_admin_index.html.twig | 18 ----- .../menu_admin_language_country.html.twig | 20 ----- .../views/Admin/menu_admin_location.html.twig | 20 ----- .../Admin/menu_admin_permissions.html.twig | 20 ----- .../views/Admin/menu_admin_section.html.twig | 67 +++++++---------- .../views/CRUD/Admin/index.html.twig | 11 ++- .../MenuBuilder/AdminSectionMenuBuilder.php | 74 +++++++++++++------ .../LanguageCountryMenuBuilder.php | 33 --------- .../MenuBuilder/LocationMenuBuilder.php | 33 --------- .../MenuBuilder/PermissionMenuBuilder.php | 47 ------------ src/Bundle/ChillMainBundle/config/routes.yaml | 11 --- .../translations/messages.fr.yml | 1 + 22 files changed, 112 insertions(+), 403 deletions(-) delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/layout_language_country.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/layout_location.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/layout_permissions.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_index.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_language_country.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_location.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_permissions.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Routing/MenuBuilder/LanguageCountryMenuBuilder.php delete mode 100644 src/Bundle/ChillMainBundle/Routing/MenuBuilder/LocationMenuBuilder.php delete mode 100644 src/Bundle/ChillMainBundle/Routing/MenuBuilder/PermissionMenuBuilder.php diff --git a/src/Bundle/ChillMainBundle/Controller/AdminController.php b/src/Bundle/ChillMainBundle/Controller/AdminController.php index 2055f0f22..de4420f68 100644 --- a/src/Bundle/ChillMainBundle/Controller/AdminController.php +++ b/src/Bundle/ChillMainBundle/Controller/AdminController.php @@ -23,19 +23,4 @@ class AdminController extends AbstractController { return $this->render('@ChillMain/Admin/index.html.twig'); } - - public function indexLanguageCountryAction() - { - return $this->render('@ChillMain/Admin/layout_language_country.html.twig'); - } - - public function indexLocationsAction() - { - return $this->render('@ChillMain/Admin/layout_location.html.twig'); - } - - public function indexPermissionsAction() - { - return $this->render('@ChillMain/Admin/layout_permissions.html.twig'); - } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss index e4cdcb10c..94bc520cb 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss @@ -179,7 +179,7 @@ div.banner { div.vertical-menu { border-radius: 0; margin-top: 0.5rem; - a.list-group-item { + a.list-group-item, div.list-group-item { background-color: $chill-yellow; border: 0; margin-bottom: 0.25rem; @@ -187,6 +187,9 @@ div.vertical-menu { background-color: tint-color($chill-yellow, 20%) } } + div.list-group-item-header { + text-transform: uppercase; + } } footer.footer { diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/index.html.twig index 278f53ba2..9d28d3339 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/index.html.twig @@ -1,6 +1,7 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block content %} + +{% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} id @@ -28,6 +29,11 @@ {% endfor %} {% endblock %} - {% endembed %} -{% endblock content %} + {% block actions_before %} +
  • + {{'Back to the admin'|trans}} +
  • + {% endblock %} + {% endembed %} +{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/index.html.twig index 92e9ce8f5..21d2afca9 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/index.html.twig @@ -1,12 +1,13 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block content %} +{% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} id name   {% endblock %} + {% block table_entities_tbody %} {% for entity in entities %} @@ -22,6 +23,12 @@ {% endfor %} {% endblock %} - {% endembed %} -{% endblock content %} + + {% block actions_before %} +
  • + {{'Back to the admin'|trans}} +
  • + {% endblock %} + {% endembed %} +{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/index.html.twig index 11d5cc3c9..ba17f1d84 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/index.html.twig @@ -8,8 +8,4 @@

    {{ 'Welcome to the admin section !'|trans }}

    - {{ chill_menu('admin_index', { - 'layout': '@ChillMain/Admin/menu_admin_index.html.twig' - }) }} - {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/layout.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/layout.html.twig index 0107bba4e..01ba8ca58 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/layout.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/layout.html.twig @@ -1,12 +1,5 @@ {% extends "@ChillMain/layout.html.twig" %} -{% block navigation_search_bar %}{% endblock %} -{% block navigation_section_menu %} - {{ chill_menu('admin_section', { - 'layout': '@ChillMain/Menu/admin.html.twig', - }) }} -{% endblock %} - {% block content %} {% block admin_content %}
    diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/layoutWithVerticalMenu.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/layoutWithVerticalMenu.html.twig index 9a57b9067..900a794b6 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/layoutWithVerticalMenu.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/layoutWithVerticalMenu.html.twig @@ -1,14 +1,13 @@ {% extends "@ChillMain/layoutWithVerticalMenu.html.twig" %} -{% block navigation_search_bar %}{% endblock %} -{% block navigation_section_menu %} - {{ chill_menu('admin_section', { +{% block vertical_menu_content %} + {{ chill_menu('admin_section', { 'layout': '@ChillMain/Admin/menu_admin_section.html.twig', }) }} {% endblock %} {% block layout_wvm_content %} {% block admin_content %} - + {% endblock %} {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/layout_language_country.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/layout_language_country.html.twig deleted file mode 100644 index b76e60861..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/layout_language_country.html.twig +++ /dev/null @@ -1,33 +0,0 @@ -{# - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, - / - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} - -{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %} - -{% block vertical_menu_content %} - {{ chill_menu('admin_language_country', { - 'layout': '@ChillMain/Admin/menu_admin_language_country.html.twig', - }) }} -{% endblock %} - - - -{% block layout_wvm_content %} - {% block admin_content %} -

    {{ 'Management of languages and countries' |trans }}

    - {% endblock %} -{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/layout_location.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/layout_location.html.twig deleted file mode 100644 index fc0708af9..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/layout_location.html.twig +++ /dev/null @@ -1,33 +0,0 @@ -{# - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, - / - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} - -{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %} - -{% block vertical_menu_content %} - {{ chill_menu('admin_location', { - 'layout': '@ChillMain/Admin/menu_admin_location.html.twig', - }) }} -{% endblock %} - - - -{% block layout_wvm_content %} - {% block admin_content %} -

    {{ 'Management of location' |trans }}

    - {% endblock %} -{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/layout_permissions.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/layout_permissions.html.twig deleted file mode 100644 index 55883069f..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/layout_permissions.html.twig +++ /dev/null @@ -1,31 +0,0 @@ -{# - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, - / - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} - -{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %} - -{% block vertical_menu_content %} - {{ chill_menu('admin_permissions', { - 'layout': '@ChillMain/Admin/menu_admin_permissions.html.twig', - }) }} -{% endblock %} - -{% block layout_wvm_content %} - {% block admin_content %} -

    {{ 'Permissions management of your chill installation' |trans }}

    - {% endblock %} -{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_index.html.twig deleted file mode 100644 index b766b6440..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_index.html.twig +++ /dev/null @@ -1,18 +0,0 @@ - diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_language_country.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_language_country.html.twig deleted file mode 100644 index e6b4fa5fe..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_language_country.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{# - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, - / - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} - -{% extends "@ChillMain/Menu/verticalMenu.html.twig" %} -{% block v_menu_title %}{{ 'Language and countries menu'|trans }}{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_location.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_location.html.twig deleted file mode 100644 index b4112ff60..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_location.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{# - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, - / - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} - -{% extends "@ChillMain/Menu/verticalMenu.html.twig" %} -{% block v_menu_title %}{{ 'Location Menu'|trans }}{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_permissions.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_permissions.html.twig deleted file mode 100644 index 77032edca..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_permissions.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{# - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, - / - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} - -{% extends "@ChillMain/Menu/verticalMenu.html.twig" %} -{% block v_menu_title %}{{ 'Permissions Menu'|trans }}{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_section.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_section.html.twig index 7fabd0ae9..d0c777a4e 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_section.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_section.html.twig @@ -1,41 +1,28 @@ -{# - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, - / - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} +
    + {% for menu in menus %} + {% if 'header' in menu.extras %} + + {% else %} + + {{ menu.label|trans }} + {% apply spaceless %} + {% if menu.extras.icons is defined %} + {% for icon in menu.extras.icons %} + + {% endfor %} + {% endif %} + {% endapply %} + + {% endif %} - + {% endfor %} +
    diff --git a/src/Bundle/ChillMainBundle/Resources/views/CRUD/Admin/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/CRUD/Admin/index.html.twig index 1dc0acc81..d410abcea 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/CRUD/Admin/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/CRUD/Admin/index.html.twig @@ -1,8 +1,13 @@ -{% extends '@ChillMain/Admin/layout.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ ('crud.' ~ crud_name ~ '.index.title')|trans({'%crud_name%': crud_name}) }}{% endblock %} -{% block content %} +{% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block actions_before %} +
  • + {{'Back to the admin'|trans}} +
  • + {% endblock %} {% endembed %} -{% endblock content %} +{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php index b1326a85b..b21f83846 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php @@ -34,32 +34,58 @@ class AdminSectionMenuBuilder implements LocalMenuBuilderInterface return; } - $menu->addChild('Users and permissions', [ - 'route' => 'chill_main_admin_permissions', - ]) - ->setExtras([ - 'icons' => ['key'], - 'order' => 200, - 'explain' => 'Configure permissions for users', - ]); + $menu->addChild('Users and permissions') + ->setAttribute('class', 'list-group-item-header') + ->setExtras(['order' => 100, 'header' => true]); - $menu->addChild('Location and location type', [ - 'route' => 'chill_main_admin_locations', - ]) - ->setExtras([ - 'icons' => ['key'], - 'order' => 205, - 'explain' => 'Configure location and location type', - ]); + $menu->addChild('Center list', [ + 'route' => 'admin_center', + ])->setExtras(['order' => 110]); + + $menu->addChild('List circles', [ + 'route' => 'admin_scope', + ])->setExtras(['order' => 120]); + + $menu->addChild('Permissions group list', [ + 'route' => 'admin_permissionsgroup', + ])->setExtras(['order' => 130]); + + $menu->addChild('crud.admin_user.index.title', [ + 'route' => 'chill_crud_admin_user_index', + ])->setExtras(['order' => 140]); + + $menu->addChild('User jobs', [ + 'route' => 'chill_crud_admin_user_job_index', + ])->setExtras(['order' => 150]); + + + + $menu->addChild('Languages and countries') + ->setAttribute('class', 'list-group-item-header') + ->setExtras(['order' => 200, 'header' => 'true']); + + $menu->addChild('Language list', [ + 'route' => 'chill_crud_main_language_index', + ])->setExtras(['order' => 210]); + + $menu->addChild('Country list', [ + 'route' => 'chill_crud_main_country_index', + ])->setExtras(['order' => 220]); + + + + $menu->addChild('Location and location type') + ->setAttribute('class', 'list-group-item-header') + ->setExtras(['order' => 300, 'header' => 'true']); + + $menu->addChild('Location type list', [ + 'route' => 'chill_crud_main_location_type_index', + ])->setExtras(['order' => 310]); + + $menu->addChild('Location list', [ + 'route' => 'chill_crud_main_location_index', + ])->setExtras(['order' => 320]); - $menu->addChild('Languages and countries', [ - 'route' => 'chill_main_admin_language_country', - ]) - ->setExtras([ - 'icons' => ['key'], - 'order' => 210, - 'explain' => 'Configure languages and countries', - ]); } public static function getMenuIds(): array diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/LanguageCountryMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/LanguageCountryMenuBuilder.php deleted file mode 100644 index 540f1344e..000000000 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/LanguageCountryMenuBuilder.php +++ /dev/null @@ -1,33 +0,0 @@ -addChild('Language list', [ - 'route' => 'chill_crud_main_language_index', - ])->setExtras(['order' => 205]); - - $menu->addChild('Country list', [ - 'route' => 'chill_crud_main_country_index', - ])->setExtras(['order' => 206]); - } - - public static function getMenuIds(): array - { - return ['admin_language_country']; - } -} diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/LocationMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/LocationMenuBuilder.php deleted file mode 100644 index da1ce479b..000000000 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/LocationMenuBuilder.php +++ /dev/null @@ -1,33 +0,0 @@ -addChild('Location type list', [ - 'route' => 'chill_crud_main_location_type_index', - ])->setExtras(['order' => 205]); - - $menu->addChild('Location list', [ - 'route' => 'chill_crud_main_location_index', - ])->setExtras(['order' => 206]); - } - - public static function getMenuIds(): array - { - return ['admin_location']; - } -} diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/PermissionMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/PermissionMenuBuilder.php deleted file mode 100644 index 6fab6b635..000000000 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/PermissionMenuBuilder.php +++ /dev/null @@ -1,47 +0,0 @@ -addChild('Permissions group list', [ - 'route' => 'admin_permissionsgroup', - ])->setExtras([ - 'order' => 300, - ]); - - $menu->addChild('crud.admin_user.index.title', [ - 'route' => 'chill_crud_admin_user_index', - ])->setExtras(['order' => 400]); - - $menu->addChild('List circles', [ - 'route' => 'admin_scope', - ])->setExtras(['order' => 200]); - - $menu->addChild('Center list', [ - 'route' => 'admin_center', - ])->setExtras(['order' => 100]); - - $menu->addChild('User jobs', [ - 'route' => 'chill_crud_admin_user_job_index', - ])->setExtras(['order' => 150]); - } - - public static function getMenuIds(): array - { - return ['admin_permissions']; - } -} diff --git a/src/Bundle/ChillMainBundle/config/routes.yaml b/src/Bundle/ChillMainBundle/config/routes.yaml index b0ee2c956..d25f2aaff 100644 --- a/src/Bundle/ChillMainBundle/config/routes.yaml +++ b/src/Bundle/ChillMainBundle/config/routes.yaml @@ -62,17 +62,6 @@ chill_main_homepage: # order: 0 # label: Main admin menu # -chill_main_admin_permissions: - path: /{_locale}/admin/permissions - controller: Chill\MainBundle\Controller\AdminController::indexPermissionsAction - -chill_main_admin_locations: - path: /{_locale}/admin/locations - controller: Chill\MainBundle\Controller\AdminController::indexLocationsAction - -chill_main_admin_language_country: - path: /{_locale}/admin/language-country - controller: Chill\MainBundle\Controller\AdminController::indexLanguageCountryAction chill_main_search: path: /{_locale}/search.{_format} diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index f23fa7382..e679db535 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -120,6 +120,7 @@ Main admin menu: Menu d'administration principal Actions: Actions Users and permissions: Utilisateurs et permissions Location and location type: Localisations et types de localisation +Back to the admin: Retour #permissions Permissions Menu: Gestion des droits From ab90f72c7e8b924ec0309a7d51d8bad3b44b9f8a Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 5 May 2022 07:13:53 +0200 Subject: [PATCH 13/49] update conventions --- CONVENTIONS.md | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/CONVENTIONS.md b/CONVENTIONS.md index 5b9da225e..f1892e244 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -2,7 +2,14 @@ en cours de rédaction +## Translations + +Par bundle, toutes les traductions des pages twig se trouvent dans un seul fichier `translations/messages.fr.yaml`. + +## Emplacement des fichiers + +Les controllers, form type & templates twig sont placés à la racine des dossiers `Controller`, `Form` & `Ressources/views`, respectivement. Pour les pages Admin, on ne les mets plus dans des sous-dossiers Admin. ## Assets: nommage des entrypoints Trois types d'entrypoint: @@ -146,19 +153,20 @@ Ces règles n'ont pas toujours été utilisées par le passé. Elles sont souhai Les routes sont nommées de cette manière: -`chill_bundle_entite_action` +`chill_(api|crud)_bundle_(api)_entite_action` 1. d'abord chill_ (pour tous les modules chill) -2. ensuite une string qui est identique, par bundle -3. si le point est un point d'api (json), alors ajouter la string `api` -4. ensuite une string qui indique sur quelle entité porte la route, voire également les sous-entités -5. ensuite une action (`list`, `view`, `edit`, `new`, ...) +2. ensuite `crud` ou `api`, optionnel, automatiquement ajouté si la route est générée par la configuration +3. ensuite une string qui indique le bundle (`main`, `person`, `activity`, ...) +4. ensuite, `api`, si la route est une route d'api. +5. ensuite une string qui indique sur quelle entité porte la route, voire également les sous-entités +6. ensuite une action (`list`, `view`, `edit`, `new`, ...) -Le fait d'indiquer `api` en 3 permet de distinguer les routes d'api qui sont générées par la configuration (qui sont toutes préfixées par `chill_api`, de celles générées manuellement. (Exemple: `chill_api_household__index`, et `chill_person_api_household_members_move`) +Le fait d'indiquer `api` en quatrième position permet de distinguer les routes d'api qui sont générées par la configuration (qui sont toutes préfixées par `chill_api`, de celles générées manuellement. (Exemple: `chill_api_household__index`, et `chill_person_api_household_members_move`) Si les points 4 et 5 sont inexistants, alors ils sont remplacés par d'autres éléments de manière à garantir l'unicité de la route, et sa bonne compréhension. -### URL +### Nommage des URL Les URL respectent également une convention: @@ -219,6 +227,14 @@ Les éléments suivants devraient se trouver dans la liste: Ces éléments peuvent être entrecoupés de l'identifiant d'une entité. Dans ce cas, cet identifiant se place juste après l'entité auquel il se rapporte. +#### Pour les URL de l'espace Admin + +Même conventions que dans les autres pages html de l'application, **mais `admin` est ajouté en deuxième position**. Soit: + + +`/{_locale}/admin/bundle/entity/{id}/action` + + ## Règles UI chill ### Titre des pages From b09d92eae8f9fdf50843e7c162f593d3436b0349 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 5 May 2022 08:03:20 +0200 Subject: [PATCH 14/49] admin: reorganise files according to conventions --- .../ChillMainExtension.php | 30 ++++++------ .../views/Admin/Location/edit.html.twig | 39 ---------------- .../views/Admin/Location/new.html.twig | 39 ---------------- .../views/Admin/LocationType/edit.html.twig | 14 ------ .../views/Admin/LocationType/new.html.twig | 11 ----- .../views/{Admin => }/Civility/edit.html.twig | 8 +++- .../{Admin => }/Civility/index.html.twig | 17 ++++--- .../Language => Civility}/new.html.twig | 8 +++- .../Language => Country}/edit.html.twig | 8 +++- .../views/{Admin => }/Country/index.html.twig | 17 +++++-- .../views/{Admin => }/Country/new.html.twig | 8 +++- .../Country => Language}/edit.html.twig | 8 +++- .../{Admin => }/Language/index.html.twig | 2 +- .../Civility => Language}/new.html.twig | 8 +++- .../Resources/views/Location/edit.html.twig | 39 ++++++++++++++++ .../{Admin => }/Location/index.html.twig | 45 ++++++++---------- .../Resources/views/Location/new.html.twig | 39 ++++++++++++++++ .../views/LocationType/edit.html.twig | 11 +++++ .../{Admin => }/LocationType/index.html.twig | 46 ++++++++----------- .../views/LocationType/new.html.twig | 11 +++++ .../MenuBuilder/AdminSectionMenuBuilder.php | 4 +- .../ChillMainBundle/translations/admin.fr.yml | 4 -- .../translations/messages.fr.yml | 11 ++++- 23 files changed, 225 insertions(+), 202 deletions(-) delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Location/edit.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Location/new.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/edit.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/new.html.twig rename src/Bundle/ChillMainBundle/Resources/views/{Admin => }/Civility/edit.html.twig (57%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin => }/Civility/index.html.twig (77%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin/Language => Civility}/new.html.twig (57%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin/Language => Country}/edit.html.twig (57%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin => }/Country/index.html.twig (71%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin => }/Country/new.html.twig (57%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin/Country => Language}/edit.html.twig (57%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin => }/Language/index.html.twig (96%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin/Civility => Language}/new.html.twig (57%) create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Location/edit.html.twig rename src/Bundle/ChillMainBundle/Resources/views/{Admin => }/Location/index.html.twig (57%) create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Location/new.html.twig create mode 100644 src/Bundle/ChillMainBundle/Resources/views/LocationType/edit.html.twig rename src/Bundle/ChillMainBundle/Resources/views/{Admin => }/LocationType/index.html.twig (60%) create mode 100644 src/Bundle/ChillMainBundle/Resources/views/LocationType/new.html.twig delete mode 100644 src/Bundle/ChillMainBundle/translations/admin.fr.yml diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 43d85f052..0c974b637 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -357,15 +357,15 @@ class ChillMainExtension extends Extension implements 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Location/index.html.twig', + 'template' => '@ChillMain/Location/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Location/new.html.twig', + 'template' => '@ChillMain/Location/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Location/edit.html.twig', + 'template' => '@ChillMain/Location/edit.html.twig', ], ], ], @@ -379,15 +379,15 @@ class ChillMainExtension extends Extension implements 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/LocationType/index.html.twig', + 'template' => '@ChillMain/LocationType/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/LocationType/new.html.twig', + 'template' => '@ChillMain/LocationType/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/LocationType/edit.html.twig', + 'template' => '@ChillMain/LocationType/edit.html.twig', ], ], ], @@ -401,15 +401,15 @@ class ChillMainExtension extends Extension implements 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Country/index.html.twig', + 'template' => '@ChillMain/Country/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Country/new.html.twig', + 'template' => '@ChillMain/Country/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Country/edit.html.twig', + 'template' => '@ChillMain/Country/edit.html.twig', ], ], ], @@ -423,15 +423,15 @@ class ChillMainExtension extends Extension implements 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Civility/index.html.twig', + 'template' => '@ChillMain/Civility/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Civility/new.html.twig', + 'template' => '@ChillMain/Civility/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Civility/edit.html.twig', + 'template' => '@ChillMain/Civility/edit.html.twig', ], ], ], @@ -445,15 +445,15 @@ class ChillMainExtension extends Extension implements 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Language/index.html.twig', + 'template' => '@ChillMain/Language/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Language/new.html.twig', + 'template' => '@ChillMain/Language/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Language/edit.html.twig', + 'template' => '@ChillMain/Language/edit.html.twig', ], ], ], diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/edit.html.twig deleted file mode 100644 index d34d6968f..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/edit.html.twig +++ /dev/null @@ -1,39 +0,0 @@ -{% extends '@ChillMain/Admin/layout.html.twig' %} - -{% block title %} -{% include('@ChillMain/CRUD/_edit_title.html.twig') %} -{% endblock %} - -{% block admin_content %} -{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} - - {% block crud_content_form_rows %} - - {{ form_row(form.locationType) }} - -
    - {{ form_row(form.address) }} -
    - - {{ form_row(form.name) }} - -
    - {{ form_row(form.phonenumber1) }} - {{ form_row(form.phonenumber2) }} - {{ form_row(form.email) }} -
    - - {% endblock crud_content_form_rows %} - - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} -{% endblock %} - -{% block js %} - {{ encore_entry_script_tags('mod_input_address') }} - {{ encore_entry_script_tags('page_location') }} -{% endblock %} - -{% block css %} - {{ encore_entry_link_tags('mod_input_address') }} -{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/new.html.twig deleted file mode 100644 index ba25a05e0..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/new.html.twig +++ /dev/null @@ -1,39 +0,0 @@ -{% extends '@ChillMain/Admin/layout.html.twig' %} - -{% block title %} -{% include('@ChillMain/CRUD/_new_title.html.twig') %} -{% endblock %} - -{% block admin_content %} -{% embed '@ChillMain/CRUD/_new_content.html.twig' %} - - {% block crud_content_form_rows %} - - {{ form_row(form.locationType) }} - -
    - {{ form_row(form.address) }} -
    - - {{ form_row(form.name) }} - -
    - {{ form_row(form.phonenumber1) }} - {{ form_row(form.phonenumber2) }} - {{ form_row(form.email) }} -
    - - {% endblock crud_content_form_rows %} - - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} -{% endblock %} - -{% block js %} - {{ encore_entry_script_tags('mod_input_address') }} - {{ encore_entry_script_tags('page_location') }} -{% endblock %} - -{% block css %} - {{ encore_entry_link_tags('mod_input_address') }} -{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/edit.html.twig deleted file mode 100644 index ad0a38f73..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/edit.html.twig +++ /dev/null @@ -1,14 +0,0 @@ -{% extends '@ChillMain/Admin/layout.html.twig' %} - -{% block title %} -{% include('@ChillMain/CRUD/_edit_title.html.twig') %} -{% endblock %} - -{% block admin_content %} -{# {% as we are in the admin layout, we override the admin content with the CRUD content %} #} -{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} - {# we do not have "view" page. We empty the corresponding block #} - {% block content_form_actions_view %}{% endblock %} - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} -{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/new.html.twig deleted file mode 100644 index 0781272a1..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/new.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -{% extends '@ChillMain/Admin/layout.html.twig' %} - -{% block title %} -{% include('@ChillMain/CRUD/_new_title.html.twig') %} -{% endblock %} - -{% block admin_content %} -{% embed '@ChillMain/CRUD/_new_content.html.twig' %} - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} -{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Civility/edit.html.twig similarity index 57% rename from src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/edit.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Civility/edit.html.twig index 1160220a3..4d55c480c 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Civility/edit.html.twig @@ -1,7 +1,11 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block content -%} +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} {% block content_form_actions_save_and_show %}{% endblock %} {% endembed %} -{% endblock content %} +{% endblock admin_content %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Civility/index.html.twig similarity index 77% rename from src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/index.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Civility/index.html.twig index 9d28d3339..60a9c0c63 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Civility/index.html.twig @@ -1,14 +1,13 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} - {% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} id - name - abbreviation - active - ordering + {{ 'name'|trans }} + {{ 'abbreviation'|trans }} + {{ 'active'|trans }} + {{ 'ordering'|trans }} {% endblock %} {% block table_entities_tbody %} @@ -17,7 +16,13 @@ {{ entity.id }} {{ entity.name|localize_translatable_string }} {{ entity.abbreviation|localize_translatable_string }} - {{ entity.active }} + + {%- if entity.active -%} + + {%- else -%} + + {%- endif -%} + {{ entity.order }}
      diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Civility/new.html.twig similarity index 57% rename from src/Bundle/ChillMainBundle/Resources/views/Admin/Language/new.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Civility/new.html.twig index 643de1ff4..7c204dddd 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/new.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Civility/new.html.twig @@ -1,7 +1,11 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block content -%} +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} {% embed '@ChillMain/CRUD/_new_content.html.twig' %} {% block content_form_actions_save_and_show %}{% endblock %} {% endembed %} -{% endblock content %} +{% endblock admin_content %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Country/edit.html.twig similarity index 57% rename from src/Bundle/ChillMainBundle/Resources/views/Admin/Language/edit.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Country/edit.html.twig index 1160220a3..4d55c480c 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Country/edit.html.twig @@ -1,7 +1,11 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block content -%} +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} {% block content_form_actions_save_and_show %}{% endblock %} {% endembed %} -{% endblock content %} +{% endblock admin_content %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Country/index.html.twig similarity index 71% rename from src/Bundle/ChillMainBundle/Resources/views/Admin/Country/index.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Country/index.html.twig index 67aa70fd1..3a52e9383 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Country/index.html.twig @@ -1,11 +1,11 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block content %} +{% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} id - name - countryCode + {{ 'name'|trans }} + {{ 'Country code'|trans }} {% endblock %} {% block table_entities_tbody %} @@ -24,6 +24,13 @@ {% endfor %} {% endblock %} - {% endembed %} -{% endblock content %} + + {% block actions_before %} +
    • + {{'Back to the admin'|trans}} +
    • + {% endblock %} + + {% endembed %} +{% endblock admin_content %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Country/new.html.twig similarity index 57% rename from src/Bundle/ChillMainBundle/Resources/views/Admin/Country/new.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Country/new.html.twig index 643de1ff4..7c204dddd 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/new.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Country/new.html.twig @@ -1,7 +1,11 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block content -%} +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} {% embed '@ChillMain/CRUD/_new_content.html.twig' %} {% block content_form_actions_save_and_show %}{% endblock %} {% endembed %} -{% endblock content %} +{% endblock admin_content %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Language/edit.html.twig similarity index 57% rename from src/Bundle/ChillMainBundle/Resources/views/Admin/Country/edit.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Language/edit.html.twig index 1160220a3..4d55c480c 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Country/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Language/edit.html.twig @@ -1,7 +1,11 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block content -%} +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} {% block content_form_actions_save_and_show %}{% endblock %} {% endembed %} -{% endblock content %} +{% endblock admin_content %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Language/index.html.twig similarity index 96% rename from src/Bundle/ChillMainBundle/Resources/views/Admin/Language/index.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Language/index.html.twig index 21d2afca9..bfc57c0d1 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Language/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Language/index.html.twig @@ -4,7 +4,7 @@ {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} id - name + {{ 'Name'|trans }}   {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Language/new.html.twig similarity index 57% rename from src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/new.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Language/new.html.twig index b16f2eeba..7c204dddd 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/new.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Language/new.html.twig @@ -1,7 +1,11 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block content %} +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} {% embed '@ChillMain/CRUD/_new_content.html.twig' %} {% block content_form_actions_save_and_show %}{% endblock %} {% endembed %} -{% endblock content %} +{% endblock admin_content %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Location/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Location/edit.html.twig new file mode 100644 index 000000000..ac6beb235 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Location/edit.html.twig @@ -0,0 +1,39 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + + {% block crud_content_form_rows %} + + {{ form_row(form.locationType) }} + +
      + {{ form_row(form.address) }} +
      + + {{ form_row(form.name) }} + +
      + {{ form_row(form.phonenumber1) }} + {{ form_row(form.phonenumber2) }} + {{ form_row(form.email) }} +
      + + {% endblock crud_content_form_rows %} + + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} + +{% block js %} + {{ encore_entry_script_tags('mod_input_address') }} + {{ encore_entry_script_tags('page_location') }} +{% endblock %} + +{% block css %} + {{ encore_entry_link_tags('mod_input_address') }} +{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Location/index.html.twig similarity index 57% rename from src/Bundle/ChillMainBundle/Resources/views/Admin/Location/index.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Location/index.html.twig index aa883c603..913a975cd 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Location/index.html.twig @@ -1,20 +1,16 @@ -{% extends "@ChillMain/Admin/layout_location.html.twig" %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} {% block admin_content %} -

      {{ 'Location list'|trans }}

      - - - - - - - - - - - - - + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + + + + + + + {% endblock %} + {% block table_entities_tbody %} {% for entity in entities %} @@ -44,17 +40,12 @@ {% endfor %} - -
      {{ 'Name'|trans }}{{ 'Phonenumber1'|trans }}{{ 'Phonenumber2'|trans }}{{ 'Email'|trans }}{{ 'Address'|trans }}{{ 'Active'|trans }}
      {{ 'Name'|trans }}{{ 'Phonenumber1'|trans }}{{ 'Phonenumber2'|trans }}{{ 'Email'|trans }}{{ 'Address'|trans }}{{ 'Active'|trans }}
      {{ entity.name }}
      + {% endblock %} - {{ chill_pagination(paginator) }} - - + {% block actions_before %} +
    • + {{'Back to the admin'|trans}} +
    • + {% endblock %} + {% endembed %} {% endblock %} - diff --git a/src/Bundle/ChillMainBundle/Resources/views/Location/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Location/new.html.twig new file mode 100644 index 000000000..493ad6f71 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Location/new.html.twig @@ -0,0 +1,39 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + + {% block crud_content_form_rows %} + + {{ form_row(form.locationType) }} + +
      + {{ form_row(form.address) }} +
      + + {{ form_row(form.name) }} + +
      + {{ form_row(form.phonenumber1) }} + {{ form_row(form.phonenumber2) }} + {{ form_row(form.email) }} +
      + + {% endblock crud_content_form_rows %} + + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} + +{% block js %} + {{ encore_entry_script_tags('mod_input_address') }} + {{ encore_entry_script_tags('page_location') }} +{% endblock %} + +{% block css %} + {{ encore_entry_link_tags('mod_input_address') }} +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/Resources/views/LocationType/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/LocationType/edit.html.twig new file mode 100644 index 000000000..4d55c480c --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/LocationType/edit.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/LocationType/index.html.twig similarity index 60% rename from src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/index.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/LocationType/index.html.twig index 22cb6de44..16b31dd77 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/LocationType/index.html.twig @@ -1,21 +1,17 @@ -{% extends "@ChillMain/Admin/layout_location.html.twig" %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} {% block admin_content %} -

      {{ 'Location type list'|trans }}

      - - - - - - - - - - - - - - + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + + + + + + + + {% endblock %} + {% block table_entities_tbody %} {% for entity in entities %} @@ -52,14 +48,12 @@ {% endfor %} - -
      {{ 'Title'|trans }}{{ 'Available for users'|trans }}{{ 'Editable by users'|trans }}{{ 'Address required'|trans }}{{ 'Contact data'|trans }}{{ 'Active'|trans }}{{ 'Default for'|trans }}
      {{ 'Title'|trans }}{{ 'Available for users'|trans }}{{ 'Editable by users'|trans }}{{ 'Address required'|trans }}{{ 'Contact data'|trans }}{{ 'Active'|trans }}{{ 'Default for'|trans }}
      {{ entity.title | localize_translatable_string }}
      + {% endblock %} - -{% endblock %} + {% block actions_before %} +
    • + {{'Back to the admin'|trans}} +
    • + {% endblock %} + {% endembed %} +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/Resources/views/LocationType/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/LocationType/new.html.twig new file mode 100644 index 000000000..7c204dddd --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/LocationType/new.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php index b21f83846..cfbc2a78d 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php @@ -62,7 +62,7 @@ class AdminSectionMenuBuilder implements LocalMenuBuilderInterface $menu->addChild('Languages and countries') ->setAttribute('class', 'list-group-item-header') - ->setExtras(['order' => 200, 'header' => 'true']); + ->setExtras(['order' => 200, 'header' => true]); $menu->addChild('Language list', [ 'route' => 'chill_crud_main_language_index', @@ -76,7 +76,7 @@ class AdminSectionMenuBuilder implements LocalMenuBuilderInterface $menu->addChild('Location and location type') ->setAttribute('class', 'list-group-item-header') - ->setExtras(['order' => 300, 'header' => 'true']); + ->setExtras(['order' => 300, 'header' => true]); $menu->addChild('Location type list', [ 'route' => 'chill_crud_main_location_type_index', diff --git a/src/Bundle/ChillMainBundle/translations/admin.fr.yml b/src/Bundle/ChillMainBundle/translations/admin.fr.yml deleted file mode 100644 index c2d522a12..000000000 --- a/src/Bundle/ChillMainBundle/translations/admin.fr.yml +++ /dev/null @@ -1,4 +0,0 @@ -welcome_message_raw: | -

      Dans l'interface d'administration, vous pouvez configurer votre instance selon vos besoins.

      - - diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index e679db535..cd76aed98 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -120,7 +120,7 @@ Main admin menu: Menu d'administration principal Actions: Actions Users and permissions: Utilisateurs et permissions Location and location type: Localisations et types de localisation -Back to the admin: Retour +Back to the admin: Menu d'administration #permissions Permissions Menu: Gestion des droits @@ -224,6 +224,8 @@ none: aucun person: usager thirdparty: tiers +#admin section for civility +abbreviation: abbréviation #admin section for language and country Language and countries menu: Menu Langues & Pays @@ -232,6 +234,7 @@ Management of languages and countries: Gestion des langues & pays Configure languages and countries: Configuration des langues & pays Language list: Liste des langues Country list: Liste des pays +Country code: Code du pays # circles / scopes Choose the circle: Choisir le cercle @@ -349,9 +352,15 @@ crud: title_new: Nouveau métier title_edit: Modifier un métier main_location_type: + index: + title: Liste des types de localisations + add_new: Ajouter un type de localisation title_new: Nouveau type de localisation title_edit: Modifier un type de localisation main_location: + index: + title: Liste des localisations + add_new: Ajouter une localisation title_new: Nouvelle localisation title_edit: Modifier une localisation main_language: From ba495def7e3d7f9d0666259b8f1c1586c6a13ba0 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 5 May 2022 09:47:17 +0200 Subject: [PATCH 15/49] admin: refactor templates and delete some show pages for Center, Scope, User, UserJob, PermissionsGroup --- .../Controller/CenterController.php | 2 +- .../Controller/ScopeController.php | 2 +- .../ChillMainExtension.php | 2 + .../Resources/views/Center/edit.html.twig | 16 ++-- .../Resources/views/Center/index.html.twig | 28 ++++--- .../Resources/views/Center/new.html.twig | 16 ++-- .../Resources/views/Center/show.html.twig | 29 ------- .../views/PermissionsGroup/edit.html.twig | 76 +++++++++---------- .../views/PermissionsGroup/index.html.twig | 27 ++++--- .../views/PermissionsGroup/new.html.twig | 16 ++-- .../views/PermissionsGroup/show.html.twig | 23 +++--- .../Resources/views/Scope/edit.html.twig | 20 ++--- .../Resources/views/Scope/index.html.twig | 28 ++++--- .../Resources/views/Scope/new.html.twig | 18 ++--- .../Resources/views/Scope/show.html.twig | 29 ------- .../Resources/views/User/edit.html.twig | 2 +- .../views/User/edit_password.html.twig | 2 +- .../Resources/views/User/index.html.twig | 7 +- .../Resources/views/User/new.html.twig | 4 +- .../Resources/views/User/show.html.twig | 10 +-- .../Resources/views/UserJob/edit.html.twig | 11 +++ .../Resources/views/UserJob/index.html.twig | 22 +++++- .../Resources/views/UserJob/new.html.twig | 11 +++ .../MenuBuilder/AdminSectionMenuBuilder.php | 5 -- .../ChillMainBundle/config/routes/center.yaml | 4 - .../ChillMainBundle/config/routes/scope.yaml | 4 - .../translations/messages.fr.yml | 21 +++-- 27 files changed, 207 insertions(+), 228 deletions(-) delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Center/show.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Scope/show.html.twig create mode 100644 src/Bundle/ChillMainBundle/Resources/views/UserJob/edit.html.twig create mode 100644 src/Bundle/ChillMainBundle/Resources/views/UserJob/new.html.twig diff --git a/src/Bundle/ChillMainBundle/Controller/CenterController.php b/src/Bundle/ChillMainBundle/Controller/CenterController.php index 729f2b243..005fa4a01 100644 --- a/src/Bundle/ChillMainBundle/Controller/CenterController.php +++ b/src/Bundle/ChillMainBundle/Controller/CenterController.php @@ -36,7 +36,7 @@ class CenterController extends AbstractController $em->persist($center); $em->flush(); - return $this->redirect($this->generateUrl('admin_center_show', ['id' => $center->getId()])); + return $this->redirect($this->generateUrl('admin_center')); } return $this->render('@ChillMain/Center/new.html.twig', [ diff --git a/src/Bundle/ChillMainBundle/Controller/ScopeController.php b/src/Bundle/ChillMainBundle/Controller/ScopeController.php index 74ebc73a7..5dc85d201 100644 --- a/src/Bundle/ChillMainBundle/Controller/ScopeController.php +++ b/src/Bundle/ChillMainBundle/Controller/ScopeController.php @@ -36,7 +36,7 @@ class ScopeController extends AbstractController $em->persist($scope); $em->flush(); - return $this->redirect($this->generateUrl('admin_scope_show', ['id' => $scope->getId()])); + return $this->redirect($this->generateUrl('admin_scope')); } return $this->render('@ChillMain/Scope/new.html.twig', [ diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 0c974b637..a62ca88f3 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -319,9 +319,11 @@ class ChillMainExtension extends Extension implements ], 'new' => [ 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/UserJob/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/UserJob/edit.html.twig', ], ], ], diff --git a/src/Bundle/ChillMainBundle/Resources/views/Center/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Center/edit.html.twig index d2018e2d3..30bea2d6e 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Center/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Center/edit.html.twig @@ -1,4 +1,4 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'Center edit'|trans }}{% endblock %} @@ -10,11 +10,11 @@ {{ form_row(edit_form.submit, { 'attr' : { 'class' : 'btn btn-chill-green' } } ) }} {{ form_end(edit_form) }} - + {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Center/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Center/index.html.twig index 5ebd271b5..d6d4bb4cd 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Center/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Center/index.html.twig @@ -1,4 +1,4 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'Center list'|trans }}{% endblock %} @@ -15,27 +15,25 @@ {% for entity in entities %} - {{ entity.name }} + {{ entity.name }} - + {% endfor %} -
        + - {% endblock %} +{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Center/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Center/new.html.twig index b100d0b8b..ef614722b 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Center/new.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Center/new.html.twig @@ -1,4 +1,4 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'Center creation'|trans }}{% endblock %} @@ -10,11 +10,11 @@ {{ form_row(form.submit, { 'attr' : { 'class' : 'btn btn-chill-green' } } ) }} {{ form_end(form) }} - + {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Center/show.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Center/show.html.twig deleted file mode 100644 index b471fa2d1..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Center/show.html.twig +++ /dev/null @@ -1,29 +0,0 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} - -{% block title %}{{ 'Centre %name%'|trans({ '%name%': entity.name }) }}{% endblock %} - -{% block admin_content -%} -

        {{ 'Centre %name%'|trans({ '%name%': entity.name }) }}

        - - - - - - - - -
        {{ 'Name'|trans }}{{ entity.name }}
        - - -{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig index 9054176d7..f61c8f2c8 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig @@ -1,12 +1,12 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}{% endblock %} {% block admin_content -%}

        {{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}

        - +

        {{ 'Details'|trans }}

        - + {{ form_start(edit_form) }} {{ form_row(edit_form.name) }} {% if edit_form.flags is defined %} @@ -14,28 +14,28 @@ {% endif %} {{ form_row(edit_form.submit, { 'attr': { 'class': 'btn btn-chill-green' } } ) }} {{ form_end(edit_form) }} - +

        {{ 'Grant those permissions'|trans }} :

        - + {%- if entity.getRoleScopes|length > 0 -%} {% for title, role_scopes in role_scopes_sorted %} - +

        {{ title|default("Unclassified")|trans }}

        - + - + - + {% for role_scope in role_scopes %} - + {% endfor %}
        {{ 'Role'|trans }} {{ 'Circle'|trans }} {{ 'Actions'|trans }}
        - {{ role_scope.role|trans }} + {{ role_scope.role|trans }} {% if expanded_roles[role_scope.role]|length > 1 %}
        {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %} @@ -56,40 +56,40 @@ {{ form_end(delete_role_scopes_form[role_scope.id]) }}
        {% endfor %} - + {%- else -%}

        {{ 'This group does not provide any permission'|trans }}

        {%- endif -%} - -

        {{ 'Grant new permissions'|trans }}

        - - {{ form_start(add_role_scopes_form) }} - {{ form_errors(add_role_scopes_form) }} - {{ form_row(add_role_scopes_form.composed_role_scope.role) }} - {{ form_row(add_role_scopes_form.composed_role_scope.scope) }} - - - - - {{ form_end(add_role_scopes_form) }} - - +
        +

        {{ 'Grant new permissions'|trans }}

        + + {{ form_start(add_role_scopes_form) }} + {{ form_errors(add_role_scopes_form) }} + {{ form_row(add_role_scopes_form.composed_role_scope.role) }} + {{ form_row(add_role_scopes_form.composed_role_scope.scope) }} + + + + {{ form_end(add_role_scopes_form) }} +
        + + {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig index cc3cabc48..1b35e9799 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig @@ -1,4 +1,4 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'Permissions group list'|trans }}{% endblock %} @@ -15,27 +15,30 @@ {% for entity in entities %} - {{ entity.name }} + {{ entity.name }} - + {% endfor %} -
          + - {% endblock %} +{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/new.html.twig index 76474f220..921db8e6d 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/new.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/new.html.twig @@ -1,4 +1,4 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'New permission group'|trans }}{% endblock %} @@ -13,11 +13,11 @@ {{ form_row(form.submit, { 'attr': { 'class': 'btn btn-chill-green' } } ) }} {{ form_end(form) }} - + {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig index b94b5204d..fbbe6245b 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig @@ -1,4 +1,4 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'Permission group "%name%"'|trans({ '%name%': entity.name }) }}{% endblock %} @@ -13,9 +13,9 @@ - {% if role_scopes_sorted|length > 0 %} + {% if role_scopes_sorted|length > 0 %}

          {{ 'Grant those permissions'|trans }} :

          - + {% for title, role_scopes in role_scopes_sorted %}

          {{ title|default('Unclassified')|trans }}

          @@ -23,14 +23,14 @@ - + - + {% for role_scope in role_scopes %}
          {{ 'Role'|trans }} {{ 'Circle'|trans }}
          - {{ role_scope.role|trans }} + {{ role_scope.role|trans }} {% if expanded_roles[role_scope.role]|length > 1 %}
          {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %} @@ -47,16 +47,17 @@
          {% endfor %} - + {% else %} - -

          {{ 'This group does not provide any permission'|trans }}. +

          {{ 'This group does not provide any permission'|trans }}. - {{ 'add permissions'|trans|capitalize }}

          + {{ 'add permissions'|trans|capitalize }} + +

          {% endif %}
            - +
          • {{ 'Edit'|trans }} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Scope/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Scope/edit.html.twig index 2f1098761..6330f2b26 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Scope/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Scope/edit.html.twig @@ -1,20 +1,20 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'Circle edit'|trans }}{% endblock %} -{% block admin_content -%} +{% block admin_content %}

            {{ 'Circle edit'|trans }}

            - + {{ form_start(edit_form) }} {{ form_row(edit_form.name) }} {{ form_row(edit_form.submit, { 'attr' : { 'class' : 'btn btn-chill-green' } } ) }} {{ form_end(edit_form) }} -
            + {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Scope/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Scope/index.html.twig index 5167b9d07..444ba2cc5 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Scope/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Scope/index.html.twig @@ -1,4 +1,4 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'List circles'|trans }}{% endblock %} @@ -15,27 +15,25 @@ {% for entity in entities %} - {{ entity.name|localize_translatable_string }} + {{ entity.name|localize_translatable_string }} - + {% endfor %} -
              + - {% endblock %} +{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Scope/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Scope/new.html.twig index 0807e6088..56eb110d0 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Scope/new.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Scope/new.html.twig @@ -1,8 +1,8 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'Circle creation'|trans }}{% endblock %} -{% block admin_content -%} +{% block admin_content %}

              {{ 'Circle creation'|trans }}

              {{ form_start(form) }} @@ -10,11 +10,11 @@ {{ form_row(form.submit, { 'attr' : { 'class' : 'btn btn-chill-green' } } ) }} {{ form_end(form) }} - + {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Scope/show.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Scope/show.html.twig deleted file mode 100644 index 57c573368..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Scope/show.html.twig +++ /dev/null @@ -1,29 +0,0 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} - -{% block title %}{{ 'Circle'|trans }}{% endblock %} - -{% block admin_content -%} -

              {{ 'Circle'|trans }}

              - - - - - - - - -
              {{ 'Name'|trans }}{{ entity.name|localize_translatable_string }}
              - - -{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig index 0ea1d529c..0fa376b34 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig @@ -1,4 +1,4 @@ -{% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block admin_content -%} {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/edit_password.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/edit_password.html.twig index c26f6cf24..c1972c211 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/edit_password.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/edit_password.html.twig @@ -1,4 +1,4 @@ -{% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'Edit password for %username%'|trans( { '%username%': entity.username } ) }}{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig index 83a82f140..46fb7aa29 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig @@ -1,6 +1,6 @@ -{% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} -{% block admin_content -%} +{% block admin_content %}

              {{"Users"|trans}}

              {% for entity in entities %} @@ -60,6 +60,9 @@ {{ chill_pagination(paginator) }}
                +
              • + {{'Back to the admin'|trans}} +
              • {{ 'Create'|trans }}
              • diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/new.html.twig index f0757b25d..bba2a8583 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/new.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/new.html.twig @@ -1,6 +1,6 @@ -{% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} -{% block admin_content -%} +{% block admin_content %} {% embed '@ChillMain/CRUD/_new_content.html.twig' %} {% block content_form_actions_save_and_show %}{% endblock %} {% endembed %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/show.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/show.html.twig index ebf390dea..e03392e10 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/show.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/show.html.twig @@ -1,8 +1,8 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'User %username%'|trans({ '%username%': entity.username }) }}{% endblock %} -{% block admin_content -%} +{% block admin_content %}

                {{ 'User %username%'|trans({ '%username%': entity.username }) }}

                @@ -23,9 +23,9 @@
                - +

                {{ 'Permissions granted'|trans }}

                - + {% if entity.groupcenters|length > 0 %} @@ -52,7 +52,7 @@ {% endfor %}
                - + {% else %}

                {{ 'Any permissions granted to this user'|trans }}. 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..4d55c480c --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/UserJob/edit.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig index 8f037f150..3d56265dc 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig @@ -1,10 +1,11 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block content %} +{% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} id - label + {{ 'label'|trans }} + {{ 'active'|trans }}   {% endblock %} {% block table_entities_tbody %} @@ -12,6 +13,13 @@ {{ entity.id }} {{ entity.label|localize_translatable_string }} + + {%- if entity.active -%} + + {%- else -%} + + {%- endif -%} +

                - {% endfor %} + {% endfor %} + {% endblock %} + + {% block actions_before %} +
              • + {{'Back to the admin'|trans}} +
              • {% endblock %} {% endembed %} -{% endblock content %} +{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/UserJob/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/UserJob/new.html.twig new file mode 100644 index 000000000..7c204dddd --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/UserJob/new.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php index cfbc2a78d..2225fdd0e 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php @@ -58,8 +58,6 @@ class AdminSectionMenuBuilder implements LocalMenuBuilderInterface 'route' => 'chill_crud_admin_user_job_index', ])->setExtras(['order' => 150]); - - $menu->addChild('Languages and countries') ->setAttribute('class', 'list-group-item-header') ->setExtras(['order' => 200, 'header' => true]); @@ -72,8 +70,6 @@ class AdminSectionMenuBuilder implements LocalMenuBuilderInterface 'route' => 'chill_crud_main_country_index', ])->setExtras(['order' => 220]); - - $menu->addChild('Location and location type') ->setAttribute('class', 'list-group-item-header') ->setExtras(['order' => 300, 'header' => true]); @@ -85,7 +81,6 @@ class AdminSectionMenuBuilder implements LocalMenuBuilderInterface $menu->addChild('Location list', [ 'route' => 'chill_crud_main_location_index', ])->setExtras(['order' => 320]); - } public static function getMenuIds(): array diff --git a/src/Bundle/ChillMainBundle/config/routes/center.yaml b/src/Bundle/ChillMainBundle/config/routes/center.yaml index 9dc322bc1..c0bef7695 100644 --- a/src/Bundle/ChillMainBundle/config/routes/center.yaml +++ b/src/Bundle/ChillMainBundle/config/routes/center.yaml @@ -2,10 +2,6 @@ admin_center: path: / controller: Chill\MainBundle\Controller\CenterController::indexAction -admin_center_show: - path: /{id}/show - controller: Chill\MainBundle\Controller\CenterController::showAction - admin_center_new: path: /new controller: Chill\MainBundle\Controller\CenterController::newAction diff --git a/src/Bundle/ChillMainBundle/config/routes/scope.yaml b/src/Bundle/ChillMainBundle/config/routes/scope.yaml index c7ea32718..167aa401c 100644 --- a/src/Bundle/ChillMainBundle/config/routes/scope.yaml +++ b/src/Bundle/ChillMainBundle/config/routes/scope.yaml @@ -2,10 +2,6 @@ admin_scope: path: / controller: Chill\MainBundle\Controller\ScopeController::indexAction -admin_scope_show: - path: /{id}/show - controller: Chill\MainBundle\Controller\ScopeController::showAction - admin_scope_new: path: /new controller: Chill\MainBundle\Controller\ScopeController::newAction diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index cd76aed98..b16e1433b 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -121,6 +121,9 @@ Actions: Actions Users and permissions: Utilisateurs et permissions Location and location type: Localisations et types de localisation Back to the admin: Menu d'administration +"Administration interface": Interface d'administration +Welcome to the admin section !: > + Bienvenue dans l'interface d'administration ! #permissions Permissions Menu: Gestion des droits @@ -130,11 +133,6 @@ Permissions management of your chill installation: Gestion des permissions de vo Location Menu: Localisations et types de localisation Management of location: Gestion des localisations et types de localisation -#admin section -"Administration interface": Interface d'administration -Welcome to the admin section !: > - Bienvenue dans l'interface d'administration ! - #admin section for center's administration Create a new center: Créer un nouveau centre Center list: Liste des centres @@ -150,7 +148,7 @@ Permission group "%name%": Groupe de permissions "%name%" Grant those permissions: Attribue ces permissions Which implies: Ce qui implique Permission group: Groupe de permissions -Permissionsgroup: Group de permissions +Permissionsgroup: Groupe de permissions New permission group: Nouveau groupe de permissions PermissionsGroup "%name%" edit: Modification du groupe de permission '%name%' Role: Rôle @@ -159,6 +157,7 @@ Add permission: Ajouter les permissions This group does not provide any permission: Ce groupe n'attribue aucune permission The role '%role%' has been removed: Le rôle "%role%" a été enlevé de ce groupe de permission The role '%role%' on circle '%scope%' has been removed: Le rôle "%role%" sur le cercle "%scope%" a été enlevé de ce groupe de permission +Unclassified: Non classifié #admin section for users User edit: Modification d'un utilisateur @@ -182,6 +181,14 @@ Change password: Changer le mot de passe Back to the user edition: Retour au formulaire d'édition Password successfully updated!: Mot de passe mis à jour Flags: Drapeaux +Main location: Localisation principale +Main scope: Cercle +Main center: Centre +user job: Métier de l'utilisateur +Choose a main center: Choisir un centre +Choose a main scope: Choisir un cercle +choose a job: Choisir un métier +choose a location: Choisir une localisation # admin section for users jobs User jobs: Métiers @@ -345,6 +352,8 @@ crud: index: title: Utilisateurs add_new: Créer + title_edit: Modifier un utilisateur + title_new: Créer un utilisateur admin_user_job: index: title: Métiers From 47f47ac01775daedda2e9127393e3d867e48e5c1 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 5 May 2022 10:11:12 +0200 Subject: [PATCH 16/49] admin: delete obsolet country controller --- .../Controller/AdminCountryCRUDController.php | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 src/Bundle/ChillMainBundle/Controller/AdminCountryCRUDController.php diff --git a/src/Bundle/ChillMainBundle/Controller/AdminCountryCRUDController.php b/src/Bundle/ChillMainBundle/Controller/AdminCountryCRUDController.php deleted file mode 100644 index a0447a1c7..000000000 --- a/src/Bundle/ChillMainBundle/Controller/AdminCountryCRUDController.php +++ /dev/null @@ -1,18 +0,0 @@ - Date: Thu, 5 May 2022 10:39:20 +0200 Subject: [PATCH 17/49] admin: reorganise person admin menu + fix marital status admin --- .../MenuBuilder/AdminSectionMenuBuilder.php | 24 +++++++++---------- .../Controller/AdminController.php | 10 -------- .../Menu/AdminMenuBuilder.php | 13 +++++----- .../views/MaritalStatus/edit.html.twig | 5 ++-- .../views/MaritalStatus/index.html.twig | 10 ++++++-- .../views/MaritalStatus/new.html.twig | 5 ++-- .../ChillPersonBundle/config/routes.yaml | 4 ---- 7 files changed, 32 insertions(+), 39 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php index 2225fdd0e..6347794a8 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php @@ -36,51 +36,51 @@ class AdminSectionMenuBuilder implements LocalMenuBuilderInterface $menu->addChild('Users and permissions') ->setAttribute('class', 'list-group-item-header') - ->setExtras(['order' => 100, 'header' => true]); + ->setExtras(['order' => 1000, 'header' => true]); $menu->addChild('Center list', [ 'route' => 'admin_center', - ])->setExtras(['order' => 110]); + ])->setExtras(['order' => 1010]); $menu->addChild('List circles', [ 'route' => 'admin_scope', - ])->setExtras(['order' => 120]); + ])->setExtras(['order' => 1020]); $menu->addChild('Permissions group list', [ 'route' => 'admin_permissionsgroup', - ])->setExtras(['order' => 130]); + ])->setExtras(['order' => 1030]); $menu->addChild('crud.admin_user.index.title', [ 'route' => 'chill_crud_admin_user_index', - ])->setExtras(['order' => 140]); + ])->setExtras(['order' => 1040]); $menu->addChild('User jobs', [ 'route' => 'chill_crud_admin_user_job_index', - ])->setExtras(['order' => 150]); + ])->setExtras(['order' => 1050]); $menu->addChild('Languages and countries') ->setAttribute('class', 'list-group-item-header') - ->setExtras(['order' => 200, 'header' => true]); + ->setExtras(['order' => 1200, 'header' => true]); $menu->addChild('Language list', [ 'route' => 'chill_crud_main_language_index', - ])->setExtras(['order' => 210]); + ])->setExtras(['order' => 1210]); $menu->addChild('Country list', [ 'route' => 'chill_crud_main_country_index', - ])->setExtras(['order' => 220]); + ])->setExtras(['order' => 1220]); $menu->addChild('Location and location type') ->setAttribute('class', 'list-group-item-header') - ->setExtras(['order' => 300, 'header' => true]); + ->setExtras(['order' => 1300, 'header' => true]); $menu->addChild('Location type list', [ 'route' => 'chill_crud_main_location_type_index', - ])->setExtras(['order' => 310]); + ])->setExtras(['order' => 1310]); $menu->addChild('Location list', [ 'route' => 'chill_crud_main_location_index', - ])->setExtras(['order' => 320]); + ])->setExtras(['order' => 1320]); } public static function getMenuIds(): array diff --git a/src/Bundle/ChillPersonBundle/Controller/AdminController.php b/src/Bundle/ChillPersonBundle/Controller/AdminController.php index 9d16bdc13..813f36983 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AdminController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AdminController.php @@ -18,16 +18,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; */ class AdminController extends AbstractController { - /** - * @param $_locale - * - * @return \Symfony\Component\HttpFoundation\Response - */ - public function indexAction($_locale) - { - return $this->render('ChillPersonBundle:Admin:layout.html.twig', []); - } - /** * @return \Symfony\Component\HttpFoundation\RedirectResponse */ diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php index 25996f7bf..6004bb1cb 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php @@ -33,12 +33,13 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface return; } - $menu->addChild('Person', [ - 'route' => 'chill_person_admin', - ]) - ->setExtras([ - 'order' => 20, - ]); + $menu->addChild('Person') + ->setAttribute('class', 'list-group-item-header') + ->setExtras(['order' => 2000, 'header' => true]); + + $menu->addChild('Marital status', [ + 'route' => 'chill_crud_person_marital-status_index', + ])->setExtras(['order' => 2010]); } public static function getMenuIds(): array diff --git a/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/edit.html.twig index e61f3f7c0..28678bf6d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/edit.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/edit.html.twig @@ -4,9 +4,8 @@ {% include('@ChillMain/CRUD/_edit_title.html.twig') %} {% endblock %} -{% block content %} +{% block admin_content %} {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} - {% block content_form_actions_view %}{% endblock %} {% block content_form_actions_save_and_show %}{% endblock %} {% endembed %} -{% endblock %} \ No newline at end of file +{% endblock admin_content %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/index.html.twig index ce8202fb2..a7aca2235 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/index.html.twig @@ -1,6 +1,6 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block content %} +{% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} {{ 'Id'|trans }} @@ -21,7 +21,13 @@
              - {% endfor %} + {% endfor %} + {% endblock %} + + {% block actions_before %} +
            • + {{'Back to the admin'|trans}} +
            • {% endblock %} {% endembed %} {% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/new.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/new.html.twig index 52a1d140b..3a28dd85f 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/new.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/MaritalStatus/new.html.twig @@ -4,8 +4,9 @@ {% include('@ChillMain/CRUD/_new_title.html.twig') %} {% endblock %} -{% block content %} +{% block admin_content %} {% embed '@ChillMain/CRUD/_new_content.html.twig' %} {% block content_form_actions_save_and_show %}{% endblock %} {% endembed %} -{% endblock %} +{% endblock admin_content %} + diff --git a/src/Bundle/ChillPersonBundle/config/routes.yaml b/src/Bundle/ChillPersonBundle/config/routes.yaml index bec2af134..5d17d6ffe 100644 --- a/src/Bundle/ChillPersonBundle/config/routes.yaml +++ b/src/Bundle/ChillPersonBundle/config/routes.yaml @@ -96,10 +96,6 @@ chill_person_timeline: path: /{_locale}/person/{person_id}/timeline controller: Chill\PersonBundle\Controller\TimelinePersonController::personAction -chill_person_admin: - path: "/{_locale}/admin/person" - controller: Chill\PersonBundle\Controller\AdminController::indexAction - chill_person_duplicate_view: path: /{_locale}/person/{person_id}/duplicate/view controller: Chill\PersonBundle\Controller\PersonDuplicateController::viewAction From 5daf09334baf75cd5b62cba171ad2132fbb12816 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 5 May 2022 12:07:45 +0200 Subject: [PATCH 18/49] admin: admin section for social work related entities: SocialIssue, SocialAction, Goal, Result, Evaluation --- .../SocialWork/AdminEvaluationController.php | 22 ------------ .../SocialWork/AdminGoalController.php | 22 ------------ .../SocialWork/AdminResultController.php | 22 ------------ .../AdminSocialActionController.php | 22 ------------ .../SocialWork/AdminSocialIssueController.php | 22 ------------ .../SocialWork/EvaluationController.php | 26 ++++++++++++++ .../Controller/SocialWork/GoalController.php | 26 ++++++++++++++ .../SocialWork/ResultController.php | 26 ++++++++++++++ .../SocialWork/SocialActionController.php | 26 ++++++++++++++ .../SocialWork/SocialIssueController.php | 26 ++++++++++++++ .../ChillPersonExtension.php | 10 +++--- .../Entity/SocialWork/Evaluation.php | 4 +-- .../Entity/SocialWork/Result.php | 2 +- .../Form/SocialWork/EvaluationType.php | 12 +++++-- .../Form/SocialWork/GoalType.php | 8 ++--- .../Form/SocialWork/ResultType.php | 11 +++--- .../Form/SocialWork/SocialActionType.php | 15 ++++---- .../Form/SocialWork/SocialIssueType.php | 8 ++--- .../Menu/AdminMenuBuilder.php | 30 +++++++++++++++- .../SocialWork/Evaluation/index.html.twig | 36 +++++++++++-------- .../views/SocialWork/Goal/index.html.twig | 12 +++++-- .../views/SocialWork/Result/index.html.twig | 12 +++++-- .../SocialWork/SocialAction/index.html.twig | 12 +++++-- .../SocialWork/SocialIssue/index.html.twig | 12 +++++-- .../Resources/views/SocialWork/edit.html.twig | 15 ++++---- .../Resources/views/SocialWork/new.html.twig | 16 +++++---- .../translations/messages.fr.yml | 27 +++++++++++--- 27 files changed, 290 insertions(+), 192 deletions(-) delete mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminEvaluationController.php delete mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminGoalController.php delete mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminResultController.php delete mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminSocialActionController.php delete mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminSocialIssueController.php create mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/EvaluationController.php create mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php create mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php create mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php create mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminEvaluationController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminEvaluationController.php deleted file mode 100644 index 8105066e9..000000000 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminEvaluationController.php +++ /dev/null @@ -1,22 +0,0 @@ -addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php new file mode 100644 index 000000000..38bd13267 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php new file mode 100644 index 000000000..f2d9a1d4d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php new file mode 100644 index 000000000..ccb657da7 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php new file mode 100644 index 000000000..5531d1e4b --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index 8fc17bf2a..8dad7e6ff 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -190,7 +190,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'name' => 'social_issue', 'base_path' => '/admin/social-work/social-issue', 'form_class' => \Chill\PersonBundle\Form\SocialWork\SocialIssueType::class, - 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminSocialIssueController::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\SocialIssueController::class, 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', @@ -211,7 +211,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'name' => 'social_action', 'base_path' => '/admin/social-work/social-action', 'form_class' => \Chill\PersonBundle\Form\SocialWork\SocialActionType::class, - 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminSocialActionController::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\SocialActionController::class, 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', @@ -232,7 +232,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'name' => 'social_goal', 'base_path' => '/admin/social-work/goal', 'form_class' => \Chill\PersonBundle\Form\SocialWork\GoalType::class, - 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminGoalController::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\GoalController::class, 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', @@ -253,7 +253,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'name' => 'social_result', 'base_path' => '/admin/social-work/result', 'form_class' => \Chill\PersonBundle\Form\SocialWork\ResultType::class, - 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminResultController::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\ResultController::class, 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', @@ -274,7 +274,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'name' => 'social_evaluation', 'base_path' => '/admin/social-work/evaluation', 'form_class' => \Chill\PersonBundle\Form\SocialWork\EvaluationType::class, - 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminEvaluationController::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\EvaluationController::class, 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php index 9349c335e..e9c7496ff 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php @@ -121,14 +121,14 @@ class Evaluation return $this; } - public function setDelay(DateInterval $delay): self + public function setDelay(?DateInterval $delay): self { $this->delay = $delay; return $this; } - public function setNotificationDelay(DateInterval $notificationDelay): self + public function setNotificationDelay(?DateInterval $notificationDelay): self { $this->notificationDelay = $notificationDelay; diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php index b4a9b6aa2..e147ec9d8 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php @@ -45,7 +45,7 @@ class Result /** * @ORM\Column(type="datetime", nullable=true) */ - private DateTime $desactivationDate; + private ?DateTime $desactivationDate; /** * @ORM\ManyToMany(targetEntity=Goal::class, mappedBy="results") diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php index 0c6bb0d32..bbe82b59f 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\Form\SocialWork; +use Chill\MainBundle\Form\Type\DateIntervalType; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Entity\SocialWork\Evaluation; @@ -39,9 +40,14 @@ class EvaluationType extends AbstractType ->add('title', TranslatableStringFormType::class, [ 'label' => 'Nom', ]) - ->add('delay') - - ->add('notificationDelay'); + ->add('delay', DateIntervalType::class, [ + 'label' => 'evaluation.delay', + 'required' => false, + ]) + ->add('notificationDelay', DateIntervalType::class, [ + 'label' => 'evaluation.notificationDelay', + 'required' => false, + ]); } public function configureOptions(OptionsResolver $resolver) diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php index 4ea0a5e70..f1005d696 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php @@ -11,13 +11,13 @@ declare(strict_types=1); namespace Chill\PersonBundle\Form\SocialWork; +use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Entity\SocialWork\Goal; use Chill\PersonBundle\Entity\SocialWork\SocialAction; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\Extension\Core\Type\DateType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -52,11 +52,9 @@ class GoalType extends AbstractType }, ]) - ->add('desactivationDate', DateType::class, [ - 'attr' => ['class' => 'datepicker'], - 'widget' => 'single_text', - 'format' => 'dd-MM-yyyy', + ->add('desactivationDate', ChillDateType::class, [ 'required' => false, + 'label' => 'goal.desactivationDate', ]); } diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php index a0219aaf3..b8a130950 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php @@ -11,11 +11,11 @@ declare(strict_types=1); namespace Chill\PersonBundle\Form\SocialWork; +use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Entity\SocialWork\Result; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\Extension\Core\Type\DateType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -40,13 +40,10 @@ class ResultType extends AbstractType ->add('title', TranslatableStringFormType::class, [ 'label' => 'Nom', ]) - ->add('accompanyingPeriodWorks') - ->add('accompanyingPeriodWorkGoals') - ->add('desactivationDate', DateType::class, [ - 'attr' => ['class' => 'datepicker'], - 'widget' => 'single_text', - 'format' => 'dd-MM-yyyy', + + ->add('desactivationDate', ChillDateType::class, [ 'required' => false, + 'label' => 'goal.desactivationDate', ]); } diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php index 1f1ae0810..c476a899f 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php @@ -11,13 +11,14 @@ declare(strict_types=1); namespace Chill\PersonBundle\Form\SocialWork; +use Chill\MainBundle\Form\Type\ChillDateType; +use Chill\MainBundle\Form\Type\DateIntervalType; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Entity\SocialWork\SocialAction; use Chill\PersonBundle\Entity\SocialWork\SocialIssue; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\Extension\Core\Type\DateType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -44,6 +45,7 @@ class SocialActionType extends AbstractType ]) ->add('issue', EntityType::class, [ 'class' => SocialIssue::class, + 'label' => 'socialAction.socialIssue', 'choice_label' => function (SocialIssue $issue) { return $this->translatableStringHelper->localize($issue->getTitle()); }, @@ -55,12 +57,13 @@ class SocialActionType extends AbstractType return $this->translatableStringHelper->localize($issue->getTitle()); }, ]) - ->add('defaultNotificationDelay') - ->add('desactivationDate', DateType::class, [ - 'attr' => ['class' => 'datepicker'], - 'widget' => 'single_text', - 'format' => 'dd-MM-yyyy', + ->add('defaultNotificationDelay', DateIntervalType::class, [ + 'label' => 'socialAction.defaultNotificationDelay', 'required' => false, + ]) + ->add('desactivationDate', ChillDateType::class, [ + 'required' => false, + 'label' => 'goal.desactivationDate', ]); } diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php index 0058b1e51..5cbe4a0c2 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php @@ -11,12 +11,12 @@ declare(strict_types=1); namespace Chill\PersonBundle\Form\SocialWork; +use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Chill\PersonBundle\Entity\SocialWork\SocialIssue; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\Extension\Core\Type\DateType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -41,10 +41,8 @@ class SocialIssueType extends AbstractType 'required' => false, 'choice_label' => fn (SocialIssue $issue): ?string => $this->translatableStringHelper->localize($issue->getTitle()), ]) - ->add('desactivationDate', DateType::class, [ - 'attr' => ['class' => 'datepicker'], - 'widget' => 'single_text', - 'format' => 'dd-MM-yyyy', + ->add('desactivationDate', ChillDateType::class, [ + 'label' => 'goal.desactivationDate', 'required' => false, ]); } diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php index 6004bb1cb..9aa1ae749 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php @@ -37,9 +37,37 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface ->setAttribute('class', 'list-group-item-header') ->setExtras(['order' => 2000, 'header' => true]); + $menu->addChild('Civility', [ + 'route' => 'chill_crud_main_civility_index', + ])->setExtras(['order' => 2010]); + $menu->addChild('Marital status', [ 'route' => 'chill_crud_person_marital-status_index', - ])->setExtras(['order' => 2010]); + ])->setExtras(['order' => 2020]); + + $menu->addChild('person_admin.social_work') + ->setAttribute('class', 'list-group-item-header') + ->setExtras(['order' => 3000, 'header' => true]); + + $menu->addChild('person_admin.social_action', [ + 'route' => 'chill_crud_social_action_index', + ])->setExtras(['order' => 3001]); + + $menu->addChild('person_admin.social_issue', [ + 'route' => 'chill_crud_social_issue_index', + ])->setExtras(['order' => 3002]); + + $menu->addChild('person_admin.social_goal', [ + 'route' => 'chill_crud_social_goal_index', + ])->setExtras(['order' => 3010]); + + $menu->addChild('person_admin.social_evaluation', [ + 'route' => 'chill_crud_social_evaluation_index', + ])->setExtras(['order' => 3020]); + + $menu->addChild('person_admin.social_result', [ + 'route' => 'chill_crud_social_result_index', + ])->setExtras(['order' => 3030]); } public static function getMenuIds(): array diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Evaluation/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Evaluation/index.html.twig index 186b2f3ec..0adc82788 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Evaluation/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Evaluation/index.html.twig @@ -1,6 +1,6 @@ -{% extends '@ChillPerson/Admin/layout.html.twig' %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block layout_wvm_content %} +{% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} {{ 'Id'|trans }} @@ -9,19 +9,25 @@ {% endblock %} {% block table_entities_tbody %} - {% for entity in entities %} - - {{ entity.id }} - {{ entity.title|localize_translatable_string }} - -
                -
              • - -
              • -
              - - - {% endfor %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.title|localize_translatable_string }} + +
                +
              • + +
              • +
              + + + {% endfor %} + {% endblock %} + + {% block actions_before %} +
            • + {{'Back to the admin'|trans}} +
            • {% endblock %} {% endembed %} {% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Goal/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Goal/index.html.twig index aa7c239ba..3bcff2b11 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Goal/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Goal/index.html.twig @@ -1,6 +1,6 @@ -{% extends '@ChillPerson/Admin/layout.html.twig' %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block layout_wvm_content %} +{% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} {{ 'Id'|trans }} @@ -16,12 +16,18 @@
              • - +
              {% endfor %} {% endblock %} + + {% block actions_before %} +
            • + {{'Back to the admin'|trans}} +
            • + {% endblock %} {% endembed %} {% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Result/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Result/index.html.twig index f1081aebe..a815628ba 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Result/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Result/index.html.twig @@ -1,6 +1,6 @@ -{% extends '@ChillPerson/Admin/layout.html.twig' %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block layout_wvm_content %} +{% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} {{ 'Id'|trans }} @@ -16,12 +16,18 @@
              • - +
              {% endfor %} {% endblock %} + + {% block actions_before %} +
            • + {{'Back to the admin'|trans}} +
            • + {% endblock %} {% endembed %} {% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/index.html.twig index 4c1d5a59d..0497ee199 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/index.html.twig @@ -1,6 +1,6 @@ -{% extends '@ChillPerson/Admin/layout.html.twig' %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block layout_wvm_content %} +{% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} {{ 'Id'|trans }} @@ -16,12 +16,18 @@
              • - +
              {% endfor %} {% endblock %} + + {% block actions_before %} +
            • + {{'Back to the admin'|trans}} +
            • + {% endblock %} {% endembed %} {% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/index.html.twig index 44627852e..3a08ab850 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/index.html.twig @@ -1,6 +1,6 @@ -{% extends '@ChillPerson/Admin/layout.html.twig' %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block layout_wvm_content %} +{% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} {{ 'Id'|trans }} @@ -16,12 +16,18 @@
              • - +
              {% endfor %} {% endblock %} + + {% block actions_before %} +
            • + {{'Back to the admin'|trans}} +
            • + {% endblock %} {% endembed %} {% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/edit.html.twig index 0ae8754fe..28678bf6d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/edit.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/edit.html.twig @@ -1,12 +1,11 @@ -{% extends '@ChillPerson/Admin/layout.html.twig' %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} {% block title %} -{% include('@ChillMain/CRUD/_edit_title.html.twig') %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} {% endblock %} -{% block layout_wvm_content %} -{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} - {% block content_form_actions_view %}{% endblock %} - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} -{% endblock %} +{% block admin_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/new.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/new.html.twig index cc6021021..592ec2723 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/new.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/new.html.twig @@ -1,11 +1,13 @@ -{% extends '@ChillPerson/Admin/layout.html.twig' %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} {% block title %} -{% include('@ChillMain/CRUD/_new_title.html.twig') %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} {% endblock %} -{% block layout_wvm_content %} -{% embed '@ChillMain/CRUD/_new_content.html.twig' %} - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} -{% endblock %} +{% block admin_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} + + diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 175505d88..4407671e7 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -387,23 +387,39 @@ crud: social_action: index: title: Liste des actions d'accompagnements - add_new: Ajouter une nouvelle action d'accompagnements - title_new: Nouvelle action d'accompagnements - title_edit: Modifier l'action d'accompagnements + add_new: Ajouter une nouvelle action d'accompagnement + title_new: Nouvelle action d'accompagnement + title_edit: Modifier l'action d'accompagnement title_link: Voir l'action d'accompagnement + social_evaluation: + index: + title: Liste des évaluations + add_new: Ajouter une nouvelle évaluation + title_new: Nouvelle évaluation + title_edit: Modifier l'évaluation social_goal: index: title: Liste des objectifs d'action d'accompagnements - add_new: Ajouter un nouvel objectif d'action d'accompagnements + add_new: Ajouter un nouvel objectif d'action d'accompagnement title_new: Nouvel objectif title_edit: Modifier l'objectif social_result: index: title: Liste des résultats d'action d'accompagnements - add_new: Ajouter un nouveau résultat d'action d'accompagnements + add_new: Ajouter un nouveau résultat d'action d'accompagnement title_new: Nouveau résultat title_edit: Modifier le résultat +evaluation: + delay: Délai + notificationDelay: Délai de notification + +goal: + desactivationDate: Date de désactivation + +socialAction: + defaultNotificationDelay: Délai de notification par défaut + socialIssue: Problématique sociale # specific to closing motive closing_motive: @@ -427,6 +443,7 @@ person_admin: social_goal: Buts social_result: Résultats social_evaluation: Évaluations + social_work: Accompagnement social # specific to accompanying period accompanying_period: From 2fbdd169df9de567c414f63193efcd8d94b1e3ab Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 5 May 2022 14:37:56 +0200 Subject: [PATCH 19/49] admin: add AccompanyingPeriod Origin and closingMotive --- ...roller.php => ClosingMotiveController.php} | 4 +- .../Controller/OriginController.php | 26 ++++++++ .../ChillPersonExtension.php | 27 +++++++- .../ChillPersonBundle/Form/OriginType.php | 39 +++++++++++ .../Menu/AdminMenuBuilder.php | 25 +++++-- .../views/ClosingMotive/edit.html.twig | 15 ++--- .../views/ClosingMotive/index.html.twig | 10 ++- .../views/ClosingMotive/new.html.twig | 15 +++-- .../Resources/views/Origin/edit.html.twig | 11 ++++ .../Resources/views/Origin/index.html.twig | 35 ++++++++++ .../Resources/views/Origin/new.html.twig | 12 ++++ .../ChillPersonBundle/config/routes.yaml | 66 ------------------- .../translations/messages.fr.yml | 11 ++++ 13 files changed, 202 insertions(+), 94 deletions(-) rename src/Bundle/ChillPersonBundle/Controller/{AdminClosingMotiveController.php => ClosingMotiveController.php} (93%) create mode 100644 src/Bundle/ChillPersonBundle/Controller/OriginController.php create mode 100644 src/Bundle/ChillPersonBundle/Form/OriginType.php create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/Origin/edit.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/Origin/index.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/Origin/new.html.twig diff --git a/src/Bundle/ChillPersonBundle/Controller/AdminClosingMotiveController.php b/src/Bundle/ChillPersonBundle/Controller/ClosingMotiveController.php similarity index 93% rename from src/Bundle/ChillPersonBundle/Controller/AdminClosingMotiveController.php rename to src/Bundle/ChillPersonBundle/Controller/ClosingMotiveController.php index 9eee2c4a0..cf1436b99 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AdminClosingMotiveController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ClosingMotiveController.php @@ -16,10 +16,10 @@ use Chill\MainBundle\Pagination\PaginatorInterface; use Symfony\Component\HttpFoundation\Request; /** - * Class AdminClosingMotiveController + * Class ClosingMotiveController * Controller for closing motives. */ -class AdminClosingMotiveController extends CRUDController +class ClosingMotiveController extends CRUDController { /** * @param \Chill\MainBundle\CRUD\Controller\string|string $action diff --git a/src/Bundle/ChillPersonBundle/Controller/OriginController.php b/src/Bundle/ChillPersonBundle/Controller/OriginController.php new file mode 100644 index 000000000..b7caae3be --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/OriginController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index 8dad7e6ff..b29d79e8e 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -146,13 +146,13 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac [ 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class, 'name' => 'closing_motive', - 'base_path' => '/admin/closing-motive', + 'base_path' => '/admin/person/closing-motive', 'form_class' => \Chill\PersonBundle\Form\ClosingMotiveType::class, - 'controller' => \Chill\PersonBundle\Controller\AdminClosingMotiveController::class, + 'controller' => \Chill\PersonBundle\Controller\ClosingMotiveController::class, 'actions' => [ 'index' => [ - 'template' => '@ChillPerson/ClosingMotive/index.html.twig', 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/ClosingMotive/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', @@ -164,6 +164,27 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], ], + [ + 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Origin::class, + 'name' => 'origin', + 'base_path' => '/admin/person/origin', + 'form_class' => \Chill\PersonBundle\Form\OriginType::class, + 'controller' => \Chill\PersonBundle\Controller\OriginController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Origin/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Origin/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Origin/edit.html.twig', + ], + ], + ], [ 'class' => \Chill\PersonBundle\Entity\MaritalStatus::class, 'name' => 'person_marital-status', diff --git a/src/Bundle/ChillPersonBundle/Form/OriginType.php b/src/Bundle/ChillPersonBundle/Form/OriginType.php new file mode 100644 index 000000000..a9897de25 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/OriginType.php @@ -0,0 +1,39 @@ +add('label', TranslatableStringFormType::class) + ->add('noActiveAfter', ChillDateType::class, [ + 'required' => false, + 'input' => 'datetime_immutable', + 'label' => 'origin.noActiveAfter' + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', Origin::class); + } +} diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php index 9aa1ae749..1e563df86 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php @@ -45,29 +45,42 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface 'route' => 'chill_crud_person_marital-status_index', ])->setExtras(['order' => 2020]); + + $menu->addChild('person_admin.accompanying_period') + ->setAttribute('class', 'list-group-item-header') + ->setExtras(['order' => 2100, 'header' => true]); + + $menu->addChild('person_admin.closing motives', [ + 'route' => 'chill_crud_closing_motive_index', + ])->setExtras(['order' => 2110]); + + $menu->addChild('person_admin.origin', [ + 'route' => 'chill_crud_origin_index', + ])->setExtras(['order' => 2110]); + $menu->addChild('person_admin.social_work') ->setAttribute('class', 'list-group-item-header') - ->setExtras(['order' => 3000, 'header' => true]); + ->setExtras(['order' => 2200, 'header' => true]); $menu->addChild('person_admin.social_action', [ 'route' => 'chill_crud_social_action_index', - ])->setExtras(['order' => 3001]); + ])->setExtras(['order' => 2201]); $menu->addChild('person_admin.social_issue', [ 'route' => 'chill_crud_social_issue_index', - ])->setExtras(['order' => 3002]); + ])->setExtras(['order' => 2202]); $menu->addChild('person_admin.social_goal', [ 'route' => 'chill_crud_social_goal_index', - ])->setExtras(['order' => 3010]); + ])->setExtras(['order' => 2210]); $menu->addChild('person_admin.social_evaluation', [ 'route' => 'chill_crud_social_evaluation_index', - ])->setExtras(['order' => 3020]); + ])->setExtras(['order' => 2220]); $menu->addChild('person_admin.social_result', [ 'route' => 'chill_crud_social_result_index', - ])->setExtras(['order' => 3030]); + ])->setExtras(['order' => 2230]); } public static function getMenuIds(): array diff --git a/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/edit.html.twig index d132847f2..28678bf6d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/edit.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/edit.html.twig @@ -1,12 +1,11 @@ -{% extends '@ChillPerson/Admin/layout.html.twig' %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} {% block title %} -{% include('@ChillMain/CRUD/_edit_title.html.twig') %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} {% endblock %} -{% block layout_wvm_content %} -{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} - {% block content_form_actions_view %}{% endblock %} - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} -{% endblock %} \ No newline at end of file +{% block admin_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/index.html.twig index bdddd6782..6d37a8732 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/index.html.twig @@ -1,6 +1,6 @@ -{% extends '@ChillPerson/Admin/layout.html.twig' %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block layout_wvm_content %} +{% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} {{ 'Ordering'|trans }} @@ -36,5 +36,11 @@ {% endfor %} {% endblock %} + + {% block actions_before %} +
            • + {{'Back to the admin'|trans}} +
            • + {% endblock %} {% endembed %} {% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/new.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/new.html.twig index cc6021021..3a28dd85f 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/new.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/new.html.twig @@ -1,11 +1,12 @@ -{% extends '@ChillPerson/Admin/layout.html.twig' %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} {% block title %} -{% include('@ChillMain/CRUD/_new_title.html.twig') %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} {% endblock %} -{% block layout_wvm_content %} -{% embed '@ChillMain/CRUD/_new_content.html.twig' %} - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} -{% endblock %} +{% block admin_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} + diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Origin/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Origin/edit.html.twig new file mode 100644 index 000000000..28678bf6d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/Origin/edit.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Origin/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Origin/index.html.twig new file mode 100644 index 000000000..22ec63f09 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/Origin/index.html.twig @@ -0,0 +1,35 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + {{ 'Id'|trans }} + {{ 'Label'|trans }} + {{ 'origin.noActiveAfter'|trans }} +   + {% endblock %} + + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.label|localize_translatable_string }} + {% if entity.noActiveAfter %}{{ entity.noActiveAfter|date('Y-m-d') }}{% endif %} + +
                +
              • + +
              • +
              + + + {% endfor %} + {% endblock %} + + {% block actions_before %} +
            • + {{'Back to the admin'|trans}} +
            • + {% endblock %} + {% endembed %} +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Origin/new.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Origin/new.html.twig new file mode 100644 index 000000000..3a28dd85f --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/Origin/new.html.twig @@ -0,0 +1,12 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} + diff --git a/src/Bundle/ChillPersonBundle/config/routes.yaml b/src/Bundle/ChillPersonBundle/config/routes.yaml index 5d17d6ffe..d437a34d6 100644 --- a/src/Bundle/ChillPersonBundle/config/routes.yaml +++ b/src/Bundle/ChillPersonBundle/config/routes.yaml @@ -125,72 +125,6 @@ chill_person_admin_redirect_to_admin_index: order: 0 label: Main admin menu -chill_person_closingmotive_admin: - path: /{_locale}/admin/closing-motive - controller: cscrud_closing_motive_controller:index - options: - menus: - admin_person: - order: 90 - label: 'person_admin.closing motives' - -chill_person_maritalstatus_admin: - path: /{_locale}/admin/marital-status - controller: cscrud_marital_status_controller:index - options: - menus: - admin_person: - order: 120 - label: 'person_admin.marital status' - -chill_person_socialissue_admin: - path: /{_locale}/admin/social-work/social-issue - controller: cscrud_social_issue_controller:index - options: - menus: - admin_person: - order: 150 - label: 'person_admin.social_issue' - -chill_person_socialaction_admin: - path: /{_locale}/admin/social-work/social-action - controller: cscrud_social_action_controller:index - options: - menus: - admin_person: - order: 160 - label: 'person_admin.social_action' - - -chill_person_social_evaluation_admin: - path: /{_locale}/admin/social-work/evaluation - controller: cscrud_social_evaluation_controller:index - options: - menus: - admin_person: - order: 170 - label: 'person_admin.social_evaluation' - -chill_person_social_goal_admin: - path: /{_locale}/admin/social-work/goal - controller: cscrud_social_goal_controller:index - options: - menus: - admin_person: - order: 180 - label: 'person_admin.social_goal' - -chill_person_social_result_admin: - path: /{_locale}/admin/social-work/result - controller: cscrud_social_result_controller:index - options: - menus: - admin_person: - order: 190 - label: 'person_admin.social_result' - - - chill_person_controllers: resource: "@ChillPersonBundle/Controller" type: annotation diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 4407671e7..92718d1f5 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -372,6 +372,12 @@ crud: add_new: Ajouter un nouveau title_new: Nouveau motif de clotûre title_edit: Modifier le motif de clotûre + origin: + index: + title: Liste des origines de parcours + add_new: Ajouter une nouvelle + title_new: Nouvelle origine + title_edit: Modifier l'origine person_marital-status: index: title: Liste des états civils @@ -410,6 +416,9 @@ crud: title_new: Nouveau résultat title_edit: Modifier le résultat +origin: + noActiveAfter: désactivé après + evaluation: delay: Délai notificationDelay: Délai de notification @@ -428,12 +437,14 @@ closing_motive: Configuration of person bundle: Configuration du module "Personnes" person_admin: + accompanying_period: Parcours d'accompagnement What would you like to configure ?: Que souhaitez-vous configurer ? closing motives: Motifs de clotûre closing motives list: Liste des motifs de clotûre closing motive explanation: > Les motifs de clotûre donnent des indications sur la fermeture d'une période d'accompagnement. + origin: Origines marital status: États civils marital status list: Liste des états civils marital status explanation: > From 9ce7f10415dbddbf46bd0b17dc713087bf005124 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 5 May 2022 15:20:47 +0200 Subject: [PATCH 20/49] admin: add personresourcekind in the admin --- .../PersonResourceKindController.php | 26 ++++++++++++ .../ChillPersonExtension.php | 21 ++++++++++ .../Form/PersonResourceKindType.php | 40 ++++++++++++++++++ .../Menu/AdminMenuBuilder.php | 5 +++ .../views/PersonResourceKind/edit.html.twig | 11 +++++ .../views/PersonResourceKind/index.html.twig | 41 +++++++++++++++++++ .../views/PersonResourceKind/new.html.twig | 12 ++++++ .../translations/messages.fr.yml | 8 ++++ 8 files changed, 164 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/Controller/PersonResourceKindController.php create mode 100644 src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/PersonResourceKind/edit.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/PersonResourceKind/index.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/PersonResourceKind/new.html.twig diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonResourceKindController.php b/src/Bundle/ChillPersonBundle/Controller/PersonResourceKindController.php new file mode 100644 index 000000000..ca3047a97 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/PersonResourceKindController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index b29d79e8e..3d88fac22 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -206,6 +206,27 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], ], + [ + 'class' => \Chill\PersonBundle\Entity\Person\PersonResourceKind::class, + 'name' => 'person_resource-kind', + 'base_path' => '/admin/person/resource-kind', + 'form_class' => \Chill\PersonBundle\Form\PersonResourceKindType::class, + 'controller' => \Chill\PersonBundle\Controller\PersonResourceKindController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/PersonResourceKind/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/PersonResourceKind/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/PersonResourceKind/edit.html.twig', + ], + ], + ], [ 'class' => \Chill\PersonBundle\Entity\SocialWork\SocialIssue::class, 'name' => 'social_issue', diff --git a/src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php b/src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php new file mode 100644 index 000000000..060c7628c --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php @@ -0,0 +1,40 @@ +add('title', TranslatableStringFormType::class) + ->add('isActive', ChoiceType::class, [ + 'choices' => [ + 'Active' => true, + 'Inactive' => false, + ], + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', PersonResourceKind::class); + } +} diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php index 1e563df86..af47d4544 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php @@ -45,6 +45,11 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface 'route' => 'chill_crud_person_marital-status_index', ])->setExtras(['order' => 2020]); + $menu->addChild('person_admin.person_resource_kind', [ + 'route' => 'chill_crud_person_resource-kind_index', + ])->setExtras(['order' => 2030]); + + $menu->addChild('person_admin.accompanying_period') ->setAttribute('class', 'list-group-item-header') diff --git a/src/Bundle/ChillPersonBundle/Resources/views/PersonResourceKind/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/PersonResourceKind/edit.html.twig new file mode 100644 index 000000000..28678bf6d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/PersonResourceKind/edit.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/PersonResourceKind/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/PersonResourceKind/index.html.twig new file mode 100644 index 000000000..51105d0ff --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/PersonResourceKind/index.html.twig @@ -0,0 +1,41 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + {{ 'Id'|trans }} + {{ 'Title'|trans }} + {{ 'Active'|trans }} +   + {% endblock %} + + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.title|localize_translatable_string }} + + {%- if entity.isActive -%} + + {%- else -%} + + {%- endif -%} + + +
                +
              • + +
              • +
              + + + {% endfor %} + {% endblock %} + + {% block actions_before %} +
            • + {{'Back to the admin'|trans}} +
            • + {% endblock %} + {% endembed %} +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/PersonResourceKind/new.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/PersonResourceKind/new.html.twig new file mode 100644 index 000000000..3a28dd85f --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/PersonResourceKind/new.html.twig @@ -0,0 +1,12 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} + diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 92718d1f5..209a955d8 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -384,6 +384,12 @@ crud: add_new: Ajouter un nouveau title_new: Nouvel état civil title_edit: Modifier l'état civil + person_resource-kind: + index: + title: Types de personnes-ressources + add_new: Ajouter un nouveau + title_new: Nouveau type de personne-ressource + title_edit: Modifier le type de personne-ressource social_issue: index: title: Liste des problématiques sociales @@ -449,6 +455,7 @@ person_admin: marital status list: Liste des états civils marital status explanation: > Configurer la liste des états civils. + person_resource_kind: Type de personne ressource social_issue: Problématiques sociales social_action: Actions d'accompagnement social_goal: Buts @@ -456,6 +463,7 @@ person_admin: social_evaluation: Évaluations social_work: Accompagnement social + # specific to accompanying period accompanying_period: dates: Période From 7907e4a050a482f19244a06ebeb05603bb36dac8 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 5 May 2022 18:31:08 +0200 Subject: [PATCH 21/49] admin: add household position and relation admin --- .../HouseholdPositionController.php | 26 ++++++++++ .../Controller/RelationController.php | 26 ++++++++++ .../ChillPersonExtension.php | 42 ++++++++++++++++ .../Form/HouseholdPositionType.php | 47 ++++++++++++++++++ .../ChillPersonBundle/Form/OriginType.php | 2 +- .../Form/PersonResourceKindType.php | 10 ++-- .../ChillPersonBundle/Form/RelationType.php | 42 ++++++++++++++++ .../Menu/AdminMenuBuilder.php | 38 ++++++++------ .../views/HouseholdPosition/edit.html.twig | 11 +++++ .../views/HouseholdPosition/index.html.twig | 49 +++++++++++++++++++ .../views/HouseholdPosition/new.html.twig | 12 +++++ .../Resources/views/Relation/edit.html.twig | 11 +++++ .../Resources/views/Relation/index.html.twig | 41 ++++++++++++++++ .../Resources/views/Relation/new.html.twig | 12 +++++ .../translations/messages.fr.yml | 22 ++++++++- 15 files changed, 370 insertions(+), 21 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Controller/HouseholdPositionController.php create mode 100644 src/Bundle/ChillPersonBundle/Controller/RelationController.php create mode 100644 src/Bundle/ChillPersonBundle/Form/HouseholdPositionType.php create mode 100644 src/Bundle/ChillPersonBundle/Form/RelationType.php create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/HouseholdPosition/edit.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/HouseholdPosition/index.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/HouseholdPosition/new.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/Relation/edit.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/Relation/index.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/Relation/new.html.twig diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdPositionController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdPositionController.php new file mode 100644 index 000000000..781c264b5 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdPositionController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/RelationController.php b/src/Bundle/ChillPersonBundle/Controller/RelationController.php new file mode 100644 index 000000000..8f0c7fa44 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/RelationController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index 3d88fac22..950715a2b 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -206,6 +206,48 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], ], + [ + 'class' => \Chill\PersonBundle\Entity\Household\Position::class, + 'name' => 'person_household_position', + 'base_path' => '/admin/person/household/position', + 'form_class' => \Chill\PersonBundle\Form\HouseholdPositionType::class, + 'controller' => \Chill\PersonBundle\Controller\HouseholdPositionController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/HouseholdPosition/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/HouseholdPosition/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/HouseholdPosition/edit.html.twig', + ], + ], + ], + [ + 'class' => \Chill\PersonBundle\Entity\Relationships\Relation::class, + 'name' => 'person_relation', + 'base_path' => '/admin/person/relation', + 'form_class' => \Chill\PersonBundle\Form\RelationType::class, + 'controller' => \Chill\PersonBundle\Controller\RelationController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Relation/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Relation/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Relation/edit.html.twig', + ], + ], + ], [ 'class' => \Chill\PersonBundle\Entity\Person\PersonResourceKind::class, 'name' => 'person_resource-kind', diff --git a/src/Bundle/ChillPersonBundle/Form/HouseholdPositionType.php b/src/Bundle/ChillPersonBundle/Form/HouseholdPositionType.php new file mode 100644 index 000000000..ebd0ac966 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/HouseholdPositionType.php @@ -0,0 +1,47 @@ +add('label', TranslatableStringFormType::class) + ->add('allowHolder', CheckboxType::class, [ + 'required' => false, + 'label' => 'household.allowHolder', + ]) + ->add('shareHousehold', CheckboxType::class, [ + 'required' => false, + 'label' => 'household.shareHousehold', + ]) + ->add('ordering', NumberType::class, [ + 'required' => true, + 'scale' => 5, + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', Position::class); + } +} diff --git a/src/Bundle/ChillPersonBundle/Form/OriginType.php b/src/Bundle/ChillPersonBundle/Form/OriginType.php index a9897de25..e3c08b359 100644 --- a/src/Bundle/ChillPersonBundle/Form/OriginType.php +++ b/src/Bundle/ChillPersonBundle/Form/OriginType.php @@ -27,7 +27,7 @@ class OriginType extends AbstractType ->add('noActiveAfter', ChillDateType::class, [ 'required' => false, 'input' => 'datetime_immutable', - 'label' => 'origin.noActiveAfter' + 'label' => 'origin.noActiveAfter', ]); } diff --git a/src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php b/src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php index 060c7628c..8e050cbce 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php @@ -25,11 +25,11 @@ class PersonResourceKindType extends AbstractType $builder ->add('title', TranslatableStringFormType::class) ->add('isActive', ChoiceType::class, [ - 'choices' => [ - 'Active' => true, - 'Inactive' => false, - ], - ]); + 'choices' => [ + 'Active' => true, + 'Inactive' => false, + ], + ]); } public function configureOptions(OptionsResolver $resolver) diff --git a/src/Bundle/ChillPersonBundle/Form/RelationType.php b/src/Bundle/ChillPersonBundle/Form/RelationType.php new file mode 100644 index 000000000..e1887115f --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/RelationType.php @@ -0,0 +1,42 @@ +add('title', TranslatableStringFormType::class, [ + 'label' => 'relation.title', + ]) + ->add('reverseTitle', TranslatableStringFormType::class, [ + 'label' => 'relation.reverseTitle', + ]) + ->add('isActive', CheckboxType::class, [ + 'required' => false, + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', Relation::class); + } +} diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php index af47d4544..ad343feda 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php @@ -49,43 +49,53 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface 'route' => 'chill_crud_person_resource-kind_index', ])->setExtras(['order' => 2030]); - - - $menu->addChild('person_admin.accompanying_period') + $menu->addChild('Household') ->setAttribute('class', 'list-group-item-header') ->setExtras(['order' => 2100, 'header' => true]); - $menu->addChild('person_admin.closing motives', [ - 'route' => 'chill_crud_closing_motive_index', + $menu->addChild('Position', [ + 'route' => 'chill_crud_person_household_position_index', ])->setExtras(['order' => 2110]); - $menu->addChild('person_admin.origin', [ - 'route' => 'chill_crud_origin_index', - ])->setExtras(['order' => 2110]); + $menu->addChild('person_admin.relation', [ + 'route' => 'chill_crud_person_relation_index', + ])->setExtras(['order' => 2120]); - $menu->addChild('person_admin.social_work') + $menu->addChild('person_admin.accompanying_period') ->setAttribute('class', 'list-group-item-header') ->setExtras(['order' => 2200, 'header' => true]); + $menu->addChild('person_admin.closing motives', [ + 'route' => 'chill_crud_closing_motive_index', + ])->setExtras(['order' => 2210]); + + $menu->addChild('person_admin.origin', [ + 'route' => 'chill_crud_origin_index', + ])->setExtras(['order' => 2210]); + + $menu->addChild('person_admin.social_work') + ->setAttribute('class', 'list-group-item-header') + ->setExtras(['order' => 2300, 'header' => true]); + $menu->addChild('person_admin.social_action', [ 'route' => 'chill_crud_social_action_index', - ])->setExtras(['order' => 2201]); + ])->setExtras(['order' => 2301]); $menu->addChild('person_admin.social_issue', [ 'route' => 'chill_crud_social_issue_index', - ])->setExtras(['order' => 2202]); + ])->setExtras(['order' => 2302]); $menu->addChild('person_admin.social_goal', [ 'route' => 'chill_crud_social_goal_index', - ])->setExtras(['order' => 2210]); + ])->setExtras(['order' => 2310]); $menu->addChild('person_admin.social_evaluation', [ 'route' => 'chill_crud_social_evaluation_index', - ])->setExtras(['order' => 2220]); + ])->setExtras(['order' => 2320]); $menu->addChild('person_admin.social_result', [ 'route' => 'chill_crud_social_result_index', - ])->setExtras(['order' => 2230]); + ])->setExtras(['order' => 2330]); } public static function getMenuIds(): array diff --git a/src/Bundle/ChillPersonBundle/Resources/views/HouseholdPosition/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/HouseholdPosition/edit.html.twig new file mode 100644 index 000000000..28678bf6d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/HouseholdPosition/edit.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/HouseholdPosition/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/HouseholdPosition/index.html.twig new file mode 100644 index 000000000..d1d716434 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/HouseholdPosition/index.html.twig @@ -0,0 +1,49 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + {{ 'Id'|trans }} + {{ 'Label'|trans }} + {{ 'household.allowHolder'|trans }} + {{ 'household.shareHousehold'|trans }} +   + {% endblock %} + + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.label|localize_translatable_string }} + + {%- if entity.allowHolder -%} + + {%- else -%} + + {%- endif -%} + + + {%- if entity.shareHousehold -%} + + {%- else -%} + + {%- endif -%} + + +
                +
              • + +
              • +
              + + + {% endfor %} + {% endblock %} + + {% block actions_before %} +
            • + {{'Back to the admin'|trans}} +
            • + {% endblock %} + {% endembed %} +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/HouseholdPosition/new.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/HouseholdPosition/new.html.twig new file mode 100644 index 000000000..3a28dd85f --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/HouseholdPosition/new.html.twig @@ -0,0 +1,12 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} + diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Relation/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Relation/edit.html.twig new file mode 100644 index 000000000..28678bf6d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/Relation/edit.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Relation/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Relation/index.html.twig new file mode 100644 index 000000000..d7634e63e --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/Relation/index.html.twig @@ -0,0 +1,41 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + {{ 'Id'|trans }} + {{ 'Title'|trans }} + {{ 'Active'|trans }} +   + {% endblock %} + + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.title|localize_translatable_string }} - {{ entity.reverseTitle|localize_translatable_string }} + + {%- if entity.isActive -%} + + {%- else -%} + + {%- endif -%} + + +
                +
              • + +
              • +
              + + + {% endfor %} + {% endblock %} + + {% block actions_before %} +
            • + {{'Back to the admin'|trans}} +
            • + {% endblock %} + {% endembed %} +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Relation/new.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Relation/new.html.twig new file mode 100644 index 000000000..3a28dd85f --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/Relation/new.html.twig @@ -0,0 +1,12 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} + diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 209a955d8..ea22a2793 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -390,6 +390,18 @@ crud: add_new: Ajouter un nouveau title_new: Nouveau type de personne-ressource title_edit: Modifier le type de personne-ressource + person_household_position: + index: + title: Position + add_new: Ajouter un nouveau + title_new: Nouvelle position + title_edit: Modifier la position + person_relation: + index: + title: Relations de filiations + add_new: Ajouter un nouveau + title_new: Nouvelle relation de filiation + title_edit: Modifier la relation de filiation social_issue: index: title: Liste des problématiques sociales @@ -436,6 +448,14 @@ socialAction: defaultNotificationDelay: Délai de notification par défaut socialIssue: Problématique sociale +household: + allowHolder: Peut être titulaire + shareHousehold: Peut être partagé + +relation: + title: Premier membre + reverseTitle: Deuxième membre + # specific to closing motive closing_motive: any parent: Aucun parent @@ -462,7 +482,7 @@ person_admin: social_result: Résultats social_evaluation: Évaluations social_work: Accompagnement social - + relation: Relations de filiations # specific to accompanying period accompanying_period: From a4f2d47c4619e490917a99c4192e540682e3ae6e Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 6 May 2022 15:25:49 +0200 Subject: [PATCH 22/49] admin: add CancelReason admin --- .../Controller/CancelReasonController.php | 26 ++++++++++ .../ChillCalendarExtension.php | 24 +++++++++ .../Form/CancelReasonType.php | 39 +++++++++++++++ .../Menu/AdminMenuBuilder.php | 49 +++++++++++++++++++ .../views/CancelReason/edit.html.twig | 11 +++++ .../views/CancelReason/index.html.twig | 43 ++++++++++++++++ .../views/CancelReason/new.html.twig | 12 +++++ .../translations/messages.fr.yml | 13 ++++- 8 files changed, 215 insertions(+), 2 deletions(-) create mode 100644 src/Bundle/ChillCalendarBundle/Controller/CancelReasonController.php create mode 100644 src/Bundle/ChillCalendarBundle/Form/CancelReasonType.php create mode 100644 src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php create mode 100644 src/Bundle/ChillCalendarBundle/Resources/views/CancelReason/edit.html.twig create mode 100644 src/Bundle/ChillCalendarBundle/Resources/views/CancelReason/index.html.twig create mode 100644 src/Bundle/ChillCalendarBundle/Resources/views/CancelReason/new.html.twig diff --git a/src/Bundle/ChillCalendarBundle/Controller/CancelReasonController.php b/src/Bundle/ChillCalendarBundle/Controller/CancelReasonController.php new file mode 100644 index 000000000..3be2a8f93 --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/Controller/CancelReasonController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillCalendarBundle/DependencyInjection/ChillCalendarExtension.php b/src/Bundle/ChillCalendarBundle/DependencyInjection/ChillCalendarExtension.php index d0a5c3d94..5c4b6918a 100644 --- a/src/Bundle/ChillCalendarBundle/DependencyInjection/ChillCalendarExtension.php +++ b/src/Bundle/ChillCalendarBundle/DependencyInjection/ChillCalendarExtension.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace Chill\CalendarBundle\DependencyInjection; +use Chill\CalendarBundle\Entity\CancelReason; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; @@ -47,6 +48,29 @@ class ChillCalendarExtension extends Extension implements PrependExtensionInterf protected function prependCruds(ContainerBuilder $container) { $container->prependExtensionConfig('chill_main', [ + 'cruds' => [ + [ + 'class' => \Chill\CalendarBundle\Entity\CancelReason::class, + 'name' => 'calendar_cancel-reason', + 'base_path' => '/admin/calendar/cancel-reason', + 'form_class' => \Chill\CalendarBundle\Form\CancelReasonType::class, + 'controller' => \Chill\CalendarBundle\Controller\CancelReasonController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillCalendar/CancelReason/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillCalendar/CancelReason/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillCalendar/CancelReason/edit.html.twig', + ], + ], + ], + ], 'apis' => [ [ 'controller' => \Chill\CalendarBundle\Controller\CalendarRangeAPIController::class, diff --git a/src/Bundle/ChillCalendarBundle/Form/CancelReasonType.php b/src/Bundle/ChillCalendarBundle/Form/CancelReasonType.php new file mode 100644 index 000000000..be1b4e809 --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/Form/CancelReasonType.php @@ -0,0 +1,39 @@ +add('name', TranslatableStringFormType::class) + ->add('active', CheckboxType::class, [ + 'required' => false, + ]) + ->add('canceledBy', TextType::class); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', CancelReason::class); + } +} diff --git a/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php new file mode 100644 index 000000000..972f92ed6 --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php @@ -0,0 +1,49 @@ +authorizationChecker = $authorizationChecker; + } + + public function buildMenu($menuId, MenuItem $menu, array $parameters) + { + if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { + return; + } + + $menu->addChild('Calendar') + ->setAttribute('class', 'list-group-item-header') + ->setExtras(['order' => 6000, 'header' => true]); + + $menu->addChild('Cancel reason', [ + 'route' => 'chill_crud_calendar_cancel-reason_index', + ])->setExtras(['order' => 6010]); + } + + public static function getMenuIds(): array + { + return ['admin_section']; + } +} diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/CancelReason/edit.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/CancelReason/edit.html.twig new file mode 100644 index 000000000..28678bf6d --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/Resources/views/CancelReason/edit.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} \ No newline at end of file diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/CancelReason/index.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/CancelReason/index.html.twig new file mode 100644 index 000000000..0668d8db5 --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/Resources/views/CancelReason/index.html.twig @@ -0,0 +1,43 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + {{ 'Id'|trans }} + {{ 'Name'|trans }} + {{ 'canceledBy'|trans }} + {{ 'active'|trans }} +   + {% endblock %} + + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.name|localize_translatable_string }} + {{ entity.canceledBy }} + + {%- if entity.active -%} + + {%- else -%} + + {%- endif -%} + + +
                +
              • + +
              • +
              + + + {% endfor %} + {% endblock %} + + {% block actions_before %} +
            • + {{'Back to the admin'|trans}} +
            • + {% endblock %} + {% endembed %} +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/CancelReason/new.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/CancelReason/new.html.twig new file mode 100644 index 000000000..3a28dd85f --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/Resources/views/CancelReason/new.html.twig @@ -0,0 +1,12 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} + diff --git a/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml b/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml index 56ac8543c..5833eba43 100644 --- a/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml @@ -17,7 +17,7 @@ status: Statut du rendez-vous calendar location: Localistion du rendez-vous calendar comment: Remarque sur le rendez-vous sendSMS: Envoi d'un SMS -Send s m s: Envoi d'un SMS ? +Send s m s: Envoi d'un SMS ? Cancel reason: Motif d'annulation Add a new calendar: Ajouter un nouveau rendez-vous "Success : calendar item updated!": "Rendez-vous mis à jour" @@ -25,4 +25,13 @@ Add a new calendar: Ajouter un nouveau rendez-vous The calendar item has been successfully removed.: Le rendez-vous a été supprimé From the day: Du to the day: au -Transform to activity: Transformer en échange \ No newline at end of file +Transform to activity: Transformer en échange +canceledBy: supprimé par + +crud: + calendar_cancel-reason: + index: + title: Liste des motifs d'annulation + add_new: Ajouter un nouveau + title_new: Nouveau motif d'annulation + title_edit: Modifier le motif d'annulation \ No newline at end of file From 7cefce8305ee295feae987991f3411861e4d7563 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 6 May 2022 15:51:29 +0200 Subject: [PATCH 23/49] admin: add ThirdParty admin --- .../ThirdPartyCategoryController.php | 26 ++++++++++ .../ChillThirdPartyExtension.php | 24 +++++++++ .../Form/ThirdPartyCategoryType.php | 37 ++++++++++++++ .../Menu/AdminMenuBuilder.php | 49 +++++++++++++++++++ .../views/ThirdPartyCategory/edit.html.twig | 11 +++++ .../views/ThirdPartyCategory/index.html.twig | 41 ++++++++++++++++ .../views/ThirdPartyCategory/new.html.twig | 12 +++++ .../config/services/menu.yaml | 6 +++ .../translations/messages.fr.yml | 12 ++++- 9 files changed, 216 insertions(+), 2 deletions(-) create mode 100644 src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyCategoryController.php create mode 100644 src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyCategoryType.php create mode 100644 src/Bundle/ChillThirdPartyBundle/Menu/AdminMenuBuilder.php create mode 100644 src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdPartyCategory/edit.html.twig create mode 100644 src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdPartyCategory/index.html.twig create mode 100644 src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdPartyCategory/new.html.twig diff --git a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyCategoryController.php b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyCategoryController.php new file mode 100644 index 000000000..1e0bcc508 --- /dev/null +++ b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyCategoryController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php index d2023fae5..03a3daf5f 100644 --- a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php +++ b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php @@ -11,8 +11,11 @@ declare(strict_types=1); namespace Chill\ThirdPartyBundle\DependencyInjection; +use Chill\ThirdPartyBundle\Controller\ThirdPartyCategoryController; use Chill\ThirdPartyBundle\Controller\ThirdPartyController; use Chill\ThirdPartyBundle\Entity\ThirdParty; +use Chill\ThirdPartyBundle\Entity\ThirdPartyCategory; +use Chill\ThirdPartyBundle\Form\ThirdPartyCategoryType; use Chill\ThirdPartyBundle\Form\ThirdPartyType; use Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter; use Symfony\Component\Config\FileLocator; @@ -100,6 +103,27 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte ], ], ], + [ + 'class' => ThirdPartyCategory::class, + 'name' => 'thirdparty_thirdparty-category', + 'base_path' => '/admin/thirdparty/thirdparty-category', + 'form_class' => ThirdPartyCategoryType::class, + 'controller' => ThirdPartyCategoryController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillThirdParty/ThirdPartyCategory/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillThirdParty/ThirdPartyCategory/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillThirdParty/ThirdPartyCategory/edit.html.twig', + ], + ], + ], ], 'apis' => [ [ diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyCategoryType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyCategoryType.php new file mode 100644 index 000000000..ec1152710 --- /dev/null +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyCategoryType.php @@ -0,0 +1,37 @@ +add('name', TranslatableStringFormType::class) + ->add('active', CheckboxType::class, [ + 'required' => false, + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', ThirdPartyCategory::class); + } +} diff --git a/src/Bundle/ChillThirdPartyBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillThirdPartyBundle/Menu/AdminMenuBuilder.php new file mode 100644 index 000000000..ec44d8339 --- /dev/null +++ b/src/Bundle/ChillThirdPartyBundle/Menu/AdminMenuBuilder.php @@ -0,0 +1,49 @@ +authorizationChecker = $authorizationChecker; + } + + public function buildMenu($menuId, MenuItem $menu, array $parameters) + { + if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { + return; + } + + $menu->addChild('Third party') + ->setAttribute('class', 'list-group-item-header') + ->setExtras(['order' => 3000, 'header' => true]); + + $menu->addChild('Third party category', [ + 'route' => 'chill_crud_thirdparty_thirdparty-category_index', + ])->setExtras(['order' => 3010]); + } + + public static function getMenuIds(): array + { + return ['admin_section']; + } +} diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdPartyCategory/edit.html.twig b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdPartyCategory/edit.html.twig new file mode 100644 index 000000000..28678bf6d --- /dev/null +++ b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdPartyCategory/edit.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} \ No newline at end of file diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdPartyCategory/index.html.twig b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdPartyCategory/index.html.twig new file mode 100644 index 000000000..c70688404 --- /dev/null +++ b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdPartyCategory/index.html.twig @@ -0,0 +1,41 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + {{ 'Id'|trans }} + {{ 'Name'|trans }} + {{ 'active'|trans }} +   + {% endblock %} + + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.name|localize_translatable_string }} + + {%- if entity.active -%} + + {%- else -%} + + {%- endif -%} + + +
                +
              • + +
              • +
              + + + {% endfor %} + {% endblock %} + + {% block actions_before %} +
            • + {{'Back to the admin'|trans}} +
            • + {% endblock %} + {% endembed %} +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdPartyCategory/new.html.twig b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdPartyCategory/new.html.twig new file mode 100644 index 000000000..3a28dd85f --- /dev/null +++ b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdPartyCategory/new.html.twig @@ -0,0 +1,12 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} + diff --git a/src/Bundle/ChillThirdPartyBundle/config/services/menu.yaml b/src/Bundle/ChillThirdPartyBundle/config/services/menu.yaml index 4b6ffd83f..cacd1124b 100644 --- a/src/Bundle/ChillThirdPartyBundle/config/services/menu.yaml +++ b/src/Bundle/ChillThirdPartyBundle/config/services/menu.yaml @@ -1,4 +1,10 @@ services: + Chill\ThirdPartyBundle\Menu\: + autowire: true + autoconfigure: true + resource: '../../Menu/' + tags: ['chill.menu_builder'] + Chill\ThirdPartyBundle\Menu\MenuBuilder: arguments: $translator: '@Symfony\Contracts\Translation\TranslatorInterface' diff --git a/src/Bundle/ChillThirdPartyBundle/translations/messages.fr.yml b/src/Bundle/ChillThirdPartyBundle/translations/messages.fr.yml index e1962b94a..8c2a9d856 100644 --- a/src/Bundle/ChillThirdPartyBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillThirdPartyBundle/translations/messages.fr.yml @@ -76,6 +76,10 @@ The party is visible in those centers: Le tiers est visible dans ces centres The party is not visible in any center: Le tiers n'est associé à aucun centre No third parties: Aucun tiers +Thirdparty handling: Tiers traitant +Thirdparty workers: Tiers intervenants +Third party category: Catégories de tiers + # ROLES CHILL_3PARTY_3PARTY_CREATE: Ajouter un Tiers CHILL_3PARTY_3PARTY_SHOW: Voir un Tiers @@ -86,6 +90,10 @@ crud: 3party_3party: index: add_new: Créer + thirdparty_thirdparty-category: + index: + title: Liste des catégories de tiers + add_new: Ajouter une nouvelle + title_new: Nouvelle catégorie de tiers + title_edit: Modifier la catégorie de tiers -Thirdparty handling: Tiers traitant -Thirdparty workers: Tiers intervenants From 24794c12851f9c4e513d1861e649010a3f3c35ba Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 6 May 2022 16:28:37 +0200 Subject: [PATCH 24/49] admin: document category menu --- .../Menu/AdminMenuBuilder.php | 49 +++++++++++++++++++ .../views/DocumentCategory/edit.html.twig | 18 +------ .../views/DocumentCategory/index.html.twig | 18 +------ .../views/DocumentCategory/new.html.twig | 18 +------ .../views/DocumentCategory/show.html.twig | 18 +------ .../ChillDocStoreBundle/config/routes.yaml | 7 +-- .../config/services/menu.yaml | 4 +- 7 files changed, 57 insertions(+), 75 deletions(-) create mode 100644 src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php diff --git a/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php new file mode 100644 index 000000000..ce86d7c19 --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php @@ -0,0 +1,49 @@ +authorizationChecker = $authorizationChecker; + } + + public function buildMenu($menuId, MenuItem $menu, array $parameters) + { + if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { + return; + } + + $menu->addChild('Documents') + ->setAttribute('class', 'list-group-item-header') + ->setExtras(['order' => 4000, 'header' => true]); + + $menu->addChild('Document category list', [ + 'route' => 'chill_docstore_category_admin', + ])->setExtras(['order' => 4010]); + } + + public static function getMenuIds(): array + { + return ['admin_section']; + } +} diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/edit.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/edit.html.twig index 2b8f82c0b..b3bcd154b 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/edit.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/edit.html.twig @@ -1,20 +1,4 @@ -{# - * Copyright (C) 2018, Champs Libres Cooperative SCRLFS, - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} -{% extends "ChillDocStoreBundle:Admin:layout.html.twig" %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'Document category edit'|trans }}{% endblock title %} diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/index.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/index.html.twig index 1c19ab64c..ccb49b315 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/index.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/index.html.twig @@ -1,20 +1,4 @@ -{# - * Copyright (C) 2018, Champs Libres Cooperative SCRLFS, - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} -{% extends "ChillDocStoreBundle:Admin:layout.html.twig" %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'Document category list' | trans }}{% endblock title %} diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/new.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/new.html.twig index ea8685762..9b7badf36 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/new.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/new.html.twig @@ -1,20 +1,4 @@ -{# - * Copyright (C) 2018, Champs Libres Cooperative SCRLFS, - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} -{% extends "ChillDocStoreBundle:Admin:layout.html.twig" %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'Create new document category' | trans }}{% endblock title %} diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/show.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/show.html.twig index 89930df34..30a7d856b 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/show.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/show.html.twig @@ -1,20 +1,4 @@ -{# - * Copyright (C) 2018, Champs Libres Cooperative SCRLFS, - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} -{% extends "ChillDocStoreBundle:Admin:layout.html.twig" %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block title %}{{ 'Document category show'|trans }}{% endblock title %} diff --git a/src/Bundle/ChillDocStoreBundle/config/routes.yaml b/src/Bundle/ChillDocStoreBundle/config/routes.yaml index 5821aafa5..7f04ebadb 100644 --- a/src/Bundle/ChillDocStoreBundle/config/routes.yaml +++ b/src/Bundle/ChillDocStoreBundle/config/routes.yaml @@ -24,9 +24,4 @@ chill_docstore_admin_redirect_to_admin_index: chill_docstore_category_admin: path: /{_locale}/admin/document/category - controller: Chill\DocStoreBundle\Controller\DocumentCategoryController::indexAction - options: - menus: - admin_docstore: - order: 90 - label: "Documents categories" \ No newline at end of file + controller: Chill\DocStoreBundle\Controller\DocumentCategoryController::indexAction \ No newline at end of file diff --git a/src/Bundle/ChillDocStoreBundle/config/services/menu.yaml b/src/Bundle/ChillDocStoreBundle/config/services/menu.yaml index db16aef77..f0f1b3630 100644 --- a/src/Bundle/ChillDocStoreBundle/config/services/menu.yaml +++ b/src/Bundle/ChillDocStoreBundle/config/services/menu.yaml @@ -1,4 +1,6 @@ services: - Chill\DocStoreBundle\Menu\MenuBuilder: + Chill\DocStoreBundle\Menu\: autowire: true autoconfigure: true + resource: '../../Menu/' + tags: ['chill.menu_builder'] From 63bfd25acb9592bdd350aaf5887b822a9446a84c Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 9 May 2022 15:14:37 +0200 Subject: [PATCH 25/49] admin: homepage + style menu --- .../Resources/public/chill/chillmain.scss | 17 ++++++- .../Resources/views/Admin/index.html.twig | 3 -- .../Admin/layoutWithVerticalMenu.html.twig | 50 +++++++++++++++---- 3 files changed, 56 insertions(+), 14 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss index 94bc520cb..bb4b1dcf2 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss @@ -189,6 +189,7 @@ div.vertical-menu { } div.list-group-item-header { text-transform: uppercase; + font-weight: bold; } } @@ -213,6 +214,20 @@ footer.footer { } } +/* + * ADMIN STYLES + */ + + div.admin { + flex-direction: row-reverse; + div.vertical-menu { + font-size: 0.9em; + .list-group-item { + padding: 0.3rem 0.7rem; + } + } + } + /* * GENERIC MAIN STYLES * miscellaneous @@ -220,7 +235,7 @@ footer.footer { /// titles h1, h2, -.h1, .h2 { +.h1, .h2 { font-weight: $headings-font-weight + 100; } diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/index.html.twig index ba17f1d84..057fe5639 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/index.html.twig @@ -1,8 +1,5 @@ {% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %} -{% block vertical_menu_content %} -{% endblock %} - {% block admin_content %}

              {{ 'Administration interface'|trans }}

              diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/layoutWithVerticalMenu.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/layoutWithVerticalMenu.html.twig index 900a794b6..bdb26bc2b 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/layoutWithVerticalMenu.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/layoutWithVerticalMenu.html.twig @@ -1,13 +1,43 @@ -{% extends "@ChillMain/layoutWithVerticalMenu.html.twig" %} +{% extends "@ChillMain/layout.html.twig" %} -{% block vertical_menu_content %} - {{ chill_menu('admin_section', { - 'layout': '@ChillMain/Admin/menu_admin_section.html.twig', - }) }} +{% block sublayout_content %} +
              +
              + + {# Flash messages ! #} + {% if app.session.flashbag.keys()|length > 0 %} +
              + + {% for flashMessage in app.session.flashbag.get('success') %} +
              + {{ flashMessage|raw }} +
              + {% endfor %} + + {% for flashMessage in app.session.flashbag.get('error') %} +
              + {{ flashMessage|raw }} +
              + {% endfor %} + + {% for flashMessage in app.session.flashbag.get('notice') %} +
              + {{ flashMessage|raw }} +
              + {% endfor %} + +
              + {% endif %} + + {% block admin_content %} + + {% endblock %} +
              +
              + {{ chill_menu('admin_section', { + 'layout': '@ChillMain/Admin/menu_admin_section.html.twig', + }) }} +
              +
              {% endblock %} -{% block layout_wvm_content %} - {% block admin_content %} - - {% endblock %} -{% endblock %} From 0f319a100331450387d464300a0c66dedebd234d Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 9 May 2022 16:22:17 +0200 Subject: [PATCH 26/49] admin: reorganising activity menu and submenus --- .../Menu/AdminMenuBuilder.php | 44 +++++++++++-------- .../views/ActivityPresence/edit.html.twig | 6 +-- .../views/ActivityPresence/index.html.twig | 2 +- .../views/ActivityPresence/new.html.twig | 12 ++--- .../views/ActivityReason/edit.html.twig | 18 +------- .../views/ActivityReason/index.html.twig | 24 +++------- .../views/ActivityReason/new.html.twig | 18 +------- .../views/ActivityReason/show.html.twig | 18 +------- .../ActivityReasonCategory/edit.html.twig | 18 +------- .../ActivityReasonCategory/index.html.twig | 18 +------- .../ActivityReasonCategory/new.html.twig | 18 +------- .../ActivityReasonCategory/show.html.twig | 18 +------- .../views/ActivityType/edit.html.twig | 4 +- .../views/ActivityType/index.html.twig | 18 +------- .../views/ActivityType/new.html.twig | 4 +- .../views/ActivityTypeCategory/edit.html.twig | 14 +++--- .../ActivityTypeCategory/index.html.twig | 2 +- .../views/ActivityTypeCategory/new.html.twig | 12 ++--- .../views/Admin/layout_activity.html.twig | 2 +- .../views/Admin/menu_activity.html.twig | 18 -------- .../ChillActivityBundle/config/routes.yaml | 28 +----------- .../config/routes/activityreason.yaml | 5 --- .../config/routes/activityreasoncategory.yaml | 5 --- .../ChillCalendarExtension.php | 1 - .../Admin/layoutWithVerticalMenu.html.twig | 3 +- 25 files changed, 71 insertions(+), 259 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php index 13c3b3e6a..72f938c88 100644 --- a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php @@ -15,8 +15,6 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface; use Knp\Menu\MenuItem; use Symfony\Component\Security\Core\Security; -use function in_array; - final class AdminMenuBuilder implements LocalMenuBuilderInterface { private Security $security; @@ -32,23 +30,31 @@ final class AdminMenuBuilder implements LocalMenuBuilderInterface return; } - if (in_array($menuId, ['admin_index', 'admin_section'], true)) { - $menu->addChild('Activities', [ - 'route' => 'chill_admin_activity_index', - ]) - ->setExtras([ - 'order' => 2000, - 'explain' => 'Activity configuration', - ]); - } else { - $menu - ->addChild('Activities', [ - 'route' => 'chill_admin_activity_index', - ]) - ->setExtras([ - 'order' => '60', - ]); - } + $menu->addChild('Activities', [ + 'route' => 'chill_activity_admin_index', + ]) + ->setAttribute('class', 'list-group-item-header') + ->setExtras(['order' => 5000, 'header' => true]); + + $menu->addChild('Activity Reasons', [ + 'route' => 'chill_activity_activityreason', + ])->setExtras(['order' => 5010]); + + $menu->addChild('Activity Reasons Category', [ + 'route' => 'chill_activity_activityreasoncategory', + ])->setExtras(['order' => 5020]); + + $menu->addChild('Activity type', [ + 'route' => 'chill_activity_type_admin', + ])->setExtras(['order' => 5030]); + + $menu->addChild('Activity Presences', [ + 'route' => 'chill_crud_activity_presence_index', + ])->setExtras(['order' => 5040]); + + $menu->addChild('Activity Types Categories', [ + 'route' => 'chill_activity_type_category_admin', + ])->setExtras(['order' => 5050]); } public static function getMenuIds(): array diff --git a/src/Bundle/ChillActivityBundle/Resources/views/ActivityPresence/edit.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityPresence/edit.html.twig index 16cf893e8..194aa8eea 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/ActivityPresence/edit.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/ActivityPresence/edit.html.twig @@ -1,10 +1,10 @@ -{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} {% block title %} -{% include('@ChillMain/CRUD/_edit_title.html.twig') %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} {% endblock %} -{% block layout_wvm_content %} +{% block admin_content %} {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} {% block content_form_actions_view %}{% endblock %} {% block content_form_actions_save_and_show %}{% endblock %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/ActivityPresence/index.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityPresence/index.html.twig index b3d1ec9f2..954b7c653 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/ActivityPresence/index.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/ActivityPresence/index.html.twig @@ -1,4 +1,4 @@ -{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} {% block admin_content %}

              {{ 'ActivityPresence list'|trans }}

              diff --git a/src/Bundle/ChillActivityBundle/Resources/views/ActivityPresence/new.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityPresence/new.html.twig index c95711529..00ebd2938 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/ActivityPresence/new.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/ActivityPresence/new.html.twig @@ -1,11 +1,11 @@ -{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} {% block title %} -{% include('@ChillMain/CRUD/_new_title.html.twig') %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} {% endblock %} -{% block layout_wvm_content %} -{% embed '@ChillMain/CRUD/_new_content.html.twig' %} - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} +{% block admin_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} {% endblock %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/edit.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/edit.html.twig index 60089fa6f..04bb46ca2 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/edit.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/edit.html.twig @@ -1,20 +1,4 @@ -{# - * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} -{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block admin_content %}

              {{ 'ActivityReason edit'|trans }}

              diff --git a/src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/index.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/index.html.twig index 0dff9b5c4..7d9e5f71d 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/index.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/index.html.twig @@ -1,20 +1,4 @@ -{# - * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} -{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} +{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} {% block admin_content %}

              {{ 'ActivityReason list'|trans }}

              @@ -45,7 +29,11 @@ -
    + {% block vertical_menu_content %} {{ chill_menu('admin_section', { 'layout': '@ChillMain/Admin/menu_admin_section.html.twig', }) }} + {% endblock %}
    {% endblock %} - From fd67f327aed95ccc88af8d7f174468122791ed78 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 9 May 2022 16:30:20 +0200 Subject: [PATCH 27/49] admin menu: simplify header style --- .../Resources/public/chill/chillmain.scss | 4 ++-- .../views/Admin/menu_admin_section.html.twig | 14 -------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss index bb4b1dcf2..99376088e 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss @@ -179,7 +179,7 @@ div.banner { div.vertical-menu { border-radius: 0; margin-top: 0.5rem; - a.list-group-item, div.list-group-item { + a.list-group-item { background-color: $chill-yellow; border: 0; margin-bottom: 0.25rem; @@ -187,7 +187,7 @@ div.vertical-menu { background-color: tint-color($chill-yellow, 20%) } } - div.list-group-item-header { + a.list-group-item-header { text-transform: uppercase; font-weight: bold; } diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_section.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_section.html.twig index d0c777a4e..aed61f9c1 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_section.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/menu_admin_section.html.twig @@ -1,17 +1,5 @@
    From 3f399296c80db3a8969621846382c891e12b4ea2 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 9 May 2022 16:53:22 +0200 Subject: [PATCH 28/49] admin: admin section for calendar --- .../Controller/AdminController.php | 29 +++++++++++++++++++ .../Menu/AdminMenuBuilder.php | 6 ++-- .../Resources/views/Admin/index.html.twig | 13 +++++++++ .../views/Admin/menu_calendar.html.twig | 2 ++ .../translations/messages.fr.yml | 1 + 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 src/Bundle/ChillCalendarBundle/Controller/AdminController.php create mode 100644 src/Bundle/ChillCalendarBundle/Resources/views/Admin/index.html.twig create mode 100644 src/Bundle/ChillCalendarBundle/Resources/views/Admin/menu_calendar.html.twig diff --git a/src/Bundle/ChillCalendarBundle/Controller/AdminController.php b/src/Bundle/ChillCalendarBundle/Controller/AdminController.php new file mode 100644 index 000000000..88d78d229 --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/Controller/AdminController.php @@ -0,0 +1,29 @@ +render('ChillCalendarBundle:Admin:index.html.twig'); + } + +} diff --git a/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php index 972f92ed6..ad5d96d9a 100644 --- a/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php @@ -33,7 +33,9 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface return; } - $menu->addChild('Calendar') + $menu->addChild('Calendar', [ + 'route' => 'chill_calendar_admin_index', + ]) ->setAttribute('class', 'list-group-item-header') ->setExtras(['order' => 6000, 'header' => true]); @@ -44,6 +46,6 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface public static function getMenuIds(): array { - return ['admin_section']; + return ['admin_section', 'admin_calendar']; } } diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Admin/index.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/Admin/index.html.twig new file mode 100644 index 000000000..a721a31a0 --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/Resources/views/Admin/index.html.twig @@ -0,0 +1,13 @@ +{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %} + +{% block vertical_menu_content %} + {{ chill_menu('admin_calendar', { + 'layout': '@ChillCalendar/Admin/menu_calendar.html.twig', + }) }} +{% endblock %} + +{% block layout_wvm_content %} + {% block admin_content %} +

    {{ 'Calendar configuration' |trans }}

    + {% endblock %} +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Admin/menu_calendar.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/Admin/menu_calendar.html.twig new file mode 100644 index 000000000..52338e6fe --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/Resources/views/Admin/menu_calendar.html.twig @@ -0,0 +1,2 @@ +{% extends "@ChillMain/Menu/verticalMenu.html.twig" %} +{% block v_menu_title %}{{ 'Calendar configuration'|trans }}{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml b/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml index 5833eba43..d0a65c5e4 100644 --- a/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml @@ -27,6 +27,7 @@ From the day: Du to the day: au Transform to activity: Transformer en échange canceledBy: supprimé par +Calendar configuration: Gestion des rendez-vous crud: calendar_cancel-reason: From 1c04a873c0407b288dc5781513f475ee273e7b23 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 9 May 2022 17:07:36 +0200 Subject: [PATCH 29/49] admin: admin section for docstore --- .../Menu/AdminMenuBuilder.php | 6 ++++-- .../Resources/views/Admin/layout.html.twig | 18 ------------------ .../views/DocumentCategory/edit.html.twig | 2 +- .../views/DocumentCategory/index.html.twig | 2 +- .../views/DocumentCategory/new.html.twig | 2 +- 5 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php index ce86d7c19..f955b1d2e 100644 --- a/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php @@ -33,7 +33,9 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface return; } - $menu->addChild('Documents') + $menu->addChild('Documents', [ + 'route' => 'chill_docstore_admin', + ]) ->setAttribute('class', 'list-group-item-header') ->setExtras(['order' => 4000, 'header' => true]); @@ -44,6 +46,6 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface public static function getMenuIds(): array { - return ['admin_section']; + return ['admin_section', 'admin_docstore']; } } diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/Admin/layout.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/Admin/layout.html.twig index 03be4e6b9..a9860a20d 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/Admin/layout.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/Admin/layout.html.twig @@ -1,21 +1,3 @@ -{# - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, - / - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} - {% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %} {% block vertical_menu_content %} diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/edit.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/edit.html.twig index b3bcd154b..42f98596e 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/edit.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/edit.html.twig @@ -11,7 +11,7 @@ {{ form_start(form) }} {{ form_widget(form) }} -