templates/home/index.html.twig line 1

  1. {% extends 'base.html.twig' %}
  2. {% block title %}Gestion des rappel{% endblock %}
  3. {% block body %}
  4.     <style>
  5.         .reminder {
  6.             margin: 0 20px 0 0;
  7.             width: 40px;
  8.             float: left;
  9.             position: relative;
  10.             top: 8px;
  11.         }
  12.         .robot {
  13.             margin: 0 20px 0 0;
  14.             width: 50px;
  15.             float: left;
  16.             position: relative;
  17.             top: -10px;
  18.         }
  19.         .reminders button {
  20.             background-color: #fa2a25;
  21.             border-color: #fb1914;
  22.             font-size: 14px;
  23.             position: relative;
  24.             top: 15px;
  25.         }
  26.     </style>
  27.     <section>
  28.     <img src="/img/reminder.png" class="reminder">
  29.     <h1>Créer un nouveau rappel :</h1>
  30.     {{ form_start(form) }}
  31.     {{ form_row(form.url) }}
  32.     {{ form_row(form.created) }}
  33.     {{ form_row(form.reminder) }}
  34.     {{ form_row(form.submit, {
  35.         label_html: true,
  36.         label: 'Enregistrer',
  37.     }) }}
  38.     {{ form_end(form) }}
  39.     </section>
  40.     <br>
  41.     <section>
  42.     {# Affiche la liste des Updates #}
  43.     
  44.     <img src="/img/robot.png" class="robot">
  45.     <h1>Rappels en attente :</h1>
  46.     {{ form_start(formDelete) }}
  47.     <table class="reminders">
  48.         <thead>
  49.             <tr>
  50.                 <th>Url</th>
  51.                 <th>Crée le</th>
  52.                 <th>Rappel le</th>
  53.             </tr>
  54.         </thead>
  55.         <tbody>
  56.         {% for update in updates %}
  57.             <tr>
  58.                 <td>{{ update.url }}</td>
  59.                 <td>{{ update.created|date('d/m/Y') }}</td>
  60.                 <td>{{ update.reminder|date('d/m/Y') }}</td>
  61.                 <td>
  62.                 {# Obligé de faire comme ça Symfony ne veux pas render plusieurs fois les elem d'un form #}
  63.                     <button type="submit" formaction="{{ path('app_home', {'id': update.id}) }}">Supprimer</button>
  64.                 </td>
  65.             </tr>
  66.         {% endfor %}
  67.         </tbody>
  68.     </table>
  69.     {{ form_end(formDelete) }}
  70.     </section>
  71. {% endblock %}