Files
herbarium/templates/post/table.html.twig
Bastien OLLIER 0beb0cd95f Update interface (#17)
Co-authored-by: bastien ollier <bastien.ollier@etu.uca.fr>
Reviewed-on: https://codefirst.iut.uca.fr/git/clement.freville2/herbarium/pulls/17
Reviewed-by: Clément FRÉVILLE <clement.freville2@etu.uca.fr>
Co-authored-by: Bastien OLLIER <bastien.ollier@noreply.codefirst.iut.uca.fr>
Co-committed-by: Bastien OLLIER <bastien.ollier@noreply.codefirst.iut.uca.fr>
2024-06-13 09:30:25 +02:00

46 lines
1.5 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}{{ 'post_index'|trans }}{% endblock %}
{% block body %}
<h1>{{ 'post_index'|trans }}</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>{{ 'found_date'|trans }}</th>
<th>{{ 'publication_date'|trans }}</th>
<th>Latitude</th>
<th>Longitude</th>
<th>Altitude</th>
<th>{{ 'commentary'|trans }}</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for post in posts %}
<tr>
<td>{{ post.id }}</td>
<td>{{ post.foundDate ? post.foundDate|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ post.publicationDate ? post.publicationDate|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ post.latitude }}</td>
<td>{{ post.longitude }}</td>
<td>{{ post.altitude }}</td>
<td>{{ post.commentary }}</td>
<td>
<a href="{{ path('app_post_show', {'id': post.id}) }}">{{ 'show'|trans }}</a>
<a class="btn btn-success mb-4 mt-4" href="{{ path('app_post_edit', {'id': post.id}) }}">{{ 'edit'|trans }}</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="8">{{ 'no_records_found'|trans }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_post_new') }}">{{ 'create_new'|trans }}</a>
{% endblock %}