@@ -22,7 +22,6 @@ class DashboardAdminController extends CaracDashboardController | |||
yield MenuItem::linkToCrud('page', 'far fa-copy', Page::class); | |||
yield MenuItem::subMenu('user', 'far fa-user')->setSubItems( | |||
[ | |||
MenuItem::linkToCrud('user_index', '', User::class), | |||
MenuItem::linkToCrud('user_merchant_index', '', UserMerchant::class), | |||
] | |||
); |
@@ -3,44 +3,12 @@ | |||
namespace App\Controller\Merchant; | |||
use App\Entity\Merchant\Merchant; | |||
use App\Entity\Section\Section; | |||
use App\Entity\Site\Page; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Field\BooleanField; | |||
use Lc\SovBundle\Field\CKEditorField; | |||
use Lc\SovBundle\Field\StatusField; | |||
use Lc\CaracoleBundle\Controller\Merchant\MerchantAdminController as CaracMerchantAdminController; | |||
class MerchantAdminController extends AbstractAdminController | |||
class MerchantAdminController extends CaracMerchantAdminController | |||
{ | |||
public static function getEntityFqcn(): string | |||
{ | |||
return Merchant::class; | |||
} | |||
public function configureFields(string $pageName): iterable | |||
{ | |||
$panel = parent::configureFields($pageName); | |||
return array_merge( | |||
[ | |||
FormField::addPanel('general'), | |||
TextField::new('title'), | |||
NumberField::new('position') | |||
->hideOnForm() | |||
->hideOnIndex(), | |||
CKEditorField::new('description') | |||
->hideOnIndex(), | |||
AssociationField::new('taxRate') | |||
->setRequired(true) | |||
->hideOnIndex(), | |||
StatusField::new('status'), | |||
], | |||
$panel | |||
); | |||
} | |||
} |
@@ -3,56 +3,13 @@ | |||
namespace App\Controller\Section; | |||
use App\Entity\Section\Section; | |||
use App\Entity\Site\Page; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\CaracoleBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Field\BooleanField; | |||
use Lc\SovBundle\Field\CKEditorField; | |||
use Lc\SovBundle\Field\StatusField; | |||
use Lc\CaracoleBundle\Controller\Section\SectionAdminController as CaracSectionAdminController; | |||
class SectionAdminController extends AbstractAdminController | |||
class SectionAdminController extends CaracSectionAdminController | |||
{ | |||
public static function getEntityFqcn(): string | |||
{ | |||
return Section::class; | |||
} | |||
public function configureFields(string $pageName): iterable | |||
{ | |||
$panel = parent::configureFields($pageName); | |||
return array_merge( | |||
[ | |||
FormField::addPanel('general'), | |||
TextField::new('title'), | |||
//AssociationField::new('merchant'), | |||
ChoiceField::new('cycle') | |||
->setRequired(true) | |||
->setChoices( | |||
[ | |||
'Jour' => Section::CYCLE_DAY, | |||
'Semaine' => Section::CYCLE_WEEK, | |||
'Mois' => Section::CYCLE_MONTH, | |||
'Année' => Section::CYCLE_YEAR, | |||
] | |||
), | |||
TextField::new('color') | |||
->setRequired(true) | |||
->hideOnIndex(), | |||
NumberField::new('position') | |||
->hideOnForm() | |||
->hideOnIndex(), | |||
CKEditorField::new('description') | |||
->hideOnIndex(), | |||
StatusField::new('status'), | |||
BooleanField::new('isDefault', 'Section par défaut'), | |||
], | |||
$panel | |||
); | |||
} | |||
} |
@@ -6,14 +6,17 @@ use App\Entity\Site\Page; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\CaracoleBundle\Controller\AbstractAdminController; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Field\CKEditorField; | |||
use Lc\SovBundle\Field\ImageManagerField; | |||
use Lc\SovBundle\Field\StatusField; | |||
use Lc\SovBundle\Form\Common\FileManagerType; | |||
class PageAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public static function getEntityFqcn(): string | |||
{ | |||
return Page::class; |
@@ -1,15 +0,0 @@ | |||
<?php | |||
namespace App\Controller\User; | |||
use App\Entity\User\User; | |||
use Lc\CaracoleBundle\Controller\User\UserAdminController as CaracUserAdminController; | |||
class UserAdminController extends CaracUserAdminController | |||
{ | |||
public static function getEntityFqcn(): string | |||
{ | |||
return User::class; | |||
} | |||
} |