Sfoglia il codice sorgente

Merge branch 'develop' of https://gitea.laclic.fr/Laclic/CaracoleSkeleton into develop

feature/ticket
Fab 3 anni fa
parent
commit
70a0a8d416
8 ha cambiato i file con 168 aggiunte e 33 eliminazioni
  1. +0
    -1
      config/services.yaml
  2. +31
    -0
      migrations/Version20210603092517.php
  3. +23
    -24
      src/Controller/Admin/DashboardController.php
  4. +46
    -0
      src/Controller/Admin/MerchantCrudController.php
  5. +1
    -4
      src/Controller/Admin/PageCrudController.php
  6. +57
    -0
      src/Controller/Admin/SectionCrudController.php
  7. +0
    -4
      src/Entity/Site/Page.php
  8. +10
    -0
      templates/admin/dashboard.html.twig

+ 0
- 1
config/services.yaml Vedi File

@@ -30,7 +30,6 @@ services:
resource: '../src/Controller/'
tags: ['controller.service_arguments']


Lc\CaracoleBundle\:
resource: '../Lc/CaracoleBundle/'
exclude:

+ 31
- 0
migrations/Version20210603092517.php Vedi File

@@ -0,0 +1,31 @@
<?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');
}
}

+ 23
- 24
src/Controller/Admin/DashboardController.php Vedi File

@@ -2,48 +2,47 @@

namespace App\Controller\Admin;


use App\Entity\Common\TaxRate;
use App\Entity\Merchant\Merchant;
use App\Entity\Section\Section;
use App\Entity\Site\Page;
use App\Entity\User\GroupUser;
use App\Entity\User\User;
use EasyCorp\Bundle\EasyAdminBundle\Config\Assets;
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
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
{
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

+ 46
- 0
src/Controller/Admin/MerchantCrudController.php Vedi File

@@ -0,0 +1,46 @@
<?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
);
}

}

+ 1
- 4
src/Controller/Admin/PageCrudController.php Vedi File

@@ -23,14 +23,11 @@ class PageCrudController extends AbstractCrudController

return array_merge(
[
FormField::addPanel('Général'),
//->setCustomOption('template', '@LcSov/adminlte/crud/_test.html.twig')
FormField::addPanel('general'),
TextField::new('title'),
NumberField::new('position')->hideOnForm(),
//BooleanField::new('titlefefe')->setFormTypeOption('mapped', false)->setFormTypeOption('required', true),
StatusField::new('status'),
CKEditorField::new('description'),

],
$panel
);

+ 57
- 0
src/Controller/Admin/SectionCrudController.php Vedi File

@@ -0,0 +1,57 @@
<?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
);
}

}

+ 0
- 4
src/Entity/Site/Page.php Vedi File

@@ -2,13 +2,11 @@

namespace App\Entity\Site;

use App\Entity\Section;
use Lc\CaracoleBundle\Model\Site\PageModel;
use Lc\CaracoleBundle\Repository\Site\PageRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
use App\Entity\File\File ;

/**
@@ -34,7 +32,6 @@ class Page extends PageModel
*/
private $gallery;


public function __construct()
{
$this->gallery = new ArrayCollection();
@@ -86,5 +83,4 @@ class Page extends PageModel
return $this;
}


}

+ 10
- 0
templates/admin/dashboard.html.twig Vedi File

@@ -0,0 +1,10 @@
{% 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 %}


Loading…
Annulla
Salva