浏览代码

ckeditor

develop
Charly 3 年前
父节点
当前提交
086852f5b8
共有 8 个文件被更改,包括 2702 次插入14 次删除
  1. +1
    -0
      composer.json
  2. +8
    -0
      config/packages/fos_ck_editor.yaml
  3. +3
    -1
      package.json
  4. +2650
    -1
      public/build/manifest.json
  5. +10
    -9
      src/Controller/Admin/PageCrudController.php
  6. +8
    -3
      src/Controller/Admin/Site/BlockCrudController.php
  7. +9
    -0
      webpack.config.js
  8. +13
    -0
      yarn.lock

+ 1
- 0
composer.json 查看文件

@@ -90,6 +90,7 @@
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"ckeditor:install --clear=drop": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [

+ 8
- 0
config/packages/fos_ck_editor.yaml 查看文件

@@ -0,0 +1,8 @@
# 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'

+ 3
- 1
package.json 查看文件

@@ -24,7 +24,9 @@
"bootstrap-autocomplete": "^2.3.7",
"jquery": "^3.6.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": {
}

+ 2650
- 1
public/build/manifest.json
文件差异内容过多而无法显示
查看文件


+ 10
- 9
src/Controller/Admin/PageCrudController.php 查看文件

@@ -3,10 +3,9 @@
namespace App\Controller\Admin;

use App\Entity\Site\Page;
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use Lc\SovBundle\Controller\AbstractAdminController as AbstractCrudController;
use Lc\SovBundle\Field\CKEditorField;
use Lc\SovBundle\Field\StatusField;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

@@ -24,12 +23,14 @@ class PageCrudController extends AbstractCrudController

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

+ 8
- 3
src/Controller/Admin/Site/BlockCrudController.php 查看文件

@@ -4,8 +4,8 @@ namespace App\Controller\Admin\Site;

use App\Controller\AbstractAdminController;
use App\Entity\Site\Block;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use Lc\SovBundle\Field\CKEditorField;
use Lc\SovBundle\Field\StatusField;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

@@ -21,14 +21,19 @@ class BlockCrudController extends AbstractAdminController
return $this->getBlockContainer()->getRepositoryQuery();
}

public function createEntity(string $entityFqcn)
{
return $this->getBlockContainer()->getFactory()->create();
}

public function configureFields(string $pageName): iterable
{
if ($this->isGranted("ROLE_SUPER_ADMIN")) {
$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');

return $fields;

+ 9
- 0
webpack.config.js 查看文件

@@ -95,6 +95,15 @@ Encore
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
// .enableTypeScriptLoader()

+ 13
- 0
yarn.lock 查看文件

@@ -1971,6 +1971,11 @@ chrome-trace-event@^1.0.2:
resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac"
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:
version "2.2.0"
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b"
@@ -3336,6 +3341,14 @@ fflate@^0.7.1:
resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.7.1.tgz#56e87e87c3f2fe01b025fbb1c4ea835990c02fa2"
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:
version "7.0.1"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"

正在加载...
取消
保存