{% extends 'base.html.twig' %}

{% block title %}{{title}}{% endblock %}

{% block body %}

{{ include("dashboard/menu.html.twig") }}
{% if articles %}

{% for article in articles %}

<article class="article-card" data-category="arrete-peril">
    <div class="article-header">
        🏚️
        <div class="article-category">{{ article.categorie.nom }}</div>
    </div>
    <div class="article-content">
        <div class="article-meta">
        </div>
        <h2 class="article-title">
            <a href="javascript:void(0)" onclick="showArticle('arrete-peril')">{{article.titre}}</a>
        </h2>
        <p class="article-excerpt">
            <span>📅 {{  article.datePublication | date('d/m/Y')  }} </span>
            {# span>⏱️ 8 min de lecture</span>  #}
        </p>
        <div class="article-tags">
            {% if article.tag.snapshot %}
            {% for a in article.tag.snapshot %}
            <a href="#" class="tag">{{ a.nom }}</a>
            {% endfor %}
            {% endif %}
        </div>
        <a href={{ path("app_article_show", {'id' : article.id}) }} class="read-more"
            onclick="showArticle('arrete-peril')">Lire l'article complet</a>
    </div>
</article>

{% endfor %}

{% endif %}



<a href="{{ path('app_article_new') }}">Create new</a>
{% endblock %}