{% extends "app_sirene/anonymous_base.html" %}
{% load static %}
{% load i18n %}


{% block content %}

<h3><i class="fa fa-newspaper-o fa-2x"></i> &nbsp; {% translate 'Messages' %}</h3>
<hr>
<br>

{% if  messages %}
 <table class="table table-striped table-hover">

{% for message in messages %} <tr>

<td class="py-1 px-1 mx-0">
<a class="text-decoration-none" href="{% url 'app_sirene:anonymous_detail' message.id %}">
<i class="fa fa-plus"></i> &nbsp; 
{{ message.displayname }}
</a>
</td>

<td class="py-1 text-center h6">
    <a class="text-decoration-none" href="{% url 'app_sirene:anonymous_detail' message.id %}">
    {{ message.severity.0.widget|safe }}
    </a>
</td>

    
<td class="py-1 text-center h6">
<a class="text-decoration-none" href="{% url 'app_sirene:anonymous_detail' message.id %}">
{{ message.severity.0.value }}
</a>
</td>

<td class="py-1 px-1 mx-0 text-center">
<a class="text-decoration-none" href="{% url 'app_sirene:anonymous_detail' message.id %}">
{{ message.category.0.value }}
</a>
</td>


<td class="py-1 px-1 mx-0">
<a class="text-decoration-none" href="{% url 'app_sirene:anonymous_detail' message.id %}">
<i>
{{ message.created_at }} 
</i>
</a>
</td>

<td class="py-1 px-1 mx-0">
{% if  message.updated_at %}
<a class="text-decoration-none" href="{% url 'app_sirene:anonymous_detail' message.id %}">
<span class="badge badge-pill badge-dark">+ {{ page.updates.count }} messages</span>
<span class="badge badge-light">{{ message.updated_at }} </span>
</a>
{% endif %}
</td>

</tr>{% endfor %}

</table>{% else %}
<p>{% translate 'No message' %}</p>
{% endif %}

{% endblock %}

