Browse Source

fix post form

develop
Simon Vieille 2 weeks ago
parent
commit
b5a7adbc7d
  1. 1
      .gitignore
  2. 4
      src/Controller/Blog/CategoryAdminController.php
  3. 2
      src/EventSuscriber/Blog/PostEventSubscriber.php
  4. 2
      src/Form/Blog/PostType.php
  5. 4
      templates/blog/post_admin/edit.html.twig
  6. 4
      templates/blog/post_admin/new.html.twig

1
.gitignore

@ -26,3 +26,4 @@ yarn-error.log
/public/uploads/
!/public/uploads/.gitkeep
/data
/.mage.yml

4
src/Controller/Blog/CategoryAdminController.php

@ -23,7 +23,9 @@ class CategoryAdminController extends AdminController
*/
public function index(int $page = 1, RepositoryQuery $query, Request $request): Response
{
$pager = $query->paginate($page);
$pager = $query
->orderBy('.title', 'ASC')
->paginate($page, 100);
return $this->render('blog/category_admin/index.html.twig', [
'pager' => $pager,

2
src/EventSuscriber/Blog/PostEventSubscriber.php

@ -72,7 +72,6 @@ class PostEventSubscriber extends EntityManagerEventSubscriber
protected function removeOrphanUploads()
{
/*
$finder = new Finder();
$finder->files()->in('uploads/post');
@ -89,6 +88,5 @@ class PostEventSubscriber extends EntityManagerEventSubscriber
$this->filesystem->remove($file->getRealPath());
}
}
*/
}
}

2
src/Form/Blog/PostType.php

@ -47,8 +47,8 @@ class PostType extends AbstractType
'label' => 'Format',
'required' => true,
'choices' => [
'HTML' => 'html',
'Markdown' => 'markdown',
'HTML' => 'html',
],
'constraints' => [
new NotBlank(),

4
templates/blog/post_admin/edit.html.twig

@ -49,7 +49,9 @@
</div>
</div>
{{ form_rest(form) }}
<div class="d-none">
{{ form_rest(form) }}
</div>
</form>
<form method="post" action="{{ path('admin_blog_post_delete', {entity: entity.id}) }}" id="form-delete" data-form-confirm>

4
templates/blog/post_admin/new.html.twig

@ -36,6 +36,8 @@
</div>
</div>
{{ form_rest(form) }}
<div class="d-none">
{{ form_rest(form) }}
</div>
</form>
{% endblock %}
Loading…
Cancel
Save