{% extends 'base.html.twig' %}
{% block title %} Blog | {{ parent() }} {% endblock %}
{% block body %}
<section class="grey-blue-bg small-padding">
<div class="container">
<div class="row">
<div class="col-md-8">
<div class="post-container fl-wrap">
{% if articles.totalItemCount > 0 %}
{% for article in articles %}
<article class="post-article">
<div class="title-devis">
<span>{{ article.title }}</span>
</div>
<div class="list-single-main-media fl-wrap">
<div class="single-slider-wrapper fl-wrap">
<div class="single-slider fl-wrap">
<div class="slick-slide-item">
{% if article.image %}
<img src="{{ asset('/uploads/files/articles/' ~ article.image) | imagine_filter('806x250') }}" alt="{{ article.title }}">
{% else %}
<img src="{{ asset('front/images/all/ryvup.jpeg') | imagine_filter('806x250') }}" alt="{{ article.title }}">
{% endif %}
</div>
</div>
</div>
</div>
<div class="list-single-main-item fl-wrap">
<div class="control-description">
{% if article.content | length > 410 %}
{{ article.content|slice(0,410)|raw }}...
{% else %}
{{ article.content|slice(0,410)|raw }}
{% endif %}
</div>
<div class="post-opt">
<ul>
<li><i class="fal fa-tags"></i> <a href="{{ url('app_front_blog_by_category', {'slug': article.category.slug}) }}" class="text-theme-blue">{{ article.category.name }}</a></li>
<li><i class="fal fa-calendar"></i> <span>{{ article.createdAt | format_datetime(locale='fr', pattern="dd MMMM YYYY") }}</span></li>
<li><i class="fal fa-share-alt"></i> <span>RYVUP</span></li>
</ul>
</div>
{% if article.content | length > 410 %}
<span class="fw-separator"></span>
<a href="{{ url('app_front_blog_read', {'cat_slug': article.category.slug, 'slug': article.slug}) }}" class="btn float-btn color-bg">Lire la suite<i class="fal fa-angle-right"></i></a>
{% endif %}
</div>
</article>
{% endfor %}
{% endif %}
{{ knp_pagination_render(articles) }}
</div>
</div>
<div class="col-md-4">
<div class="box-widget-wrap fl-wrap fixed-bar">
<div class="box-widget-item fl-wrap">
<div class="box-widget">
<div class="box-widget-content">
<div class="box-widget-item-header mb-3">
<h3> Demander un devis </h3>
</div>
<div class="text-left">
<p>Location d'autocar, minibus, voiture privée et sanitaire avec chauffeur pour tous vos déplacements</p>
<p>Avec Ryvup, trouver votre transport sur mesure !</p>
</div>
<div class="text-left">
<a href="{{ url('app_client_home') }}" class="btn color2-bg mt-3">
Devis immédiat
<i class="fal fa-angle-right"></i>
</a>
</div>
</div>
</div>
</div>
<div class="box-widget-item fl-wrap">
<div class="box-widget widget-posts">
<div class="box-widget-content">
<div class="box-widget-item-header">
<h3>Les articles récents</h3>
</div>
{% for article in lastArticles %}
<div class="box-image-widget">
<div class="box-image-widget-media">
{% if article.image %}
<img src="{{ asset('/uploads/files/articles/' ~ article.image) | imagine_filter('115x76') }}" alt="{{ article.title }}">
{% else %}
<img src="{{ asset('front/images/all/ryvup.jpeg') | imagine_filter('115x76') }}" alt="{{ article.title }}">
{% endif %}
<a href="{{ url('app_front_blog_read', {'cat_slug': article.category.slug, 'slug': article.slug}) }}" class="color-bg">Détails</a>
</div>
<div class="box-image-widget-details">
<h4>{{ article.title }}</h4>
<span class="widget-posts-date">
<i class="fal fa-calendar"></i>
{% if article.updatedAt %}
Modifié le {{ article.updatedAt | format_datetime(locale='fr', pattern="dd MMMM YYYY") }}
{% else %}
Publié le {{ article.createdAt | format_datetime(locale='fr', pattern="dd MMMM YYYY") }}
{% endif %}
</span>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<div class="box-widget-item fl-wrap">
<div class="box-widget">
<div class="box-widget-content">
<div class="box-widget-item-header">
<h3>Catégories</h3>
</div>
<ul class="cat-item">
{% for category in categories %}
<li><a href="{{ url('app_front_blog_by_category', {'slug': category.slug}) }}" title="{% if category.name | length > 28 %}{{ category.name }}{% endif %}">{% if category.name | length > 28 %}{{ category.name | slice(0,28) }}...{% else %}{{ category.name }}{% endif %}</a> <span>{{ category.articles | length }}</span></li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="limit-box fl-wrap"></div>
</section>
{% endblock %}