{% extends 'base.html.twig' %}
{% block title %}{{ setting.siteName }} : Blog{% endblock %}
{% block body %}
{# <h1>BlogArticle index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Title</th>
<th>Content</th>
<th>Image</th>
<th>Video</th>
<th>CreatedAt</th>
<th>UpdatedAt</th>
<th>IsEnabled</th>
<th>Slug</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for blog_article in blog_articles %}
<tr>
<td>{{ blog_article.id }}</td>
<td>{{ blog_article.title }}</td>
<td>{{ blog_article.content }}</td>
<td>{{ blog_article.image }}</td>
<td>{{ blog_article.video }}</td>
<td>{{ blog_article.createdAt ? blog_article.createdAt|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ blog_article.updatedAt ? blog_article.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ blog_article.isEnabled ? 'Yes' : 'No' }}</td>
<td>{{ blog_article.slug }}</td>
<td>
<a href="{{ path('app_blog_article_show', {'id': blog_article.id}) }}">show</a>
<a href="{{ path('app_blog_article_edit', {'id': blog_article.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="10">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_blog_article_new') }}">Create new</a> #}
<section class="container py-5">
<div class="row">
<div class="col">
{# Breadcrumbs #}
<div class="row">
<div class="col small">
<nav style="--bs-breadcrumb-divider: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M2.5 0L1 1.5 3.5 4 1 6.5 2.5 8l4-4-4-4z' fill='%236c757d'/%3E%3C/svg%3E");"
aria-label="breadcrumb">
<ol class="breadcrumb small">
<li class="breadcrumb-item"><a href="{{ path('app_home') }}" class="text-decoration-none text-dark">Accueil</a></li>
<li class="breadcrumb-item active" aria-current="page">Blog</li>
</ol>
</nav>
</div>
</div>
</div>
</div>
{% for message in app.flashes('success') %}
<div class="alert alert-success alert-dismissible fade show text-center mt-4 mb-5" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% for message in app.flashes('email_not_exists') %}
<div class="alert alert-danger alert-dismissible fade show text-center mt-4 mb-5" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% for message in app.flashes('unsubscribe') %}
<div class="alert alert-success alert-dismissible fade show text-center mt-4 mb-5" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
<h1 class="text-center mb-2 color1 fw-700 text-uppercase" data-aos="fade-down" data-aos-duration="2000">Blog</h1>
<div class="row row-cols-1 row-cols-md-3 g-4 mt-3">
{% for article in articles %}
<div class="col blog-cards">
<div class="card h-100">
<img src="{{ asset('assets/img/articles/' ~ article.image ) }}" class="card-img-top img-fluid shadow" data-aos="flip-right" data-aos-duration="2000" alt="{{ article.title }}">
<div class="card-body">
<h5 class="card-title">
<a href="{{ path('app_blog_article_show', {'slug': article.slug}) }}" class="text-decoration-none color1 text-uppercase fw-bold">
{{ article.title }}
</a>
</h5>
<p class="text-xsmall color1">
Publié le {{ article.createdAt|date('d-m-Y') }}
{% if article.updatedAt != null %}
| Mis à jour le {{ article.updatedAt|date('d-m-Y') }}
{% endif %}
<br>Catégorie :
<a href="{{ path('app_blog_category_show', {'slug': article.category.slug}) }}" class="text-decoration-none color2">
{{ article.category.title }}
</a>
</p>
<p class="card-text">{{ article.content|replace({'<div>': '', '</div>': '', '<p>': '', '</p>': '',})|slice(0,200)|raw }}...</p>
</div>
<div class="card-footer">
<a href="{{ path('app_blog_article_show', {'slug': article.slug}) }}" class="text-decoration-none">
<span class="button-difference text-uppercase">Lire la suite</span>
</a>
</div>
</div>
</div>
{% endfor %}
</div>
<div class="row mt-5">
<div class="col navigation d-flex justify-content-center">
{{ knp_pagination_render(articles) }}
</div>
</div>
</section>
{% endblock %}