"scripts": { | "scripts": { | ||||
"auto-scripts": { | "auto-scripts": { | ||||
"cache:clear": "symfony-cmd", | "cache:clear": "symfony-cmd", | ||||
"ckeditor:install --clear=drop": "symfony-cmd", | |||||
"assets:install %PUBLIC_DIR%": "symfony-cmd" | "assets:install %PUBLIC_DIR%": "symfony-cmd" | ||||
}, | }, | ||||
"post-install-cmd": [ | "post-install-cmd": [ |
# Read the documentation: https://symfony.com/doc/current/bundles/FOSCKEditorBundle/index.html | |||||
fos_ck_editor: | |||||
base_path: "build/ckeditor" | |||||
js_path: "build/ckeditor/ckeditor.js" | |||||
twig: | |||||
form_themes: | |||||
- '@FOSCKEditor/Form/ckeditor_widget.html.twig' |
"bootstrap-autocomplete": "^2.3.7", | "bootstrap-autocomplete": "^2.3.7", | ||||
"jquery": "^3.6.0", | "jquery": "^3.6.0", | ||||
"jquery-ui-sortable": "^1.0.0", | "jquery-ui-sortable": "^1.0.0", | ||||
"sass-loader": "^11.1.1" | |||||
"sass-loader": "^11.1.1", | |||||
"ckeditor": "^4.12.1", | |||||
"file-loader": "^6.0.0" | |||||
}, | }, | ||||
"devDependencies": { | "devDependencies": { | ||||
} | } |
namespace App\Controller\Admin; | namespace App\Controller\Admin; | ||||
use App\Entity\Site\Page; | use App\Entity\Site\Page; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField; | |||||
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\StatusField; | use Lc\SovBundle\Field\StatusField; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
public function configureFields(string $pageName): iterable | public function configureFields(string $pageName): iterable | ||||
{ | { | ||||
return | |||||
[ | |||||
FormField::addPanel('general'), | |||||
TextField::new('title'), | |||||
TextEditorField::new('description'), | |||||
StatusField::new('status'), | |||||
]; | |||||
if ($this->isGranted("ROLE_SUPER_ADMIN")) { | |||||
$fields[] = TextField::new('devAlias'); | |||||
} | |||||
$fields[] = TextField::new('devAlias'); | |||||
$fields[] = TextField::new('title'); | |||||
$fields[] = CKEditorField::new('description'); | |||||
$fields[] = StatusField::new('status'); | |||||
return $fields; | |||||
} | } | ||||
} | } |
use App\Controller\AbstractAdminController; | use App\Controller\AbstractAdminController; | ||||
use App\Entity\Site\Block; | use App\Entity\Site\Block; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | ||||
use Lc\SovBundle\Field\CKEditorField; | |||||
use Lc\SovBundle\Field\StatusField; | use Lc\SovBundle\Field\StatusField; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
return $this->getBlockContainer()->getRepositoryQuery(); | return $this->getBlockContainer()->getRepositoryQuery(); | ||||
} | } | ||||
public function createEntity(string $entityFqcn) | |||||
{ | |||||
return $this->getBlockContainer()->getFactory()->create(); | |||||
} | |||||
public function configureFields(string $pageName): iterable | public function configureFields(string $pageName): iterable | ||||
{ | { | ||||
if ($this->isGranted("ROLE_SUPER_ADMIN")) { | if ($this->isGranted("ROLE_SUPER_ADMIN")) { | ||||
$fields[] = TextField::new('devAlias'); | $fields[] = TextField::new('devAlias'); | ||||
} | } | ||||
$fields[] = TextField::new('title')->setLabel('Titre'); | |||||
$fields[] = TextEditorField::new('description')->setLabel('Description')->hideOnIndex(); | |||||
$fields[] = TextField::new('title'); | |||||
$fields[] = CKEditorField::new('description')->hideOnIndex(); | |||||
$fields[] = StatusField::new('status'); | $fields[] = StatusField::new('status'); | ||||
return $fields; | return $fields; |
config.corejs = 3; | config.corejs = 3; | ||||
}) | }) | ||||
//ckeditor config | |||||
.copyFiles([ | |||||
{from: './node_modules/ckeditor/', to: 'ckeditor/[path][name].[ext]', pattern: /\.(js|css)$/, includeSubdirectories: false}, | |||||
{from: './node_modules/ckeditor/adapters', to: 'ckeditor/adapters/[path][name].[ext]'}, | |||||
{from: './node_modules/ckeditor/lang', to: 'ckeditor/lang/[path][name].[ext]'}, | |||||
{from: './node_modules/ckeditor/plugins', to: 'ckeditor/plugins/[path][name].[ext]'}, | |||||
{from: './node_modules/ckeditor/skins', to: 'ckeditor/skins/[path][name].[ext]'}, | |||||
{from: './node_modules/ckeditor/vendor', to: 'ckeditor/vendor/[path][name].[ext]'} | |||||
]) | |||||
// uncomment if you use TypeScript | // uncomment if you use TypeScript | ||||
// .enableTypeScriptLoader() | // .enableTypeScriptLoader() |
resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" | resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" | ||||
integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== | integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== | ||||
ckeditor@^4.12.1: | |||||
version "4.12.1" | |||||
resolved "https://registry.yarnpkg.com/ckeditor/-/ckeditor-4.12.1.tgz#954a7b028dd611e44ba51cc7c2fe051cf1052186" | |||||
integrity sha512-pH2Su4oi0D4iN/3U8nUcwI7/lXHoOJi0aiN8e2zxnm4Ow5kq8eZP2ZGmpYyuqRyKZ2tHaU8+OyYi7laXcjiq9Q== | |||||
clean-stack@^2.0.0: | clean-stack@^2.0.0: | ||||
version "2.2.0" | version "2.2.0" | ||||
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" | resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" | ||||
resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.7.1.tgz#56e87e87c3f2fe01b025fbb1c4ea835990c02fa2" | resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.7.1.tgz#56e87e87c3f2fe01b025fbb1c4ea835990c02fa2" | ||||
integrity sha512-VYM2Xy1gSA5MerKzCnmmuV2XljkpKwgJBKezW+495TTnTCh1x5HcYa1aH8wRU/MfTGhW4ziXqgwprgQUVl3Ohw== | integrity sha512-VYM2Xy1gSA5MerKzCnmmuV2XljkpKwgJBKezW+495TTnTCh1x5HcYa1aH8wRU/MfTGhW4ziXqgwprgQUVl3Ohw== | ||||
file-loader@^6.0.0: | |||||
version "6.2.0" | |||||
resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d" | |||||
integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw== | |||||
dependencies: | |||||
loader-utils "^2.0.0" | |||||
schema-utils "^3.0.0" | |||||
fill-range@^7.0.1: | fill-range@^7.0.1: | ||||
version "7.0.1" | version "7.0.1" | ||||
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" | resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" |