commments: add basic form in template

This commit is contained in:
Mathieu Jaumotte 2021-12-14 10:25:36 +01:00
parent 8b2a8544b8
commit 530267a9b0
3 changed files with 29 additions and 4 deletions

View File

@ -227,22 +227,24 @@ class AccompanyingCourseController extends Controller
public function commentAction(AccompanyingPeriod $accompanyingCourse, Request $request): Response
{
/*
$form = $this->createForm(AccompanyingCourseCommentType::class, $comment, []);
$comment = new AccompanyingPeriod\Comment();
$form = $this->createForm(AccompanyingCourseCommentType::class, $comment, []);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($comment);
$em->flush();
return $this->redirectToRoute($route);
}
*/
return $this->render('@ChillPerson/AccompanyingCourse/comment_list.html.twig', [
'accompanyingCourse' => $accompanyingCourse,
// 'form' => $form->createView()
'form' => $form->createView()
]);
}

View File

@ -29,6 +29,25 @@
{% block content %}
<div class="accompanyingcourse-comment-list">
<h1>{{ block('title') }}</h1>
<div class="form my-5">
{{ form_start(form) }}
{{ form_errors(form) }}
{{ form_widget(form.content) }}
<ul class="record_actions">
<li>
<button class="btn btn-create" type="submit">{{ 'Post a new comment'|trans }}</button>
{#
<button class="btn btn-update" type="submit">{{ 'Edit a comment'|trans }}</button>
#}
</li>
</ul>
{{ form_end(form) }}
</div>
<div class="flex-table">
{% if accompanyingCourse.pinnedComment %}

View File

@ -407,9 +407,13 @@ Choose a person to locate by: Localiser auprès d'un usager concerné
Associate at least one member with an household, and set an address to this household: Associez au moins un membre du parcours à un ménage, et indiquez une adresse à ce ménage.
Locate by: Localiser auprès de
fix it: Compléter
# Accompanying Course comments
Accompanying Course Comment: Commentaire
Accompanying Course Comment list: Commentaires du parcours
pinned: épinglé
Post a new comment: Poster un nouveau commentaire
Edit a comment: Modifier le commentaire
# Household
Household: Ménage