location admin: admin crud for location

This commit is contained in:
nobohan
2021-10-21 21:39:32 +02:00
parent 92843677f9
commit e9322e61d4
8 changed files with 190 additions and 1 deletions

View File

@@ -20,6 +20,7 @@
namespace Chill\MainBundle\DependencyInjection;
use Chill\MainBundle\Controller\AddressApiController;
use Chill\MainBundle\Controller\LocationController;
use Chill\MainBundle\Controller\LocationTypeController;
use Chill\MainBundle\Controller\UserController;
use Chill\MainBundle\Doctrine\DQL\STContains;
@@ -45,8 +46,10 @@ use Chill\MainBundle\Doctrine\DQL\Replace;
use Chill\MainBundle\Doctrine\ORM\Hydration\FlatHierarchyEntityHydrator;
use Chill\MainBundle\Doctrine\Type\NativeDateIntervalType;
use Chill\MainBundle\Doctrine\Type\PointType;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\LocationType;
use Chill\MainBundle\Form\LocationTypeType;
use Chill\MainBundle\Form\LocationType as LocationFormType;
use Symfony\Component\HttpFoundation\Request;
/**
@@ -319,6 +322,28 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
]
]
],
[
'class' => Location::class,
'name' => 'main_location',
'base_path' => '/admin/main/location',
'base_role' => 'ROLE_ADMIN',
'form_class' => LocationFormType::class,
'controller' => LocationController::class,
'actions' => [
'index' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Location/index.html.twig',
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Location/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Location/edit.html.twig',
]
]
],
[
'class' => LocationType::class,
'name' => 'main_location_type',