diff --git a/src/Form/Type/MediaType.php b/src/Form/Type/MediaType.php index 82621729f..4672b2dd9 100644 --- a/src/Form/Type/MediaType.php +++ b/src/Form/Type/MediaType.php @@ -70,6 +70,11 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'multiple' => true, 'expanded' => true, ]) + ->add('path', TextType::class, [ + 'label' => 'bitbag_sylius_cms_plugin.ui.path', + 'disabled' => true, + 'required' => false, + ]) ->add('translations', ResourceTranslationsType::class, [ 'entry_type' => MediaTranslationType::class, ]) diff --git a/src/Menu/ContentManagementMenuBuilder.php b/src/Menu/ContentManagementMenuBuilder.php index a67d28ac0..13f50a993 100755 --- a/src/Menu/ContentManagementMenuBuilder.php +++ b/src/Menu/ContentManagementMenuBuilder.php @@ -24,19 +24,11 @@ public function buildMenu(MenuBuilderEvent $menuBuilderEvent): void ; $cmsRootMenuItem - ->addChild('blocks', [ - 'route' => 'bitbag_sylius_cms_plugin_admin_block_index', - ]) - ->setLabel('bitbag_sylius_cms_plugin.ui.blocks') - ->setLabelAttribute('icon', 'block layout') - ; - - $cmsRootMenuItem - ->addChild('media', [ - 'route' => 'bitbag_sylius_cms_plugin_admin_media_index', + ->addChild('collections', [ + 'route' => 'bitbag_sylius_cms_plugin_admin_collection_index', ]) - ->setLabel('bitbag_sylius_cms_plugin.ui.media') - ->setLabelAttribute('icon', 'file') + ->setLabel('bitbag_sylius_cms_plugin.ui.collections') + ->setLabelAttribute('icon', 'grid layout') ; $cmsRootMenuItem @@ -48,11 +40,19 @@ public function buildMenu(MenuBuilderEvent $menuBuilderEvent): void ; $cmsRootMenuItem - ->addChild('collections', [ - 'route' => 'bitbag_sylius_cms_plugin_admin_collection_index', + ->addChild('blocks', [ + 'route' => 'bitbag_sylius_cms_plugin_admin_block_index', ]) - ->setLabel('bitbag_sylius_cms_plugin.ui.collections') - ->setLabelAttribute('icon', 'grid layout') + ->setLabel('bitbag_sylius_cms_plugin.ui.blocks') + ->setLabelAttribute('icon', 'block layout') + ; + + $cmsRootMenuItem + ->addChild('media', [ + 'route' => 'bitbag_sylius_cms_plugin_admin_media_index', + ]) + ->setLabel('bitbag_sylius_cms_plugin.ui.media') + ->setLabelAttribute('icon', 'file') ; } } diff --git a/src/Resources/config/grids/admin/block.yml b/src/Resources/config/grids/admin/block.yml index a1a83f4c1..fefc7f2c4 100755 --- a/src/Resources/config/grids/admin/block.yml +++ b/src/Resources/config/grids/admin/block.yml @@ -9,6 +9,10 @@ sylius_grid: code: asc limits: [10, 25, 50] fields: + name: + type: string + label: bitbag_sylius_cms_plugin.ui.name + sortable: name code: type: string label: sylius.ui.code @@ -26,6 +30,12 @@ sylius_grid: path: . options: template: "@BitBagSyliusCmsPlugin/Grid/Field/collections.html.twig" + channels: + type: twig + label: bitbag_sylius_cms_plugin.ui.channels + path: . + options: + template: "@BitBagSyliusCmsPlugin/Grid/Field/channels.html.twig" filters: search: type: string diff --git a/src/Resources/config/grids/admin/collection.yml b/src/Resources/config/grids/admin/collection.yml index 7a1411a64..f7ed286bf 100755 --- a/src/Resources/config/grids/admin/collection.yml +++ b/src/Resources/config/grids/admin/collection.yml @@ -9,6 +9,10 @@ sylius_grid: code: asc limits: [10, 25, 50] fields: + name: + type: string + label: bitbag_sylius_cms_plugin.ui.name + sortable: translation.name code: type: string label: bitbag_sylius_cms_plugin.ui.code @@ -17,10 +21,6 @@ sylius_grid: type: string label: bitbag_sylius_cms_plugin.ui.type sortable: ~ - name: - type: string - label: bitbag_sylius_cms_plugin.ui.name - sortable: translation.name filters: search: type: string diff --git a/src/Resources/config/grids/admin/media.yml b/src/Resources/config/grids/admin/media.yml index e5608163f..a6704c109 100644 --- a/src/Resources/config/grids/admin/media.yml +++ b/src/Resources/config/grids/admin/media.yml @@ -25,12 +25,23 @@ sylius_grid: type: string label: bitbag_sylius_cms_plugin.ui.code sortable: ~ - path: - type: string - label: bitbag_sylius_cms_plugin.ui.path - type: - type: string - label: bitbag_sylius_cms_plugin.ui.type + enabled: + type: twig + label: sylius.ui.enabled + options: + template: "@SyliusUi/Grid/Field/enabled.html.twig" + collections: + type: twig + label: bitbag_sylius_cms_plugin.ui.collections + path: . + options: + template: "@BitBagSyliusCmsPlugin/Grid/Field/collections.html.twig" + channels: + type: twig + label: bitbag_sylius_cms_plugin.ui.channels + path: . + options: + template: "@BitBagSyliusCmsPlugin/Grid/Field/channels.html.twig" filters: search: type: string diff --git a/src/Resources/config/grids/admin/page.yml b/src/Resources/config/grids/admin/page.yml index 854106cb9..ae1117952 100755 --- a/src/Resources/config/grids/admin/page.yml +++ b/src/Resources/config/grids/admin/page.yml @@ -9,24 +9,31 @@ sylius_grid: code: asc limits: [10, 25, 50] fields: - code: - type: string - label: bitbag_sylius_cms_plugin.ui.code - sortable: ~ name: type: string label: bitbag_sylius_cms_plugin.ui.name sortable: name - slug: + code: type: string - label: bitbag_sylius_cms_plugin.ui.slug - sortable: translation.slug + label: bitbag_sylius_cms_plugin.ui.code + sortable: ~ + enabled: + type: twig + label: sylius.ui.enabled + options: + template: "@SyliusUi/Grid/Field/enabled.html.twig" collections: type: twig label: bitbag_sylius_cms_plugin.ui.collections path: . options: template: "@BitBagSyliusCmsPlugin/Grid/Field/collections.html.twig" + channels: + type: twig + label: bitbag_sylius_cms_plugin.ui.channels + path: . + options: + template: "@BitBagSyliusCmsPlugin/Grid/Field/channels.html.twig" filters: search: type: string diff --git a/src/Resources/views/Block/Crud/_form.html.twig b/src/Resources/views/Block/Crud/_form.html.twig index e46f05f78..d6d326322 100755 --- a/src/Resources/views/Block/Crud/_form.html.twig +++ b/src/Resources/views/Block/Crud/_form.html.twig @@ -5,8 +5,8 @@