Implement comments (#10)
Allow logged users to comment posts. Edition is not allowed via the API since it doesn't support auth yet. Symfony UX is used with Turbo to avoid full pages reload, without JavaScript™. Co-authored-by: clfreville2 <clement.freville2@etu.uca.fr> Reviewed-on: https://codefirst.iut.uca.fr/git/clement.freville2/herbarium/pulls/10
This commit is contained in:
@@ -43,4 +43,17 @@
|
||||
<a href="{{ path('app_post_edit', {'id': post.id}) }}">edit</a>
|
||||
|
||||
{{ include('post/_delete_form.html.twig') }}
|
||||
|
||||
<div data-turbo="true">
|
||||
<div id="comments">
|
||||
{% for comment in post.comments %}
|
||||
{{ include('/comment/comment.html.twig') }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button type="submit" class="btn btn-primary">Comment</button>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user