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
22 lines
830 B
Twig
22 lines
830 B
Twig
{% extends 'base.html.twig' %}
|
|
|
|
{% block title %}Posts{% endblock %}
|
|
|
|
{% block body %}
|
|
{% for post in posts.iterator %}
|
|
<div class="card mb-4">
|
|
<div class="card-body">
|
|
<h5 class="card-title"><a href="{{ path('app_post_show', {id: post.id}) }}">{{ post.species ? post.species.vernacularName : 'Post' }}</a></h5>
|
|
<h6 class="card-subtitle mb-2 text-muted">{{ post.foundDate | date("d/m/Y \\à H \\h") }}</h6>
|
|
<p class="card-subtitle mb-2 text-muted">{{ post.latitude }}, {{ post.longitude }}, {{ post.altitude }}m</p>
|
|
<p class="card-text">{{ post.commentary }}</p>
|
|
</div>
|
|
<div class="card-footer">
|
|
28 ❤️
|
|
{{ post.comments.count() }} 💬
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% include '_pagination.html.twig' %}
|
|
{% endblock %}
|