Просмотр исходного кода

Crud Merchant, Section, Page

feature/ticket
Guillaume 3 лет назад
Родитель
Сommit
db6a8007c8
10 измененных файлов: 758 добавлений и 523 удалений
  1. +586
    -493
      composer.lock
  2. +0
    -1
      config/services.yaml
  3. +31
    -0
      migrations/Version20210603092517.php
  4. +23
    -24
      src/Controller/Admin/DashboardController.php
  5. +46
    -0
      src/Controller/Admin/MerchantCrudController.php
  6. +1
    -4
      src/Controller/Admin/PageCrudController.php
  7. +57
    -0
      src/Controller/Admin/SectionCrudController.php
  8. +1
    -1
      src/Entity/Site/Page.php
  9. +3
    -0
      symfony.lock
  10. +10
    -0
      templates/admin/dashboard.html.twig

+ 586
- 493
composer.lock
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 0
- 1
config/services.yaml Просмотреть файл

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


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

+ 31
- 0
migrations/Version20210603092517.php Просмотреть файл

@@ -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 Просмотреть файл

@@ -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 Просмотреть файл

@@ -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 Просмотреть файл

@@ -24,14 +24,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 Просмотреть файл

@@ -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
);
}

}

+ 1
- 1
src/Entity/Site/Page.php Просмотреть файл

@@ -2,12 +2,12 @@

namespace App\Entity\Site;

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 ;
use Lc\CaracoleBundle\Repository\Site\PageRepository;

/**
* @ORM\Entity(repositoryClass=PageRepository::class)

+ 3
- 0
symfony.lock Просмотреть файл

@@ -430,6 +430,9 @@
"symfony/polyfill-php80": {
"version": "v1.22.1"
},
"symfony/polyfill-php81": {
"version": "v1.23.0"
},
"symfony/polyfill-uuid": {
"version": "v1.22.1"
},

+ 10
- 0
templates/admin/dashboard.html.twig Просмотреть файл

@@ -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 %}


Загрузка…
Отмена
Сохранить