{% extends "base/base.html" %}

{% block title %}
<h1>Notifications</h1>
{% endblock %}

{% block content %}
<section>
  {% if notifications %}
    <table style="width: 100%;">
      <tr>
        <th>Date</th>
        <th>Notification</th>
        <th><a href="{{ url_for('delete_notification', id='all') }}">Tout supprimer</a></th>
      </tr>
      {% for n in notifications|reverse %}
        <tr>
          <td>{{ n.date.strftime('Le %Y-%m-%d à %H:%M') }}</td>
          <td>
            {% if n.href %}<a href="{{ n.href }}">{% endif %}
            {{ n.text }}
            {% if n.href %}</a>{% endif %}
          </td>
          <td style="text-align: center;"><a href="{{ url_for('delete_notification', id=n.id)}}">Supprimer</a>
        </tr>
      {% endfor %}
    </table>
  {% else %}
    Aucune notification.
  {% endif %}
  </div>
</section>
{% endblock %}
