Files
herbarium/templates/post/show.html.twig
Clément FRÉVILLE 6a6a135891 Allow uploading images (#13)
Adds an optional field for the post image.

Fixes #12

Co-authored-by: clfreville2 <clement.freville2@etu.uca.fr>
Reviewed-on: https://codefirst.iut.uca.fr/git/clement.freville2/herbarium/pulls/13
Reviewed-by: Bastien OLLIER <bastien.ollier@noreply.codefirst.iut.uca.fr>
2024-06-12 09:05:30 +02:00

66 lines
1.9 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}Post{% endblock %}
{% block body %}
<h1>Post</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ post.id }}</td>
</tr>
<tr>
<th>FoundDate</th>
<td>{{ post.foundDate ? post.foundDate|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>PublicationDate</th>
<td>{{ post.publicationDate ? post.publicationDate|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>Latitude</th>
<td>{{ post.latitude }}</td>
</tr>
<tr>
<th>Longitude</th>
<td>{{ post.longitude }}</td>
</tr>
<tr>
<th>Altitude</th>
<td>{{ post.altitude }}</td>
</tr>
{% if post.image %}
<tr>
<th>Image</th>
<td><img src="{{ vich_uploader_asset(post, 'imageFile') }}" class="img-thumbnail" width="200" alt=""></td>
</tr>
{% endif %}
<tr>
<th>Commentary</th>
<td>{{ post.commentary }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_post_index') }}">back to list</a>
<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 %}