templates/home/home.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block body %}
  3.     <h1>Page d'accueil</h1>
  4.     {% if app.user %}
  5.         <fieldset>
  6.         {% if articles %}
  7.             <legend>NEWS : </legend>
  8.             {% for article in articles %}
  9.                 <div style="border: thin solid black">
  10.                     <h4>{{ article.nomArticle }}</h4>
  11.                     {{ article.textArticle }}
  12.                     <br><br>
  13.                     Documents :
  14.                     <br>
  15.                     {% set exist = 0 %}
  16.                     {% for file in docs %}
  17.                         {% if file.article == article %}
  18.                             {% set exist = 1 %}
  19.                             <br>
  20.                             <a href="{{path('openFileArticle',{ 'file': file.farId}) }}">
  21.                                 {{ file.farnomuser }}
  22.                             </a>
  23.                         {% endif %}
  24.                     {% endfor %}
  25.                     {% if exist == 0 %}
  26.                         Aucun document.
  27.                     {% endif %}
  28.                     <br><br>
  29.                     Date de création : {{ article.dateArticle|date("d/m/Y") }}
  30.                     <br>
  31.                     {% for role in app.user.roles() %}
  32.                         {% if role == 'ROLE_SUPER_ADMIN' %}
  33.                             <br>
  34.                             <a href="{{path('validationDeleteArticle',{ 'idArticle': article.idArticle}) }}">Supprimer l'article </a>
  35.                         {% endif %}
  36.                     {% endfor %}
  37.                 </div><br><br>
  38.             {% endfor %}
  39.         {% endif %}
  40.             {% for role in app.user.roles() %}
  41.                 {% if role == 'ROLE_SUPER_ADMIN' %}
  42.                     <form method="POST" action="{{path('Ajout_Article') }}" enctype="multipart/form-data">
  43.                         <button class="btn btn-sm btn-primary">Ajouter une nouvelle news </button>
  44.                     </form><br><br>
  45.                 {% endif %}
  46.             {% endfor %}
  47.         </fieldset>
  48.     {% endif %}
  49. {% endblock %}
  50. {% block javascripts %}
  51. {% endblock %}