Admin: Add country and languages to the admin

This commit is contained in:
nobohan
2022-05-02 16:51:41 +02:00
parent f917be0958
commit 4c99abd6d3
19 changed files with 318 additions and 6 deletions

View File

@@ -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',
],
],
],