resource: '../src/Controller/' | resource: '../src/Controller/' | ||||
tags: ['controller.service_arguments'] | tags: ['controller.service_arguments'] | ||||
Lc\CaracoleBundle\: | Lc\CaracoleBundle\: | ||||
resource: '../Lc/CaracoleBundle/' | resource: '../Lc/CaracoleBundle/' | ||||
exclude: | exclude: |
<?php | |||||
declare(strict_types=1); | |||||
namespace DoctrineMigrations; | |||||
use Doctrine\DBAL\Schema\Schema; | |||||
use Doctrine\Migrations\AbstractMigration; | |||||
/** | |||||
* Auto-generated Migration: Please modify to your needs! | |||||
*/ | |||||
final class Version20210603092517 extends AbstractMigration | |||||
{ | |||||
public function getDescription(): string | |||||
{ | |||||
return ''; | |||||
} | |||||
public function up(Schema $schema): void | |||||
{ | |||||
// this up() migration is auto-generated, please modify it to your needs | |||||
$this->addSql('ALTER TABLE section ADD color VARCHAR(32) NOT NULL'); | |||||
} | |||||
public function down(Schema $schema): void | |||||
{ | |||||
// this down() migration is auto-generated, please modify it to your needs | |||||
$this->addSql('ALTER TABLE section DROP color'); | |||||
} | |||||
} |
namespace App\Controller\Admin; | namespace App\Controller\Admin; | ||||
use App\Entity\Common\TaxRate; | use App\Entity\Common\TaxRate; | ||||
use App\Entity\Merchant\Merchant; | |||||
use App\Entity\Section\Section; | |||||
use App\Entity\Site\Page; | use App\Entity\Site\Page; | ||||
use App\Entity\User\GroupUser; | |||||
use App\Entity\User\User; | use App\Entity\User\User; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Assets; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem; | use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem; | ||||
use Lc\SovBundle\Controller\Admin\DashboardController as LcDashboardController; | |||||
use Lc\CaracoleBundle\Controller\Admin\DashboardController as CaracDashboardController; | |||||
use Symfony\Component\HttpFoundation\Response; | |||||
class DashboardController extends LcDashboardController | |||||
class DashboardController extends CaracDashboardController | |||||
{ | { | ||||
public function configureMenuItems(): iterable | public function configureMenuItems(): iterable | ||||
{ | { | ||||
yield MenuItem::linkToDashboard('Tableau de bord', 'circle'); | |||||
yield MenuItem::linkToDashboard('dashboard', 'circle'); | |||||
yield MenuItem::subMenu('Utilisateurs', 'user')->setSubItems( | |||||
yield MenuItem::linkToCrud('page', 'copy', Page::class); | |||||
yield MenuItem::subMenu('user', 'user')->setSubItems( | |||||
[ | [ | ||||
MenuItem::linkToCrud('Utilisateurs', '', User::class), | |||||
MenuItem::linkToCrud('Groupes d\'utilisateurs', '', GroupUser::class), | |||||
MenuItem::linkToCrud('user_index', '', User::class), | |||||
] | ] | ||||
); | ); | ||||
yield MenuItem::linkToCrud('Pages', 'copy', Page::class); | |||||
yield MenuItem::linkToCrud('TVA', 'circle', TaxRate::class); | |||||
yield MenuItem::subMenu('Mon compte', 'user')->setSubItems( | |||||
yield MenuItem::subMenu('account', 'user')->setSubItems( | |||||
[ | [ | ||||
MenuItem::linkToRoute('Informations personnelles', '', 'sov_admin_account_profile'), | |||||
MenuItem::linkToRoute('Mot de passe', '', 'sov_admin_account_password'), | |||||
MenuItem::linkToRoute('account_profile', '', 'sov_admin_account_profile'), | |||||
MenuItem::linkToRoute('account_password', '', 'sov_admin_account_password'), | |||||
] | ] | ||||
); | ); | ||||
/* | |||||
MenuItem::section('Blog'), | |||||
MenuItem::linkToCrud('Categories', 'fa fa-tags', Category::class), | |||||
MenuItem::linkToCrud('Blog Posts', 'fa fa-file-text', BlogPost::class), | |||||
yield MenuItem::subMenu('admin', 'circle')->setSubItems( | |||||
[ | |||||
MenuItem::linkToCrud('admin_merchant', 'circle', Merchant::class), | |||||
MenuItem::linkToCrud('admin_section', 'circle', Section::class), | |||||
MenuItem::linkToCrud('admin_tva', 'circle', TaxRate::class), | |||||
] | |||||
); | |||||
} | |||||
MenuItem::section('Users'), | |||||
MenuItem::linkToCrud('Comments', 'fa fa-comment', Comment::class), | |||||
MenuItem::linkToCrud('Users', 'fa fa-user', User::class),*/ | |||||
public function index(): Response | |||||
{ | |||||
return $this->render('admin/dashboard.html.twig'); | |||||
} | } | ||||
/*public function configureMenuItems(): iterable | /*public function configureMenuItems(): iterable |
<?php | |||||
namespace App\Controller\Admin; | |||||
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\Admin\AbstractCrudController; | |||||
use Lc\SovBundle\Field\BooleanField; | |||||
use Lc\SovBundle\Field\CKEditorField; | |||||
use Lc\SovBundle\Field\StatusField; | |||||
class MerchantCrudController extends AbstractCrudController | |||||
{ | |||||
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 | |||||
); | |||||
} | |||||
} |
return array_merge( | return array_merge( | ||||
[ | [ | ||||
FormField::addPanel('Général'), | |||||
//->setCustomOption('template', '@LcSov/adminlte/crud/_test.html.twig') | |||||
FormField::addPanel('general'), | |||||
TextField::new('title'), | TextField::new('title'), | ||||
NumberField::new('position')->hideOnForm(), | NumberField::new('position')->hideOnForm(), | ||||
//BooleanField::new('titlefefe')->setFormTypeOption('mapped', false)->setFormTypeOption('required', true), | |||||
StatusField::new('status'), | StatusField::new('status'), | ||||
CKEditorField::new('description'), | CKEditorField::new('description'), | ||||
], | ], | ||||
$panel | $panel | ||||
); | ); |
<?php | |||||
namespace App\Controller\Admin; | |||||
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\SovBundle\Controller\Admin\AbstractCrudController; | |||||
use Lc\SovBundle\Field\BooleanField; | |||||
use Lc\SovBundle\Field\CKEditorField; | |||||
use Lc\SovBundle\Field\StatusField; | |||||
class SectionCrudController extends AbstractCrudController | |||||
{ | |||||
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'), | |||||
], | |||||
$panel | |||||
); | |||||
} | |||||
} |
namespace App\Entity\Site; | namespace App\Entity\Site; | ||||
use App\Entity\Section; | |||||
use Lc\CaracoleBundle\Model\Site\PageModel; | use Lc\CaracoleBundle\Model\Site\PageModel; | ||||
use Lc\CaracoleBundle\Repository\Site\PageRepository; | use Lc\CaracoleBundle\Repository\Site\PageRepository; | ||||
use Doctrine\Common\Collections\ArrayCollection; | use Doctrine\Common\Collections\ArrayCollection; | ||||
use Doctrine\Common\Collections\Collection; | use Doctrine\Common\Collections\Collection; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | |||||
use App\Entity\File\File ; | use App\Entity\File\File ; | ||||
/** | /** | ||||
*/ | */ | ||||
private $gallery; | private $gallery; | ||||
public function __construct() | public function __construct() | ||||
{ | { | ||||
$this->gallery = new ArrayCollection(); | $this->gallery = new ArrayCollection(); | ||||
return $this; | return $this; | ||||
} | } | ||||
} | } |
{% extends '@LcCaracole/adminlte/layout.html.twig' %} | |||||
{% block content_title %} | |||||
{{ 'dashboard'|lc_trans_admin_title }} | |||||
{% endblock %} | |||||
{% block main %} | |||||
Tableau de bord par défaut Caracole. | |||||
{% endblock %} | |||||