From 4227400cf976c5a295fc4d73f5c40601dd19d158 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 7 Feb 2025 17:24:11 +0100 Subject: [PATCH 01/35] remove console.log --- src/core/Resources/assets/js/modules/modal.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/core/Resources/assets/js/modules/modal.js b/src/core/Resources/assets/js/modules/modal.js index 427d024..4caa06b 100644 --- a/src/core/Resources/assets/js/modules/modal.js +++ b/src/core/Resources/assets/js/modules/modal.js @@ -104,8 +104,6 @@ module.exports = function () { } } - console.log(dataAttributes) - openModal(url, createModal, dataAttributes) }, 250) }) From 3755fcccf167951b1b579b491959b87c55542a29 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 28 Feb 2025 10:11:46 +0100 Subject: [PATCH 02/35] feat(FileUploadHandler): allow to upload multiple files add specific callback "afterUploadsCallback" when multiple files are uploaded --- src/core/Form/FileUploadHandler.php | 52 +++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/src/core/Form/FileUploadHandler.php b/src/core/Form/FileUploadHandler.php index 5dd6c50..d3b68bf 100644 --- a/src/core/Form/FileUploadHandler.php +++ b/src/core/Form/FileUploadHandler.php @@ -20,27 +20,53 @@ class FileUploadHandler return $this; } - public function handleForm(?UploadedFile $uploadedFile, string $path, ?callable $afterUploadCallback = null, bool $keepOriginalFilename = false): void + public function handleForm( + null|array|UploadedFile $uploadedFile, + string $path, + ?callable $afterUploadCallback = null, + ?callable $afterUploadsCallback = null, + bool $keepOriginalFilename = false + ): null|array|string { if (null === $uploadedFile) { - return; + return null; } - $originalFilename = pathinfo($uploadedFile->getClientOriginalName(), PATHINFO_FILENAME); + if (is_array($uploadedFile)) { + $filenames = []; - if ($keepOriginalFilename) { - $filename = $originalFilename.'.'.$uploadedFile->guessExtension(); - } elseif (!is_callable($this->filenameGenerator)) { - $safeFilename = transliterator_transliterate('Any-Latin; Latin-ASCII; [^A-Za-z0-9_] remove; Lower()', $originalFilename); - $filename = date('Ymd-his').$safeFilename.'.'.$uploadedFile->guessExtension(); + foreach ($uploadedFile as $file) { + $filename = $this->handleForm($file, $path, $afterUploadCallback, null, $keepOriginalFilename); + + if ($filename !== null) { + $filenames[] = $filename; + } + } + + if (!empty($filenames) && $afterUploadsCallback) { + $afterUploadsCallback($filenames); + } + + return $filenames; } else { - $filename = call_user_func($this->filenameGenerator, $uploadedFile); - } + $originalFilename = pathinfo($uploadedFile->getClientOriginalName(), PATHINFO_FILENAME); - $uploadedFile->move($path, $filename); + if ($keepOriginalFilename) { + $filename = $originalFilename.'.'.$uploadedFile->guessExtension(); + } elseif (!is_callable($this->filenameGenerator)) { + $safeFilename = transliterator_transliterate('Any-Latin; Latin-ASCII; [^A-Za-z0-9_] remove; Lower()', $originalFilename); + $filename = date('Ymd-his').$safeFilename.'.'.$uploadedFile->guessExtension(); + } else { + $filename = call_user_func($this->filenameGenerator, $uploadedFile); + } - if ($afterUploadCallback) { - $afterUploadCallback($filename); + $uploadedFile->move($path, $filename); + + if ($afterUploadCallback) { + $afterUploadCallback($filename); + } + + return $filename; } } } From 9e1d4a7ae9ef48dec270054d8e0d804e69a30cec Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 28 Feb 2025 10:12:42 +0100 Subject: [PATCH 03/35] update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed8328c..eac59b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## [Unreleased] +### Added +* FileUploadHandler: allow to upload multiple files + ## [v1.25.2] - 2025-02-07 ### Added * allow to set `data-*` attributes on modal From 05ed084986bafa829fd0abef5848a672ea8c5e75 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 28 Feb 2025 11:37:50 +0100 Subject: [PATCH 04/35] feat(CrudController): allow to add callables after creation, update and delation --- CHANGELOG.md | 1 + .../Controller/Admin/Crud/CrudController.php | 80 +++++++++++++++++-- 2 files changed, 74 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eac59b0..26cef10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Added * FileUploadHandler: allow to upload multiple files +* CrudController: allow to add callables after creation, update and delation ## [v1.25.2] - 2025-02-07 ### Added diff --git a/src/core/Controller/Admin/Crud/CrudController.php b/src/core/Controller/Admin/Crud/CrudController.php index 22e4f25..2cc123d 100644 --- a/src/core/Controller/Admin/Crud/CrudController.php +++ b/src/core/Controller/Admin/Crud/CrudController.php @@ -26,7 +26,13 @@ abstract class CrudController extends AdminController abstract protected function getConfiguration(): CrudConfiguration; - protected function doIndex(int $page, RepositoryQuery $query, Request $request, Session $session, string $context = 'index'): Response + protected function doIndex( + int $page, + RepositoryQuery $query, + Request $request, + Session $session, + string $context = 'index' + ): Response { $configuration = $this->getConfiguration(); @@ -50,7 +56,14 @@ abstract class CrudController extends AdminController ]); } - protected function doNew(EntityInterface $entity, EntityManager $entityManager, Request $request, callable $beforeCreate = null, string $context = 'new'): Response + protected function doNew( + EntityInterface $entity, + EntityManager $entityManager, + Request $request, + callable $beforeCreate = null, + callable $afterCreate = null, + string $context = 'new' + ): Response { $configuration = $this->getConfiguration(); @@ -67,6 +80,11 @@ abstract class CrudController extends AdminController } $entityManager->create($entity); + + if (null !== $afterCreate) { + call_user_func_array($afterCreate, [$entity, $form, $request]); + } + $this->addFlash('success', 'The data has been saved.'); return $this->redirectToRoute($configuration->getPageRoute('edit'), array_merge( @@ -96,7 +114,14 @@ abstract class CrudController extends AdminController ]); } - protected function doEdit(EntityInterface $entity, EntityManager $entityManager, Request $request, callable $beforeUpdate = null, string $context = 'edit'): Response + protected function doEdit( + EntityInterface $entity, + EntityManager $entityManager, + Request $request, + callable $beforeUpdate = null, + callable $afterUpdate = null, + string $context = 'edit' + ): Response { $configuration = $this->getConfiguration(); @@ -113,6 +138,11 @@ abstract class CrudController extends AdminController } $entityManager->update($entity); + + if (null !== $afterUpdate) { + call_user_func_array($afterUpdate, [$entity, $form, $request]); + } + $this->addFlash('success', 'The data has been saved.'); return $this->redirectToRoute($configuration->getPageRoute($context), array_merge( @@ -131,7 +161,15 @@ abstract class CrudController extends AdminController ]); } - protected function doInlineEdit(string $context, string $label, EntityInterface $entity, EntityManager $entityManager, Request $request, callable $beforeUpdate = null): Response + protected function doInlineEdit( + string $context, + string $label, + EntityInterface $entity, + EntityManager $entityManager, + Request $request, + callable $beforeUpdate = null, + callable $afterUpdate = null + ): Response { $configuration = $this->getConfiguration(); @@ -192,6 +230,11 @@ abstract class CrudController extends AdminController $session->remove($lastRequestId); $entityManager->update($entity); + + if (null !== $afterUpdate) { + call_user_func_array($afterUpdate, [$entity, $form, $request]); + } + $this->addFlash('success', 'The data has been saved.'); return $this->redirect($redirectTo); @@ -217,7 +260,13 @@ abstract class CrudController extends AdminController ]); } - protected function doSort(int $page, RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session): Response + protected function doSort( + int $page, + RepositoryQuery $query, + EntityManager $entityManager, + Request $request, + Session $session + ): Response { $configuration = $this->getConfiguration(); $context = $request->query->get('context', 'index'); @@ -255,7 +304,13 @@ abstract class CrudController extends AdminController return $this->json([]); } - protected function doBatch(int $page, RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session): Response + protected function doBatch( + int $page, + RepositoryQuery $query, + EntityManager $entityManager, + Request $request, + Session $session + ): Response { $configuration = $this->getConfiguration(); $datas = $request->request->get('batch', []); @@ -326,7 +381,14 @@ abstract class CrudController extends AdminController return $this->json([]); } - protected function doDelete(EntityInterface $entity, EntityManager $entityManager, Request $request, callable $beforeDelete = null, string $route = 'index'): Response + protected function doDelete( + EntityInterface $entity, + EntityManager $entityManager, + Request $request, + callable $beforeDelete = null, + callable $afterDelete = null, + string $route = 'index' + ): Response { $configuration = $this->getConfiguration(); @@ -337,6 +399,10 @@ abstract class CrudController extends AdminController $entityManager->delete($entity); + if (null !== $afterDelete) { + call_user_func($afterDelete, $entity); + } + $this->addFlash('success', 'The data has been removed.'); } From c0db55d467a4cfc7634b6eb0b1813d98f4b52305 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 28 Feb 2025 14:43:59 +0100 Subject: [PATCH 05/35] fix(form): handle multiple files in form template --- .../form/bootstrap_4_form_theme.html.twig | 48 +++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig index 8690d63..6c92354 100644 --- a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig +++ b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig @@ -42,30 +42,38 @@ {% endif %} {% if value %} - {% if fileType in ['auto', 'image'] and value.extension in ['jpeg', 'jpg', 'gif', 'png', 'svg', 'webp'] %} -
-
- - - -
-
- {{- parent() -}} -
-
- {% else %} -
-
- {{- parent() -}} + {% if not value is iterable %} + {% set value = [value] %} + {% endif %} - - {% endif %} + {% else %} +
+
+ {{- parent() -}} + + +
+
+ {% endif %} + {% endfor %} {% else %} {{- parent() -}} {% endif %} From aac4e21a65f8703742cfefeaeeadb683a50b5790 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 28 Feb 2025 15:15:12 +0100 Subject: [PATCH 06/35] fix(form): handle multiple files in form template --- .../form/bootstrap_4_form_theme.html.twig | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig index 6c92354..d937d6d 100644 --- a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig +++ b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig @@ -33,7 +33,7 @@ {% block file_widget -%}
- {% set value = form.vars.data %} + {% set data = form.vars.data %} {% if form.parent.vars.file_type is defined %} {% set fileType = form.parent.vars.file_type %} @@ -41,39 +41,33 @@ {% set fileType = 'auto' %} {% endif %} - {% if value %} - {% if not value is iterable %} - {% set value = [value] %} + {% if data and form.vars.errors|length == 0 %} + {% if not data is iterable %} + {% set data = [data] %} {% endif %} - {% for item in value %} - {% set padding = value|length > 0 and not loop.last ? 'pt-2' : '' %} - - {% if fileType in ['auto', 'image'] and item.extension in ['jpeg', 'jpg', 'gif', 'png', 'svg', 'webp'] %} -
+
+ {% for item in data %} + {% if fileType in ['auto', 'image'] and item.extension in ['jpeg', 'jpg', 'gif', 'png', 'svg', 'webp'] %} + {% else %}
- {{- parent() -}} -
-
- {% else %} -
-
- {{- parent() -}} -
-
- {% endif %} - {% endfor %} + {% endif %} + {% endfor %} +
+ {{- parent() -}} +
+
{% else %} {{- parent() -}} {% endif %} From f125d04af799df85cfd3ef2d9707076101d2d633 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 11 Mar 2025 16:49:24 +0100 Subject: [PATCH 07/35] fix(crud): use context variable to retrieve the form and the form options --- src/core/Controller/Admin/Crud/CrudController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/Controller/Admin/Crud/CrudController.php b/src/core/Controller/Admin/Crud/CrudController.php index 2cc123d..7d7092f 100644 --- a/src/core/Controller/Admin/Crud/CrudController.php +++ b/src/core/Controller/Admin/Crud/CrudController.php @@ -69,7 +69,7 @@ abstract class CrudController extends AdminController $this->prepareEntity($entity); - $form = $this->createForm($configuration->getForm('new'), $entity, $configuration->getFormOptions($context)); + $form = $this->createForm($configuration->getForm($context), $entity, $configuration->getFormOptions($context)); if ($request->isMethod('POST')) { $form->handleRequest($request); @@ -127,7 +127,7 @@ abstract class CrudController extends AdminController $this->prepareEntity($entity); - $form = $this->createForm($configuration->getForm('edit'), $entity, $configuration->getFormOptions($context)); + $form = $this->createForm($configuration->getForm($context), $entity, $configuration->getFormOptions($context)); if ($request->isMethod('POST')) { $form->handleRequest($request); @@ -412,13 +412,13 @@ abstract class CrudController extends AdminController protected function doFilter(Session $session, string $context = 'filter'): Response { $configuration = $this->getConfiguration(); - $type = $configuration->getForm('filter'); + $type = $configuration->getForm($context); if (null === $type) { throw $this->createNotFoundException(); } - $form = $this->createForm($type, null, $configuration->getFormOptions('filter')); + $form = $this->createForm($type, null, $configuration->getFormOptions($context)); $form->submit($session->get($form->getName(), [])); return $this->render($configuration->getView($context), [ From 5f07ad2c283c8a718c3a88f7ae454dec9f98b852 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 11 Mar 2025 16:50:02 +0100 Subject: [PATCH 08/35] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26cef10..dcbcaa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ### Added * FileUploadHandler: allow to upload multiple files * CrudController: allow to add callables after creation, update and delation +### Fixed +* fix(crud): use context variable to retrieve the form and the form options ## [v1.25.2] - 2025-02-07 ### Added From 1c977a91a1e63787e7b508093cead4ba0ec31e74 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 12 Mar 2025 12:19:35 +0100 Subject: [PATCH 09/35] fix(node): use `false` instead of `O` in query --- CHANGELOG.md | 1 + src/core/Repository/Site/NodeRepository.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcbcaa6..d779bab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * CrudController: allow to add callables after creation, update and delation ### Fixed * fix(crud): use context variable to retrieve the form and the form options +* fix(node): use `false` instead of `O` in query ## [v1.25.2] - 2025-02-07 ### Added diff --git a/src/core/Repository/Site/NodeRepository.php b/src/core/Repository/Site/NodeRepository.php index b962835..7f34466 100644 --- a/src/core/Repository/Site/NodeRepository.php +++ b/src/core/Repository/Site/NodeRepository.php @@ -18,7 +18,7 @@ class NodeRepository extends NestedTreeRepository $query = $this->createQueryBuilder('n') ->join('n.menu', 'm') ->where('n.url = :url') - ->andWhere('n.disableUrl = 0') + ->andWhere('n.disableUrl = false') ->andWhere('n.aliasNode is null') ->andWhere('m.navigation = :navigation') ->setParameter(':url', $url) From b33235b4b24e54c6eb2455e920272f6ee608d966 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 12 Mar 2025 12:55:02 +0100 Subject: [PATCH 10/35] fix(FsFileManager): fix regression when using UploadHandler --- src/core/FileManager/FsFileManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/FileManager/FsFileManager.php b/src/core/FileManager/FsFileManager.php index b49eac0..8c85407 100644 --- a/src/core/FileManager/FsFileManager.php +++ b/src/core/FileManager/FsFileManager.php @@ -233,7 +233,7 @@ class FsFileManager $directory .= '/'.trim(dirname($fullPaths[$key]), '/'); } - $this->uploadHandler->handleForm($file, $directory, null, true); + $this->uploadHandler->handleForm($file, $directory, keepOriginalFilename: true); } } From 65a86c315f36ee7395c3358e74bff9eb52d969ab Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 17 Mar 2025 10:53:09 +0100 Subject: [PATCH 11/35] CrudConfiguration::setShowActions: add context when setting this parameter --- CHANGELOG.md | 3 +++ src/core/Crud/CrudConfiguration.php | 10 +++++----- .../Resources/views/admin/crud/index.html.twig | 16 +++++++++------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d779bab..da01117 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,14 @@ ## [Unreleased] +## [v1.26.0] - 2025-03-17 ### Added * FileUploadHandler: allow to upload multiple files * CrudController: allow to add callables after creation, update and delation ### Fixed * fix(crud): use context variable to retrieve the form and the form options * fix(node): use `false` instead of `O` in query +### Changed +* CrudConfiguration::setShowActions: add context when setting this parameter ## [v1.25.2] - 2025-02-07 ### Added diff --git a/src/core/Crud/CrudConfiguration.php b/src/core/Crud/CrudConfiguration.php index badea06..c8d8935 100644 --- a/src/core/Crud/CrudConfiguration.php +++ b/src/core/Crud/CrudConfiguration.php @@ -27,7 +27,7 @@ class CrudConfiguration protected array $isSortableCollection = []; protected string $sortableCollectionProperty = 'sortOrder'; protected ?string $defaultLocale = null; - protected bool $showActions = true; + protected array $showActions = []; protected static $self; @@ -369,15 +369,15 @@ class CrudConfiguration return $this->sortableCollectionProperty; } - public function setShowActions(bool $showActions): self + public function setShowActions(string $page, bool $showActions): self { - $this->showActions = $showActions; + $this->showActions[$page] = $showActions; return $this; } - public function getShowActions(): bool + public function getShowActions(string $page): bool { - return $this->showActions; + return $this->showActions[$page] ?? true; } } diff --git a/src/core/Resources/views/admin/crud/index.html.twig b/src/core/Resources/views/admin/crud/index.html.twig index 039ac1e..a76c9b7 100644 --- a/src/core/Resources/views/admin/crud/index.html.twig +++ b/src/core/Resources/views/admin/crud/index.html.twig @@ -149,7 +149,7 @@ {% endblock %} {% endfor %} - {% if configuration.showActions %} + {% if configuration.showActions(context) %} {{ 'Actions'|trans }} @@ -184,14 +184,16 @@ {% block list_item %} {%- set dbClick %} - {% if configuration.action(context, 'show', true, [item]) %} - {{ path(configuration.pageRoute('show'), {entity: item.id}|merge(configuration.pageRouteParams('show'))) }} - {% elseif configuration.action(context, 'edit', true, [item]) %} - {{ path(configuration.pageRoute('edit'), {entity: item.id}|merge(configuration.pageRouteParams('show'))) }} + {% if configuration.doubleClick(context) %} + {% if configuration.action(context, 'show', true, [item]) %} + {{ path(configuration.pageRoute('show'), {entity: item.id}|merge(configuration.pageRouteParams('show'))) }} + {% elseif configuration.action(context, 'edit', true, [item]) %} + {{ path(configuration.pageRoute('edit'), {entity: item.id}|merge(configuration.pageRouteParams('show'))) }} + {% endif %} {% endif %} {% endset -%} - + {% if configuration.hasBatchAction(context) %} @@ -228,7 +230,7 @@ {% endfor %} - {% if configuration.showActions %} + {% if configuration.showActions(context) %} {% block list_item_actions %} {% block list_item_actions_before %}{% endblock %} From e7bf50fc87dcc6eb535274261d2ff846acd86600 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 17 Mar 2025 10:55:11 +0100 Subject: [PATCH 12/35] release v1.26.0 --- src/core/Murph.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Murph.php b/src/core/Murph.php index 2c46c1e..621f419 100644 --- a/src/core/Murph.php +++ b/src/core/Murph.php @@ -3,7 +3,7 @@ namespace App\Core; if (!defined('MURPH_VERSION')) { - define('MURPH_VERSION', 'v1.25.1'); + define('MURPH_VERSION', 'v1.26.0'); } /** From 850098d9666153d72f4a65a0e3fe82741a2eb1ce Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 17 Mar 2025 11:30:37 +0100 Subject: [PATCH 13/35] crud: remove whitespaces on dbClick url --- .../Resources/views/admin/crud/index.html.twig | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/Resources/views/admin/crud/index.html.twig b/src/core/Resources/views/admin/crud/index.html.twig index a76c9b7..596fdaf 100644 --- a/src/core/Resources/views/admin/crud/index.html.twig +++ b/src/core/Resources/views/admin/crud/index.html.twig @@ -183,15 +183,15 @@ {% endif %} {% block list_item %} - {%- set dbClick %} - {% if configuration.doubleClick(context) %} - {% if configuration.action(context, 'show', true, [item]) %} - {{ path(configuration.pageRoute('show'), {entity: item.id}|merge(configuration.pageRouteParams('show'))) }} - {% elseif configuration.action(context, 'edit', true, [item]) %} - {{ path(configuration.pageRoute('edit'), {entity: item.id}|merge(configuration.pageRouteParams('show'))) }} - {% endif %} - {% endif %} - {% endset -%} + {%- set dbClick -%} + {%- if configuration.doubleClick(context) -%} + {%- if configuration.action(context, 'show', true, [item]) -%} + {{- path(configuration.pageRoute('show'), {entity: item.id}|merge(configuration.pageRouteParams('show'))) -}} + {%- elseif configuration.action(context, 'edit', true, [item]) -%} + {{- path(configuration.pageRoute('edit'), {entity: item.id}|merge(configuration.pageRouteParams('show'))) -}} + {%- endif -%} + {%- endif -%} + {%- endset -%} {% if configuration.hasBatchAction(context) %} From 6c8363a654e91d3d8eaa0f9abe64cf056e0badfd Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 16 May 2025 16:54:24 +0200 Subject: [PATCH 14/35] add option `removeItemButton: true` when applying choices.js --- CHANGELOG.md | 3 +++ src/core/Resources/assets/js/modules/choices.js | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da01117..dfa3346 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## [Unreleased] +### Added +* add option `removeItemButton: true` when applying choices.js + ## [v1.26.0] - 2025-03-17 ### Added * FileUploadHandler: allow to upload multiple files diff --git a/src/core/Resources/assets/js/modules/choices.js b/src/core/Resources/assets/js/modules/choices.js index 74b179b..4e86b16 100644 --- a/src/core/Resources/assets/js/modules/choices.js +++ b/src/core/Resources/assets/js/modules/choices.js @@ -4,6 +4,7 @@ module.exports = () => { document.querySelectorAll('*[data-jschoice]').forEach((item) => { return new Choices(item, { searchFields: ['label'], + removeItemButton: true, }) }) } From 4e8d96888d2cf429ee3508bd9a3d54eaa4cd4a6b Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sat, 17 May 2025 12:06:05 +0200 Subject: [PATCH 15/35] feat(builder): add more types for input setting --- .../assets/js/components/builder-block/BuilderBlockSetting.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Resources/assets/js/components/builder-block/BuilderBlockSetting.vue b/src/core/Resources/assets/js/components/builder-block/BuilderBlockSetting.vue index 5738f5d..0090545 100644 --- a/src/core/Resources/assets/js/components/builder-block/BuilderBlockSetting.vue +++ b/src/core/Resources/assets/js/components/builder-block/BuilderBlockSetting.vue @@ -3,7 +3,7 @@ Date: Mon, 19 May 2025 12:01:50 +0200 Subject: [PATCH 16/35] feat(collection): add delete_attr, add_attr options --- src/core/Form/Type/CollectionType.php | 13 +++++++++++++ .../views/form/bootstrap_4_form_theme.html.twig | 6 ++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/core/Form/Type/CollectionType.php b/src/core/Form/Type/CollectionType.php index 3670c38..5c91d90 100644 --- a/src/core/Form/Type/CollectionType.php +++ b/src/core/Form/Type/CollectionType.php @@ -16,12 +16,23 @@ class CollectionType extends BaseCollectionType { parent::buildView($view, $form, $options); + $classes = [ + 'add_attr' => 'collection-add', + 'delete_attr' => 'text-right', + ]; + + foreach ($classes as $key => $class) { + $options[$key]['class'] = $class.' '.($options[$key]['class'] ?? ''); + } + $view->vars = array_replace($view->vars, [ 'collection_name' => $options['collection_name'], 'label_add' => $options['label_add'], 'label_delete' => $options['label_delete'], 'allow_add' => $options['allow_add'], 'allow_delete' => $options['allow_delete'], + 'add_attr' => $options['add_attr'], + 'delete_attr' => $options['delete_attr'], 'template_before_item' => $options['template_before_item'], 'template_after_item' => $options['template_after_item'], ]); @@ -37,6 +48,8 @@ class CollectionType extends BaseCollectionType 'label_delete' => 'Delete', 'template_before_item' => null, 'template_after_item' => null, + 'add_attr' => [], + 'delete_attr' => [], ]); } diff --git a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig index d937d6d..61dd5a3 100644 --- a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig +++ b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig @@ -78,6 +78,8 @@ {% block collection_block_widget %} {% set allow_delete = allow_delete|default(false) %} {% set allow_add = allow_add|default(false) %} + {% set add_attr = allow_add|default({}) %} + {% set delete_attr = allow_add|default({}) %}
{% for item in form.value %} @@ -87,7 +89,7 @@ {% endfor %} {% if allow_delete %} -
+
@@ -101,7 +103,7 @@
{% if allow_add %} -
+
{{ label_add|trans }} From 6da7ad5f300e00461183fad4e7bf89a469d62c97 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 19 May 2025 12:04:10 +0200 Subject: [PATCH 17/35] feat(collection): add delete_attr, add_attr options --- .../Resources/views/form/bootstrap_4_form_theme.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig index 61dd5a3..040b3f1 100644 --- a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig +++ b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig @@ -89,7 +89,7 @@ {% endfor %} {% if allow_delete %} -
+
@@ -103,7 +103,7 @@
{% if allow_add %} -
+
{{ label_add|trans }} From cef0179fa3161e82386570b8fc39751afd581f2c Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 19 May 2025 12:07:52 +0200 Subject: [PATCH 18/35] feat(collection): add delete_attr, add_attr options --- .../Resources/views/form/bootstrap_4_form_theme.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig index 040b3f1..95cd921 100644 --- a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig +++ b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig @@ -147,7 +147,7 @@ {% endif %} {% if allow_delete %} -
+
@@ -161,7 +161,7 @@
{% if allow_add %} -
+
{{ label_add|trans }} From 1f2f05a57505cbee4a787ae3a2d430ce6b349cb1 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 19 May 2025 12:08:54 +0200 Subject: [PATCH 19/35] feat(collection): add delete_attr, add_attr options --- .../Resources/views/form/bootstrap_4_form_theme.html.twig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig index 95cd921..68cac6d 100644 --- a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig +++ b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig @@ -78,8 +78,8 @@ {% block collection_block_widget %} {% set allow_delete = allow_delete|default(false) %} {% set allow_add = allow_add|default(false) %} - {% set add_attr = allow_add|default({}) %} - {% set delete_attr = allow_add|default({}) %} + {% set add_attr = add_attr|default({}) %} + {% set delete_attr = delete_attr|default({}) %}
{% for item in form.value %} @@ -130,6 +130,8 @@ {% set attrs = attr|merge({class: 'mb-1 ' ~ (attr.class ?? '')}) %} {% set allow_delete = allow_delete|default(false) %} {% set allow_add = allow_add|default(false) %} + {% set add_attr = add_attr|default({}) %} + {% set delete_attr = delete_attr|default({}) %}
{% for item in form %} From 46bde2bb2d8a5b7f73adaf2d5a97c4090a7e280c Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 19 May 2025 12:11:12 +0200 Subject: [PATCH 20/35] feat(collection): add delete_attr, add_attr options --- .../Resources/views/form/bootstrap_4_form_theme.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig index 68cac6d..554f34a 100644 --- a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig +++ b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig @@ -115,7 +115,7 @@ {{ form_rest(form.value.vars.prototype) }} {% if allow_delete %} -
+
{{ label_delete|trans }} @@ -175,7 +175,7 @@ {{ form_rest(form.vars.prototype) }} {% if allow_delete %} -
+
{{ label_delete|trans }} From 22e596bed9f0738077d9be5e23e892aa72e275e2 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 19 May 2025 12:11:55 +0200 Subject: [PATCH 21/35] feat(collection): add delete_attr, add_attr options --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfa3346..6e75bb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Added * add option `removeItemButton: true` when applying choices.js +* feat(collection): add delete_attr, add_attr options ## [v1.26.0] - 2025-03-17 ### Added From eb5fd22c273a4ded6780495e1664e0c4b006e514 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 19 May 2025 19:22:47 +0200 Subject: [PATCH 22/35] feat(builder): allow to add block between children --- CHANGELOG.md | 1 + src/core/Resources/assets/css/admin.scss | 14 +- .../components/builder-block/BuilderBlock.vue | 12 +- .../builder-block/BuilderBlockCreate.vue | 8 +- .../builder-block/BuilderBlockItem.vue | 229 +++++++++--------- 5 files changed, 150 insertions(+), 114 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e75bb2..4cb1d03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Added * add option `removeItemButton: true` when applying choices.js * feat(collection): add delete_attr, add_attr options +* feat(builder): allow to add block between children ## [v1.26.0] - 2025-03-17 ### Added diff --git a/src/core/Resources/assets/css/admin.scss b/src/core/Resources/assets/css/admin.scss index a38fb98..b97cba7 100644 --- a/src/core/Resources/assets/css/admin.scss +++ b/src/core/Resources/assets/css/admin.scss @@ -761,11 +761,15 @@ label.required::after { } .builder-widget { + .container { + max-width: 100%; + } + .block { border: 1px solid rgba(map-get($theme-colors, 'dark-blue'), 0.3); padding: 10px; border-radius: 4px; - margin-bottom: 10px; + margin-bottom: 5px; background: rgba(map-get($theme-colors, 'dark-blue'), 0.02); } @@ -874,4 +878,12 @@ label.required::after { min-height: 50vh; } } + + .dragger { + cursor: pointer; + color: #6c757d; + border-color: #6c757d; + text-align: center; + vertical-align: middle; + } } diff --git a/src/core/Resources/assets/js/components/builder-block/BuilderBlock.vue b/src/core/Resources/assets/js/components/builder-block/BuilderBlock.vue index 88a7f6f..44ffc53 100644 --- a/src/core/Resources/assets/js/components/builder-block/BuilderBlock.vue +++ b/src/core/Resources/assets/js/components/builder-block/BuilderBlock.vue @@ -34,7 +34,17 @@ @remove-item="removeBlock(key)" @drag-start="dragStart" @drag-end="dragEnd" - /> + > + +
-
-
-
-
- +
+
+
+
- + + - {{ widget.label }} + {{ widget.label }} +
+ + + +
- + {{ truncate(item.settings[widget.preview]) }} +
- +
+ + {{ item.id }} + + +
-
- {{ truncate(item.settings[widget.preview]) }} +
+
+ +
-
- - {{ item.id }} - - -
-
- -
-
- -
-
- -
- -
- - - - - -
-
+
-
+ + + + + +
+
+ + +
+
+
@@ -159,7 +168,7 @@ export default { depth: { type: Number, required: true - } + }, }, data() { return { From acf5255e4e6d759988aab1288458a524c1157298 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 20 May 2025 19:30:35 +0200 Subject: [PATCH 23/35] feat(builder): improve UI to add new block --- CHANGELOG.md | 1 + src/core/Resources/assets/css/admin.scss | 80 +++++++++++-------- .../components/builder-block/BuilderBlock.vue | 16 ++-- .../builder-block/BuilderBlockCreate.vue | 6 +- .../builder-block/BuilderBlockItem.vue | 16 ++-- 5 files changed, 65 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cb1d03..8524a87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * add option `removeItemButton: true` when applying choices.js * feat(collection): add delete_attr, add_attr options * feat(builder): allow to add block between children +* feat(builder): improve UI to add new block ## [v1.26.0] - 2025-03-17 ### Added diff --git a/src/core/Resources/assets/css/admin.scss b/src/core/Resources/assets/css/admin.scss index b97cba7..b11c614 100644 --- a/src/core/Resources/assets/css/admin.scss +++ b/src/core/Resources/assets/css/admin.scss @@ -766,15 +766,14 @@ label.required::after { } .block { - border: 1px solid rgba(map-get($theme-colors, 'dark-blue'), 0.3); - padding: 10px; + box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px; + padding: 15px; border-radius: 4px; - margin-bottom: 5px; background: rgba(map-get($theme-colors, 'dark-blue'), 0.02); } > .block { - border: 1px solid map-get($theme-colors, 'dark-blue'); + box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px; } .block-header { @@ -788,9 +787,6 @@ label.required::after { } } - $block-colors: #E183F5 #E3F7C6 #82DDF5 #F5BA82 #A088A6; - $block-colors-length: length($block-colors); - .block .block-icon { > * { display: inline-block; @@ -798,38 +794,36 @@ label.required::after { } } - @for $i from 1 through 100 { - $block-color-index: ($block-colors-length + $i) % $block-colors-length + 1; - - .block-depth-#{$i} { - .block-label { - background: nth($block-colors, $block-color-index); - border: 1px solid darken(nth($block-colors, $block-color-index), 50%); - color: darken(nth($block-colors, $block-color-index), 50%); - } - - .builder-add .btn { - background: nth($block-colors, $block-color-index); - border: 1px solid darken(nth($block-colors, $block-color-index), 50%); - color: darken(nth($block-colors, $block-color-index), 50%); - } - } - } - .builder-add { - width: 100%; - &-top { margin-top: 7px; } - .btn { - font-size: 12px; - line-height: 14px; - padding: 3px 5px; + &-button { + cursor: pointer; + background: rgba(map-get($theme-colors, 'dark-blue'), 0.1); + text-align: center; + padding-bottom: 5px; + margin: 8px 0; + border-radius: 4px; + + &:hover { + background: rgba(map-get($theme-colors, 'dark-blue'), 0.2); + } + + .btn { + font-size: 12px; + line-height: 14px; + padding: 3px 5px; + } } } + .block-root { + border: 1px solid map-get($theme-colors, 'dark-blue'); + box-shadow: none; + } + .block-root > .container .builder-add { margin-top: 0; } @@ -844,10 +838,6 @@ label.required::after { } } - .block .block { - margin-top: 10px; - } - .block-id { font-size: 12px; margin-right: 5px; @@ -886,4 +876,24 @@ label.required::after { text-align: center; vertical-align: middle; } + + $block-colors: #E183F5 #E3F7C6 #82DDF5 #F5BA82 #A088A6; + $block-colors-length: length($block-colors); + + @for $i from 1 through 100 { + $block-color-index: ($block-colors-length + $i) % $block-colors-length + 1; + + .block-depth-#{$i} { + .block-label { + background: nth($block-colors, $block-color-index); + border: 1px solid darken(nth($block-colors, $block-color-index), 50%); + color: darken(nth($block-colors, $block-color-index), 50%); + } + + .builder-add-button:hover { + background: nth($block-colors, $block-color-index); + color: darken(nth($block-colors, $block-color-index), 50%); + } + } + } } diff --git a/src/core/Resources/assets/js/components/builder-block/BuilderBlock.vue b/src/core/Resources/assets/js/components/builder-block/BuilderBlock.vue index 44ffc53..f7edb9b 100644 --- a/src/core/Resources/assets/js/components/builder-block/BuilderBlock.vue +++ b/src/core/Resources/assets/js/components/builder-block/BuilderBlock.vue @@ -46,14 +46,14 @@
-
- + +
- +
+ + +
diff --git a/src/core/Resources/assets/js/components/builder-block/BuilderBlockItem.vue b/src/core/Resources/assets/js/components/builder-block/BuilderBlockItem.vue index 0b34619..854eaee 100644 --- a/src/core/Resources/assets/js/components/builder-block/BuilderBlockItem.vue +++ b/src/core/Resources/assets/js/components/builder-block/BuilderBlockItem.vue @@ -117,14 +117,14 @@
-
- + +
Date: Sun, 25 May 2025 18:00:58 +0200 Subject: [PATCH 24/35] feat(builder): allow to define `allowed_widgets` in form options --- CHANGELOG.md | 1 + .../BuilderBlock/Block/Bootstrap/BootstrapBlock.php | 2 +- src/core/BuilderBlock/Block/Editor/EditorBlock.php | 2 +- src/core/Form/Type/BuilderType.php | 4 ++++ .../js/components/builder-block/BuilderBlock.vue | 11 ++++++++--- src/core/Resources/assets/js/modules/builder-block.js | 4 +++- .../views/form/bootstrap_4_form_theme.html.twig | 3 ++- 7 files changed, 20 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8524a87..64c58e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Added * add option `removeItemButton: true` when applying choices.js +* feat(builder): allow to define `allowed_widgets` in form options * feat(collection): add delete_attr, add_attr options * feat(builder): allow to add block between children * feat(builder): improve UI to add new block diff --git a/src/core/BuilderBlock/Block/Bootstrap/BootstrapBlock.php b/src/core/BuilderBlock/Block/Bootstrap/BootstrapBlock.php index 12fc12e..1f332ba 100644 --- a/src/core/BuilderBlock/Block/Bootstrap/BootstrapBlock.php +++ b/src/core/BuilderBlock/Block/Bootstrap/BootstrapBlock.php @@ -5,7 +5,7 @@ namespace App\Core\BuilderBlock\Block\Bootstrap; use App\Core\BuilderBlock\BuilderBlock; use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; -class BootstrapBlock extends BuilderBlock +abstract class BootstrapBlock extends BuilderBlock { public function configure() { diff --git a/src/core/BuilderBlock/Block/Editor/EditorBlock.php b/src/core/BuilderBlock/Block/Editor/EditorBlock.php index e89296a..3172048 100644 --- a/src/core/BuilderBlock/Block/Editor/EditorBlock.php +++ b/src/core/BuilderBlock/Block/Editor/EditorBlock.php @@ -5,7 +5,7 @@ namespace App\Core\BuilderBlock\Block\Editor; use App\Core\BuilderBlock\BuilderBlock; use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; -class EditorBlock extends BuilderBlock +abstract class EditorBlock extends BuilderBlock { public function configure() { diff --git a/src/core/Form/Type/BuilderType.php b/src/core/Form/Type/BuilderType.php index d1f32d5..1f2fd09 100644 --- a/src/core/Form/Type/BuilderType.php +++ b/src/core/Form/Type/BuilderType.php @@ -19,6 +19,7 @@ class BuilderType extends AbstractType parent::buildView($view, $form, $options); $view->vars = array_replace($view->vars, [ + 'allowed_widgets' => $options['allowed_widgets'], ]); } @@ -28,7 +29,10 @@ class BuilderType extends AbstractType $resolver->setDefaults([ 'compound' => false, + 'allowed_widgets' => [], ]); + + $resolver->setAllowedTypes('allowed_widgets', 'array'); } public function getBlockPrefix() diff --git a/src/core/Resources/assets/js/components/builder-block/BuilderBlock.vue b/src/core/Resources/assets/js/components/builder-block/BuilderBlock.vue index f7edb9b..b13233c 100644 --- a/src/core/Resources/assets/js/components/builder-block/BuilderBlock.vue +++ b/src/core/Resources/assets/js/components/builder-block/BuilderBlock.vue @@ -8,7 +8,7 @@ :container="value" :widgets="widgets" :openedBlocks="openedBlocks" - :allowedWidgets="[]" + :allowedWidgets="allowedWidgets" v-if="value.length > 0" position="top" /> @@ -40,7 +40,7 @@ :container="value" :widgets="widgets" :openedBlocks="openedBlocks" - :allowedWidgets="[]" + :allowedWidgets="allowedWidgets" :position="key" /> @@ -50,7 +50,7 @@ :container="value" :widgets="widgets" :openedBlocks="openedBlocks" - :allowedWidgets="[]" + :allowedWidgets="allowedWidgets" position="bottom" />
@@ -100,6 +100,11 @@ export default { initialValue: { type: Array, required: false, + }, + allowedWidgets: { + type: Array, + required: false, + default: [], } }, data() { diff --git a/src/core/Resources/assets/js/modules/builder-block.js b/src/core/Resources/assets/js/modules/builder-block.js index 5c87bfc..1e70e89 100644 --- a/src/core/Resources/assets/js/modules/builder-block.js +++ b/src/core/Resources/assets/js/modules/builder-block.js @@ -12,12 +12,14 @@ module.exports = () => { el: component, template: ``, data() { return { - value: JSON.parse(component.getAttribute('data-value')) + value: JSON.parse(component.getAttribute('data-value')), + allowedWidgets: JSON.parse(component.getAttribute('data-allowedwidgets')), } }, components: { diff --git a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig index 554f34a..735bad5 100644 --- a/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig +++ b/src/core/Resources/views/form/bootstrap_4_form_theme.html.twig @@ -3,13 +3,14 @@ {% block builder_widget %} {% set row_attr = row_attr|merge({class: 'builder-widget ' ~ (row_attr.class ?? '')}) %} {% set value = value is iterable ? value|json_encode : value %} + {% set allowed_widgets = allowed_widgets is iterable ? allowed_widgets|json_encode : allowed_widgets %} {% if value == '' %} {% set value = '[]' %} {% endif %}
-
+
{% endblock %} From b609c2fb2e60af74571a5c68f976cb831695ad61 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 20 Nov 2025 11:46:21 +0100 Subject: [PATCH 25/35] fix(crud): use route params to redirect after a delation --- CHANGELOG.md | 4 ++++ src/core/Controller/Admin/Crud/CrudController.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64c58e5..6ea8bf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased] +### Fixed + +* fix(crud): use route params to redirect after a delation + ### Added * add option `removeItemButton: true` when applying choices.js * feat(builder): allow to define `allowed_widgets` in form options diff --git a/src/core/Controller/Admin/Crud/CrudController.php b/src/core/Controller/Admin/Crud/CrudController.php index 7d7092f..810087f 100644 --- a/src/core/Controller/Admin/Crud/CrudController.php +++ b/src/core/Controller/Admin/Crud/CrudController.php @@ -406,7 +406,7 @@ abstract class CrudController extends AdminController $this->addFlash('success', 'The data has been removed.'); } - return $this->redirectToRoute($configuration->getPageRoute($route)); + return $this->redirectToRoute($configuration->getPageRoute($route), $configuration->getPageRouteParams($route)); } protected function doFilter(Session $session, string $context = 'filter'): Response From 799ae00730f812c519b5ff35405765a086b7cbed Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 26 Nov 2025 15:19:47 +0100 Subject: [PATCH 26/35] feat(settings): allow to edit a setting in plain page --- CHANGELOG.md | 1 + .../NavigationSettingAdminController.php | 16 ++-- .../Setting/SettingAdminController.php | 14 ++- src/core/Entity/NavigationSetting.php | 15 +++ src/core/Entity/Setting.php | 15 +++ .../Resources/views/admin/layout.html.twig | 2 + .../navigation_setting_admin/edit.html.twig | 95 +++++++++++++++---- .../setting/setting_admin/edit.html.twig | 95 +++++++++++++++---- .../setting/setting_admin/index.html.twig | 26 +++-- .../site/navigation_admin/_show.html.twig | 27 ++++-- src/core/Setting/NavigationSettingManager.php | 10 +- src/core/Setting/SettingManager.php | 9 +- 12 files changed, 262 insertions(+), 63 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ea8bf5..2f0be78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * feat(collection): add delete_attr, add_attr options * feat(builder): allow to add block between children * feat(builder): improve UI to add new block +* feat(settings): allow to edit a setting in plain page ## [v1.26.0] - 2025-03-17 ### Added diff --git a/src/core/Controller/Setting/NavigationSettingAdminController.php b/src/core/Controller/Setting/NavigationSettingAdminController.php index 4a3be8f..74bbb68 100644 --- a/src/core/Controller/Setting/NavigationSettingAdminController.php +++ b/src/core/Controller/Setting/NavigationSettingAdminController.php @@ -35,6 +35,8 @@ class NavigationSettingAdminController extends AdminController $session = $request->getSession(); $lastRequestId = sprintf('setting_request_%s_%s', get_class($entity), $entity->getId()); $lastRequest = $session->get($lastRequestId); + $options = $entity->getOptions(); + $optionView = $options['view'] ?? 'modal'; if (null !== $lastRequest && !$request->isMethod('POST')) { $fakeRequest = Request::create( @@ -64,17 +66,19 @@ class NavigationSettingAdminController extends AdminController $session->set($lastRequestId, $request->request->get('form')); $this->addFlash('warning', 'The form is not valid.'); - return $this->redirect(sprintf( - '%s?data-modal=%s', - $redirectTo, - urlencode($request->getUri()) - )); + if ($optionView === 'modal') { + return $this->redirect(sprintf( + '%s?data-modal=%s', + $redirectTo, + urlencode($request->getUri()) + )); + } } return $this->render('@Core/setting/navigation_setting_admin/edit.html.twig', [ 'form' => $form->createView(), 'entity' => $entity, - 'options' => $event->getData()['options'], + 'options' => $options, 'redirectTo' => $redirectTo, ]); } diff --git a/src/core/Controller/Setting/SettingAdminController.php b/src/core/Controller/Setting/SettingAdminController.php index 317fe77..707a19e 100644 --- a/src/core/Controller/Setting/SettingAdminController.php +++ b/src/core/Controller/Setting/SettingAdminController.php @@ -55,6 +55,8 @@ class SettingAdminController extends AdminController $session = $request->getSession(); $lastRequestId = sprintf('setting_request_%s_%s', get_class($entity), $entity->getId()); $lastRequest = $session->get($lastRequestId); + $options = $entity->getOptions(); + $optionView = $options['view'] ?? 'modal'; if (null !== $lastRequest && !$request->isMethod('POST')) { $fakeRequest = Request::create( @@ -82,11 +84,13 @@ class SettingAdminController extends AdminController $session->set($lastRequestId, $request->request->get('form')); $this->addFlash('warning', 'The form is not valid.'); - return $this->redirect(sprintf( - '%s?data-modal=%s', - $redirectTo, - urlencode($request->getUri()) - )); + if ($optionView === 'modal') { + return $this->redirect(sprintf( + '%s?data-modal=%s', + $redirectTo, + urlencode($request->getUri()) + )); + } } return $this->render('@Core/setting/setting_admin/edit.html.twig', [ diff --git a/src/core/Entity/NavigationSetting.php b/src/core/Entity/NavigationSetting.php index bfaa2ac..8adfb36 100644 --- a/src/core/Entity/NavigationSetting.php +++ b/src/core/Entity/NavigationSetting.php @@ -26,6 +26,9 @@ class NavigationSetting implements EntityInterface #[ORM\Column(type: 'text', nullable: true)] protected $value; + #[ORM\Column(type: 'text', nullable: true)] + protected $options; + #[ORM\ManyToOne(targetEntity: Navigation::class, inversedBy: 'navigationSettings')] #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')] protected $navigation; @@ -94,4 +97,16 @@ class NavigationSetting implements EntityInterface return $this; } + + public function getOptions() + { + return json_decode($this->options, true) ?? []; + } + + public function setOptions(?array $options): self + { + $this->options = json_encode($options ?? []); + + return $this; + } } diff --git a/src/core/Entity/Setting.php b/src/core/Entity/Setting.php index d4a1036..032e74a 100644 --- a/src/core/Entity/Setting.php +++ b/src/core/Entity/Setting.php @@ -25,6 +25,9 @@ class Setting implements EntityInterface #[ORM\Column(type: 'text', nullable: true)] protected $value; + #[ORM\Column(type: 'text', nullable: true)] + protected $options; + public function getId(): ?int { return $this->id; @@ -77,4 +80,16 @@ class Setting implements EntityInterface return $this; } + + public function getOptions() + { + return json_decode($this->options, true) ?? []; + } + + public function setOptions(?array $options): self + { + $this->options = json_encode($options ?? []); + + return $this; + } } diff --git a/src/core/Resources/views/admin/layout.html.twig b/src/core/Resources/views/admin/layout.html.twig index f6195ed..fd97838 100644 --- a/src/core/Resources/views/admin/layout.html.twig +++ b/src/core/Resources/views/admin/layout.html.twig @@ -1,4 +1,5 @@ {% apply spaceless %} +{% block html %} @@ -62,4 +63,5 @@ {% endblock %} +{% endblock %} {% endapply %} diff --git a/src/core/Resources/views/setting/navigation_setting_admin/edit.html.twig b/src/core/Resources/views/setting/navigation_setting_admin/edit.html.twig index 6e7c2a3..52a9aff 100644 --- a/src/core/Resources/views/setting/navigation_setting_admin/edit.html.twig +++ b/src/core/Resources/views/setting/navigation_setting_admin/edit.html.twig @@ -1,20 +1,77 @@ - +{% extends '@Core/admin/layout.html.twig' %} +{% set view = entity.options['view']|default('modal') %} + +{% block html %} + {% if view == 'modal' %} + + {% else %} + {{ parent() }} + {% endif %} +{% endblock %} + +{% block body_class %}has-form{% endblock %} + +{% block title %}{{ entity.label }}{% endblock %} + +{% block body %} + {% block header %} +
+
+ {% block header_title %} +

{{ entity.label }}

+ {% endblock %} + + {% block header_actions %} +
+
+ + + + {{ 'Back to the list'|trans }} + + + + +
+
+ {% endblock %} +
+
+ {% endblock %} + + {% block form %} +
+
+
+
+ {{ include('@Core/setting/navigation_setting_admin/_form.html.twig') }} +
+
+
+
+ {% endblock %} +{% endblock %} diff --git a/src/core/Resources/views/setting/setting_admin/edit.html.twig b/src/core/Resources/views/setting/setting_admin/edit.html.twig index 4bce97d..3836be1 100644 --- a/src/core/Resources/views/setting/setting_admin/edit.html.twig +++ b/src/core/Resources/views/setting/setting_admin/edit.html.twig @@ -1,20 +1,77 @@ - +{% extends '@Core/admin/layout.html.twig' %} +{% set view = entity.options['view']|default('modal') %} + +{% block html %} + {% if view == 'modal' %} + + {% else %} + {{ parent() }} + {% endif %} +{% endblock %} + +{% block body_class %}has-form{% endblock %} + +{% block title %}{{ entity.label }}{% endblock %} + +{% block body %} + {% block header %} +
+
+ {% block header_title %} +

{{ entity.label }}

+ {% endblock %} + + {% block header_actions %} +
+
+ + + + {{ 'Back to the list'|trans }} + + + + +
+
+ {% endblock %} +
+
+ {% endblock %} + + {% block form %} +
+
+
+
+ {{ include('@Core/setting/setting_admin/_form.html.twig') }} +
+
+
+
+ {% endblock %} +{% endblock %} diff --git a/src/core/Resources/views/setting/setting_admin/index.html.twig b/src/core/Resources/views/setting/setting_admin/index.html.twig index 7bf6c28..1ce4fe8 100644 --- a/src/core/Resources/views/setting/setting_admin/index.html.twig +++ b/src/core/Resources/views/setting/setting_admin/index.html.twig @@ -22,21 +22,35 @@ {% for item in pager %} + {% set view = item.options['view']|default('modal') %} {% set edit = path('admin_setting_edit', {entity: item.id, redirectTo: app.request.pathInfo}) %} - - {{ item.label|trans }} - + {% if view == 'modal' %} + + {{ item.label }} + + {% else %} + + {{ item.label }} + + {% endif %} {{ item.section|trans }} - - - + {% if view == 'modal' %} + + + + {% else %} + + + + {% endif %} + diff --git a/src/core/Resources/views/site/navigation_admin/_show.html.twig b/src/core/Resources/views/site/navigation_admin/_show.html.twig index f71b8df..54566de 100644 --- a/src/core/Resources/views/site/navigation_admin/_show.html.twig +++ b/src/core/Resources/views/site/navigation_admin/_show.html.twig @@ -54,21 +54,36 @@ {% for item in datas.settings %} + {% set view = item.options['view']|default('modal') %} + {% set edit = path('admin_navigation_setting_edit', {entity: item.id, redirectTo: app.request.pathInfo}) %} - - {{ item.label|trans }} - + {% if view == 'modal' %} + + {{ item.label }} + + {% else %} + + {{ item.label }} + + {% endif %} {{ item.section|trans }} - - - + {% if view == 'modal' %} + + + + {% else %} + + + + {% endif %} + diff --git a/src/core/Setting/NavigationSettingManager.php b/src/core/Setting/NavigationSettingManager.php index 91e038f..0d1a042 100644 --- a/src/core/Setting/NavigationSettingManager.php +++ b/src/core/Setting/NavigationSettingManager.php @@ -24,7 +24,14 @@ class NavigationSettingManager ) { } - public function init($navigation, string $code, string $section, string $label, $value = null) + public function init( + $navigation, + string $code, + string $section, + string $label, + $value = null, + array $options = [], + ) { $entity = $this->get($this->getNavigation($navigation), $code); $isNew = null === $entity; @@ -37,6 +44,7 @@ class NavigationSettingManager $entity ->setSection($section) ->setLabel($label) + ->setOptions($options) ; if ($isNew) { diff --git a/src/core/Setting/SettingManager.php b/src/core/Setting/SettingManager.php index da60fee..01e9f7e 100644 --- a/src/core/Setting/SettingManager.php +++ b/src/core/Setting/SettingManager.php @@ -21,7 +21,13 @@ class SettingManager ) { } - public function init(string $code, string $section, string $label, $value = null) + public function init( + string $code, + string $section, + string $label, + $value = null, + array $options = [], + ) { $entity = $this->get($code); $isNew = null === $entity; @@ -34,6 +40,7 @@ class SettingManager $entity ->setSection($section) ->setLabel($label) + ->setOptions($options) ; if ($isNew) { From 19a78b9359fa2e38da0b3893b184f1c58739215c Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 22 Dec 2025 17:36:08 +0100 Subject: [PATCH 27/35] feat(crud/index): allow to define row attributes --- CHANGELOG.md | 1 + src/core/Crud/CrudConfiguration.php | 23 +++++++++++++++++++ .../views/admin/crud/index.html.twig | 5 +++- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f0be78..b8a532d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * feat(builder): allow to add block between children * feat(builder): improve UI to add new block * feat(settings): allow to edit a setting in plain page +* feat(crud/index): allow to define row attributes ## [v1.26.0] - 2025-03-17 ### Added diff --git a/src/core/Crud/CrudConfiguration.php b/src/core/Crud/CrudConfiguration.php index c8d8935..c083d9d 100644 --- a/src/core/Crud/CrudConfiguration.php +++ b/src/core/Crud/CrudConfiguration.php @@ -2,6 +2,8 @@ namespace App\Core\Crud; +use App\Core\Entity\EntityInterface; + /** * class CrudConfiguration. * @@ -28,6 +30,7 @@ class CrudConfiguration protected string $sortableCollectionProperty = 'sortOrder'; protected ?string $defaultLocale = null; protected array $showActions = []; + protected array $listRowAttributes = []; protected static $self; @@ -247,6 +250,26 @@ class CrudConfiguration return $this->viewDatas[$context][$name] ?? $defaultValue; } + public function setListRowAttributes(string $context, array $attributes): self + { + $this->listRowAttributes[$context] = $attributes; + + return $this; + } + + public function getListRowAttributes(string $context, EntityInterface $entity): array + { + $attributes = $this->listRowAttributes[$context] ?? []; + + foreach ($attributes as $key => $attribute) { + if (is_callable($attribute)) { + $attributes[$key] = $attribute($entity); + } + } + + return $attributes; + } + // -- public function setField(string $context, string $label, string $field, array $options): self diff --git a/src/core/Resources/views/admin/crud/index.html.twig b/src/core/Resources/views/admin/crud/index.html.twig index 596fdaf..fa5dcda 100644 --- a/src/core/Resources/views/admin/crud/index.html.twig +++ b/src/core/Resources/views/admin/crud/index.html.twig @@ -193,7 +193,10 @@ {%- endif -%} {%- endset -%} - + {% set rowAttributes = configuration.listRowAttributes(context, item) %} + {% set rowClasses = rowAttributes['class']|default('') %} + + {% if configuration.hasBatchAction(context) %} From b1b01b202ca34a970847d1a0109fffa315749b9e Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 22 Dec 2025 17:38:53 +0100 Subject: [PATCH 28/35] release v1.27.0 --- CHANGELOG.md | 2 +- src/core/Murph.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8a532d..9e5def0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## [Unreleased] +## [v1.27.0] - 2025-12-22 ### Fixed - * fix(crud): use route params to redirect after a delation ### Added diff --git a/src/core/Murph.php b/src/core/Murph.php index 621f419..e46eda8 100644 --- a/src/core/Murph.php +++ b/src/core/Murph.php @@ -3,7 +3,7 @@ namespace App\Core; if (!defined('MURPH_VERSION')) { - define('MURPH_VERSION', 'v1.26.0'); + define('MURPH_VERSION', 'v1.27.0'); } /** From 5a01d768837f56e16fcbfbd59f07ccdeca97e115 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 22 Dec 2025 19:23:39 +0100 Subject: [PATCH 29/35] feat(repository): add RepositoryQuery::addCaseInsensitiveFilters() feat(repository): add RepositoryQuery::addForcedFilterHandler() --- CHANGELOG.md | 4 ++++ src/core/Repository/RepositoryQuery.php | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e5def0..44ba768 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased] +### Added +* feat(repository): add RepositoryQuery::addCaseInsensitiveFilters() +* feat(repository): add RepositoryQuery::addForcedFilterHandler() + ## [v1.27.0] - 2025-12-22 ### Fixed * fix(crud): use route params to redirect after a delation diff --git a/src/core/Repository/RepositoryQuery.php b/src/core/Repository/RepositoryQuery.php index 904c965..b9d22b7 100644 --- a/src/core/Repository/RepositoryQuery.php +++ b/src/core/Repository/RepositoryQuery.php @@ -18,6 +18,7 @@ abstract class RepositoryQuery protected PaginatorInterface $paginator; protected string $id; protected array $forcedFilterHandlers = []; + protected array $caseInsensitiveFilters = []; public function __construct(ServiceEntityRepository $repository, string $id, PaginatorInterface $paginator = null) { @@ -88,7 +89,11 @@ abstract class RepositoryQuery $this->andWhere('.'.$name.' = :'.$name); $this->setParameter(':'.$name, $value); } elseif (is_string($value)) { - $this->andWhere('.'.$name.' LIKE :'.$name); + if (in_array($name, $this->caseInsensitiveFilters)) { + $this->andWhere(sprintf('LOWER (.%1$s) LIKE LOWER(:%1$d)', $name)); + } else { + $this->andWhere('.'.$name.' LIKE :'.$name); + } $this->setParameter(':'.$name, '%'.$value.'%'); } else { $this->filterHandler($name, $value); @@ -142,4 +147,18 @@ abstract class RepositoryQuery protected function filterHandler(string $name, $value) { } + + protected function addCaseInsensitiveFilters(string $name): self + { + $this->caseInsensitiveFilters[] = $name; + + return $this; + } + + protected function addForcedFilterHandlers(string $name): self + { + $this->forcedFilterHandlers[] = $name; + + return $this; + } } From 14465d4982d3a7ca70676a8c80d21a2083f6d705 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 22 Dec 2025 19:30:29 +0100 Subject: [PATCH 30/35] feat(repository): add RepositoryQuery::addCaseInsensitiveFilters() feat(repository): add RepositoryQuery::addForcedFilterHandler() --- src/core/Repository/RepositoryQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Repository/RepositoryQuery.php b/src/core/Repository/RepositoryQuery.php index b9d22b7..b16581e 100644 --- a/src/core/Repository/RepositoryQuery.php +++ b/src/core/Repository/RepositoryQuery.php @@ -90,7 +90,7 @@ abstract class RepositoryQuery $this->setParameter(':'.$name, $value); } elseif (is_string($value)) { if (in_array($name, $this->caseInsensitiveFilters)) { - $this->andWhere(sprintf('LOWER (.%1$s) LIKE LOWER(:%1$d)', $name)); + $this->andWhere(sprintf('LOWER ( .%1$s) LIKE LOWER(:%1$d)', $name)); } else { $this->andWhere('.'.$name.' LIKE :'.$name); } From 2e2b0bce10a8291aec02b2ef645097de05c364b7 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 22 Dec 2025 19:32:01 +0100 Subject: [PATCH 31/35] feat(repository): add RepositoryQuery::addCaseInsensitiveFilters() feat(repository): add RepositoryQuery::addForcedFilterHandler() --- src/core/Repository/RepositoryQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Repository/RepositoryQuery.php b/src/core/Repository/RepositoryQuery.php index b16581e..e2943b0 100644 --- a/src/core/Repository/RepositoryQuery.php +++ b/src/core/Repository/RepositoryQuery.php @@ -90,7 +90,7 @@ abstract class RepositoryQuery $this->setParameter(':'.$name, $value); } elseif (is_string($value)) { if (in_array($name, $this->caseInsensitiveFilters)) { - $this->andWhere(sprintf('LOWER ( .%1$s) LIKE LOWER(:%1$d)', $name)); + $this->andWhere(sprintf('LOWER ( .%1$s) LIKE LOWER(:%1$s)', $name)); } else { $this->andWhere('.'.$name.' LIKE :'.$name); } From 0fa748fd3596b6374e94388f27f64c8c821170c1 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 23 Dec 2025 09:49:59 +0100 Subject: [PATCH 32/35] fix(crud/index): fix row attribute value render --- CHANGELOG.md | 3 +++ src/core/Resources/views/admin/crud/index.html.twig | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44ba768..93ebbca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ * feat(repository): add RepositoryQuery::addCaseInsensitiveFilters() * feat(repository): add RepositoryQuery::addForcedFilterHandler() +### Fixed +* fix(crud/index): fix row attribute value render + ## [v1.27.0] - 2025-12-22 ### Fixed * fix(crud): use route params to redirect after a delation diff --git a/src/core/Resources/views/admin/crud/index.html.twig b/src/core/Resources/views/admin/crud/index.html.twig index fa5dcda..ae40134 100644 --- a/src/core/Resources/views/admin/crud/index.html.twig +++ b/src/core/Resources/views/admin/crud/index.html.twig @@ -196,7 +196,7 @@ {% set rowAttributes = configuration.listRowAttributes(context, item) %} {% set rowClasses = rowAttributes['class']|default('') %} - + {% if configuration.hasBatchAction(context) %} From 7fbbad9909bf6ddd27186904a24dd5ac50625ebc Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sat, 21 Feb 2026 23:03:20 +0100 Subject: [PATCH 33/35] fix(crud/navigation_setting): fix form action --- CHANGELOG.md | 1 + .../views/setting/navigation_setting_admin/edit.html.twig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93ebbca..739f460 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Fixed * fix(crud/index): fix row attribute value render +* fix(crud/navigation_setting): fix form action ## [v1.27.0] - 2025-12-22 ### Fixed diff --git a/src/core/Resources/views/setting/navigation_setting_admin/edit.html.twig b/src/core/Resources/views/setting/navigation_setting_admin/edit.html.twig index 52a9aff..e1488ef 100644 --- a/src/core/Resources/views/setting/navigation_setting_admin/edit.html.twig +++ b/src/core/Resources/views/setting/navigation_setting_admin/edit.html.twig @@ -13,7 +13,7 @@
From 5ba5e93d145821b8386c1270e714a767e22d1955 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 9 Mar 2026 10:43:51 +0100 Subject: [PATCH 34/35] fix(crud/template): use default route params --- src/core/Resources/views/admin/crud/show.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Resources/views/admin/crud/show.html.twig b/src/core/Resources/views/admin/crud/show.html.twig index 2cefa56..d98dd22 100644 --- a/src/core/Resources/views/admin/crud/show.html.twig +++ b/src/core/Resources/views/admin/crud/show.html.twig @@ -18,7 +18,7 @@ {% block header_actions_before %}{% endblock %} {% if configuration.action(context, 'back', true) %} - + {{ configuration.actionTitle(context, 'back', 'Back to the list')|trans }} @@ -27,7 +27,7 @@ {% endif %} {% if configuration.action(context, 'edit', true, [entity]) %} - + From 173dc17a89bebbc94a2a02592c8ab0750d11d5f4 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 9 Mar 2026 10:44:00 +0100 Subject: [PATCH 35/35] doc: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 739f460..7761553 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Fixed * fix(crud/index): fix row attribute value render * fix(crud/navigation_setting): fix form action +* fix(crud/template): use default route params ## [v1.27.0] - 2025-12-22 ### Fixed