templates/lancer_un_post/showpost.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Affichage d'un Post{% endblock %}
  3. {% block body %}
  4. <div style="height: auto; margin:15px 15px; list-style-type: none; border: 2px solid white; border-radius: 10px; padding: 20px; font-size: 20px;">
  5.     <h1 style="display:flex;flex-direction:row; justify-content:center;box-shadow: 15px 1px 55px #5ED9F4; padding: 15px 15px;">{{ postDetails.title }}</h1>
  6.     <!-- Pseudo et date de création et catégorie -->
  7.     <p style="font-size: 20px;">
  8.         Créé par <strong>
  9.             <a href="{{ path('app_envoyer_message', { 'username': postDetails.username }) }}">
  10.                 {{ postDetails.username }}
  11.             </a>
  12.         </strong> le {{ postDetails.creationDate|date('d/m/Y H:i') }} | {{ postDetails.name }}
  13.     </p>
  14.     
  15.     <!-- Image facultative -->
  16.     {% if postDetails.image %}
  17.     <div style="text-align: center;">
  18.         <img src="{{ asset('uploads/images/' ~ postDetails.image) }}" style="max-width: 60%; ">
  19.     </div>
  20.     {% endif %}
  21.     <hr>
  22.     <!-- Contenu principal du post -->
  23.     <div>
  24.         <p style="font-size: 20px;"><strong>{{ postDetails.username }}</strong> : {{ postDetails.content }}</p>
  25.     </div>
  26.    <!-- Réponses au post -->
  27. <div>
  28.     {% for response in postDetails.responses %}
  29.         <p><strong><a href="{{ path('app_envoyer_message', { 'username': response.username }) }}">{{ response.username }}</a></strong>: {{ response.content }}</p>
  30.     {% endfor %}
  31. </div>
  32. </div>
  33.     <!-- Formulaire de réponse -->
  34.     {% if app.user %}
  35.         <div>
  36.             <h3>Répondre au Post</h3>
  37.             <form method="post" action="{{ path('app_repondre_au_post', { 'id': postDetails.id }) }}">
  38.                 <textarea name="response" rows="4" cols="50"></textarea><br>
  39.                 <button type="submit" style="padding: 10px 10px;">Envoyer</button>
  40.             </form>
  41.         </div>
  42.     {% endif %}
  43. {% endblock %}