fix post form

This commit is contained in:
Simon Vieille 2021-03-30 22:42:31 +02:00
parent 37c351419c
commit b5a7adbc7d
6 changed files with 11 additions and 6 deletions

1
.gitignore vendored
View File

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

View File

@ -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,

View File

@ -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());
}
}
*/
}
}

View File

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

View File

@ -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>

View File

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