<?php | |||||
namespace Lc\SovBundle\Controller\Site; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\DateField; | |||||
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\CKEditorField; | |||||
use Lc\SovBundle\Field\ImageManagerField; | |||||
use Lc\SovBundle\Field\StatusField; | |||||
abstract class NewsAdminController extends AbstractAdminController | |||||
{ | |||||
public function configureFields(string $pageName): iterable | |||||
{ | |||||
$panel = parent::configureFields($pageName); | |||||
return array_merge( | |||||
[ | |||||
FormField::addPanel('general'), | |||||
TextField::new('title'), | |||||
DateField::new('date') | |||||
->setFormat('d/MM/y'), | |||||
NumberField::new('position') | |||||
->hideOnIndex() | |||||
->hideOnForm(), | |||||
CKEditorField::new('description'), | |||||
StatusField::new('status'), | |||||
], | |||||
$panel | |||||
); | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Controller\Site; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||||
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; | |||||
abstract class PageAdminController extends AbstractAdminController | |||||
{ | |||||
use AdminControllerTrait; | |||||
public function configureFields(string $pageName): iterable | |||||
{ | |||||
$panel = parent::configureFields($pageName); | |||||
return array_merge( | |||||
[ | |||||
FormField::addPanel('general'), | |||||
TextField::new('title'), | |||||
ImageManagerField::new('image'), | |||||
NumberField::new('position') | |||||
->hideOnIndex() | |||||
->hideOnForm(), | |||||
StatusField::new('status'), | |||||
CKEditorField::new('description'), | |||||
], | |||||
$panel | |||||
); | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Model\Site ; | |||||
interface NewsInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Model\Site; | |||||
use Doctrine\ORM\Mapping as ORM; | |||||
use Gedmo\Mapping\Annotation as Gedmo; | |||||
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | |||||
/** | |||||
* @ORM\MappedSuperclass() | |||||
*/ | |||||
abstract class NewsModel extends AbstractFullEntity implements NewsInterface | |||||
{ | |||||
/** | |||||
* @ORM\Column(type="datetime") | |||||
* @Gedmo\Timestampable(on="create") | |||||
*/ | |||||
protected $date; | |||||
public function __toString() | |||||
{ | |||||
return $this->getTitle(); | |||||
} | |||||
public function getDate(): ?\DateTimeInterface | |||||
{ | |||||
return $this->date; | |||||
} | |||||
public function setDate(\DateTimeInterface $date): self | |||||
{ | |||||
$this->date = $date; | |||||
return $this; | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Model\Site; | |||||
interface PageInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Model\Site; | |||||
use Doctrine\ORM\Mapping as ORM; | |||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | |||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; | |||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | |||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | |||||
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | |||||
/** | |||||
* @ORM\MappedSuperclass() | |||||
*/ | |||||
abstract class PageModel extends AbstractFullEntity implements PageInterface | |||||
{ | |||||
/** | |||||
* @ORM\Column(type="text", nullable=true) | |||||
*/ | |||||
protected $content; | |||||
/** | |||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="pages") | |||||
* @ORM\JoinColumn(nullable=false) | |||||
*/ | |||||
protected $merchant; | |||||
/** | |||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface", inversedBy="pages") | |||||
*/ | |||||
protected $section; | |||||
public function __toString() | |||||
{ | |||||
return $this->getTitle(); | |||||
} | |||||
public function getContent(): ?string | |||||
{ | |||||
return $this->content; | |||||
} | |||||
public function setContent(?string $content): self | |||||
{ | |||||
$this->content = $content; | |||||
return $this; | |||||
} | |||||
public function getMerchant(): ?MerchantInterface | |||||
{ | |||||
return $this->merchant; | |||||
} | |||||
public function setMerchant(?MerchantInterface $merchant): self | |||||
{ | |||||
$this->merchant = $merchant; | |||||
return $this; | |||||
} | |||||
public function getSection(): ?SectionInterface | |||||
{ | |||||
return $this->section; | |||||
} | |||||
public function setSection(?SectionInterface $section): self | |||||
{ | |||||
$this->section = $section; | |||||
return $this; | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Site; | |||||
use Lc\SovBundle\Model\Site\NewsInterface; | |||||
use Lc\SovBundle\Repository\AbstractRepository; | |||||
/** | |||||
* @method NewsInterface|null find($id, $lockMode = null, $lockVersion = null) | |||||
* @method NewsInterface|null findOneBy(array $criteria, array $orderBy = null) | |||||
* @method NewsInterface[] findAll() | |||||
* @method NewsInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||||
*/ | |||||
class NewsRepository extends AbstractRepository | |||||
{ | |||||
public function getInterfaceClass() | |||||
{ | |||||
return NewsInterface::class; | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Site; | |||||
use Lc\SovBundle\Model\Site\PageInterface; | |||||
use Lc\SovBundle\Repository\AbstractRepository; | |||||
/** | |||||
* @method PageInterface|null find($id, $lockMode = null, $lockVersion = null) | |||||
* @method PageInterface|null findOneBy(array $criteria, array $orderBy = null) | |||||
* @method PageInterface[] findAll() | |||||
* @method PageInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||||
*/ | |||||
class PageRepository extends AbstractRepository | |||||
{ | |||||
public function getInterfaceClass() | |||||
{ | |||||
return PageInterface::class; | |||||
} | |||||
} |
menu: | menu: | ||||
dashboard: Tableau de bord | dashboard: Tableau de bord | ||||
page: Pages | page: Pages | ||||
news: Actualités | |||||
user: Utilisateurs | user: Utilisateurs | ||||
user_index: Liste | user_index: Liste | ||||
account: Mon compte | account: Mon compte | ||||
new: Ajouter "%label%" | new: Ajouter "%label%" | ||||
edit: Modifier "%label%" (#%id%) | edit: Modifier "%label%" (#%id%) | ||||
detail: Voir "%label%" (#%id%) | detail: Voir "%label%" (#%id%) | ||||
un_titre: Un titre | |||||
account: | account: | ||||
profile: Mes informations personnelles | profile: Mes informations personnelles | ||||
change_password: Changer de mot de passe | change_password: Changer de mot de passe | ||||
Page: | Page: | ||||
label: Page | label: Page | ||||
label_plurial: Pages | label_plurial: Pages | ||||
News: | |||||
label: Actualité | |||||
label_plurial: Actualités | |||||
Ticket: | Ticket: | ||||
fields: | fields: | ||||
visitorFirstName: Nom | visitorFirstName: Nom | ||||
gallery: Galerie | gallery: Galerie | ||||
color: Couleur | color: Couleur | ||||
active: Activer | active: Activer | ||||
image: Image | |||||
date: Date | |||||
panels: | panels: | ||||
general: Général | general: Général |