Browse Source

politoque + legal mention

v1
charly 3 years ago
parent
commit
c5ecf89616
4 changed files with 22 additions and 16 deletions
  1. +5
    -1
      config/routes.yaml
  2. +2
    -13
      src/Controller/Admin/PageCrudController.php
  3. +14
    -1
      src/Controller/Frontend/PageController.php
  4. +1
    -1
      templates/frontend/footer.html.twig

+ 5
- 1
config/routes.yaml View File

path: / path: /
controller: App\Controller\Frontend\HomeController:home controller: App\Controller\Frontend\HomeController:home


app_politique:
path: /politique-confidentialite
controller: App\Controller\Frontend\PageController::politique

app_legal_mention: app_legal_mention:
path: /mentions-legales path: /mentions-legales
controller: App\Controller\Frontend\MentionController::mention
controller: App\Controller\Frontend\PageController::mention


app_carto_interactive: app_carto_interactive:
path: /cartographie-interactive path: /cartographie-interactive

+ 2
- 13
src/Controller/Admin/PageCrudController.php View File



use App\Entity\Site\Page; use App\Entity\Site\Page;
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField; use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use Lc\SovBundle\Controller\AbstractAdminController as AbstractCrudController; use Lc\SovBundle\Controller\AbstractAdminController as AbstractCrudController;
use Lc\SovBundle\Field\CKEditorField;
use Lc\SovBundle\Field\FileManagerField;
use Lc\SovBundle\Field\GalleryManagerField;
use Lc\SovBundle\Field\ImageManagerField;
use Lc\SovBundle\Field\StatusField; use Lc\SovBundle\Field\StatusField;


class PageCrudController extends AbstractCrudController class PageCrudController extends AbstractCrudController


public function configureFields(string $pageName): iterable public function configureFields(string $pageName): iterable
{ {
$panel = parent::configureFields($pageName);

return array_merge(
return
[ [
FormField::addPanel('general'), FormField::addPanel('general'),
TextField::new('title'), TextField::new('title'),
TextEditorField::new('description'), TextEditorField::new('description'),
StatusField::new('status'), StatusField::new('status'),
],
$panel
);
];
} }


} }

src/Controller/Frontend/MentionController.php → src/Controller/Frontend/PageController.php View File

use App\Entity\Site\Page; use App\Entity\Site\Page;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;


class MentionController extends DefaultController
class PageController extends DefaultController
{ {
public function mention(): Response public function mention(): Response
{ {
] ]
); );
} }

public function politique(): Response
{
$pageRepository = $this->em->getRepository(Page::class);

return $this->render(
'page/page.html.twig',
[
'controller_name' => 'IndexController',
'page' => $pageRepository->findOneByDevAlias('politique')
]
);
}
} }

+ 1
- 1
templates/frontend/footer.html.twig View File

</div> </div>
<div class="bar-footer"> <div class="bar-footer">
© 2021 par la Coopérative des Citoyens | <a href="{{ path('app_legal_mention') }}" title="Mentions légales">Mentions © 2021 par la Coopérative des Citoyens | <a href="{{ path('app_legal_mention') }}" title="Mentions légales">Mentions
légales</a> | <a href="" title="Utilisation des cookies">Utilisation des cookies</a> | Création <a
légales</a> | <a href="{{ path('app_politique') }}" title="Politique de Confidentialité">Politique de Confidentialité</a> | Création <a
href="https://www.laclic.fr/" title="La Clic !" target="_blank">LA CLIC !</a> href="https://www.laclic.fr/" title="La Clic !" target="_blank">LA CLIC !</a>
</div> </div>
</footer> </footer>

Loading…
Cancel
Save