{% extends 'base.html.twig' %}
{% block title %}- {{ article.title }}{% endblock %}
{% block content %}
<section class="page_title ds s-overlay s-pt-150 s-pb-50"
style="background-image: url({{ asset('assets/images/cbrc/imagefond.jpg') }})">
<div class="s-blur"></div>
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<h1><i class="far fa-file-alt mr-3"></i>{{ article.title }}</h1>
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="{{ path('home', {}, relative = false) }}">
Accueil
</a>
</li>
{% if article.category !=null %}
<li class="breadcrumb-item">
<a href="{{ path('home_by_category',{'categoryname':article.category.name }, relative=false) }}">
{{ article.category.name }}
</a>
</li>
{% endif %}
<li class="breadcrumb-item active">
{{ article.title }}
</li>
</ol>
<p class="text-center mt-2">
{{ article.content.shortresume|nl2br }}
</p>
</div>
</div>
</div>
</section>
<section class="ls s-py-xl-150 s-py-lg-130 s-py-md-90 s-py-60">
<div class="container">
<div class="row c-gutter-60">
<main class="col-12 readarticle">
<div class="card box-shadow rounded-0 pt-0 mb-4">
{% if article.content.image1 !=null %}
<img src="{{ vich_uploader_asset(article.content, 'image1File') }}" alt="image"
class="card-img p-0">
{% endif %}
{% if article.category!=null %}
<div class="labelcategory mb-2">
<span class="cat-links">
<a href="{{ path('home_by_category',{'categoryname':article.category.name }, relative=false) }}"
rel="category tag"
style="background-color: {{ article.category.bgcolor }}; color: {{ article.category.textcolor }}"> <!-- Lien vers la catégorie -->
{{ article.category.name }}
</a>
</span>
</div>
{% endif %}
<div class="card-body">
<div class="row">
<div class="col-12">
<div class="entry-content pt-4">
{% if article.content.document1 != null %}
<p>
<a href="{{ vich_uploader_asset(article.content, 'document1File') }}"
target="_blank">
<i class="fas fa-paperclip mr-2"></i>
{% if article.content.documentname !=null %}
{{ article.content.documentname }}
{% else %}
Pièce jointe
{% endif %}
</a>
</p>
{% endif %}
<p class="">
{{ article.content.text|raw }}
</p>
</div>
</div>
</div>
<div class="row align-items-center">
<div class="col-12 align-middle">
<span class="byline">
<span class="author vcard">
<i class="far fa-user"></i>
<span class="url fn n"
>{{ article.content.signature }}</span>
</span>
</span>
| {{ article.creationdate|date("d/m/y") }}
</div>
</div>
</div>
</div>
<div id="comments" class="comments-area">
<h5 class="comment-reply-title">Commentaires</h5>
<ol class="comment-list">
{% for comment in comments %}
<li class="comment">
<article class="comment-body">
<header class="comment-meta">
<div class="comment-author vcard">
<h6 class="fn">
{{ comment.user.displayname }}
</h6>
</div>
</header>
<div class="comment-content">
<p>
{{ comment.text|nl2br }}
</p>
</div>
<footer class="comment-footer">
{% if is_granted('edit', comment) %}
<span class="edit-link">
<i class="far fa-trash-alt"></i>
<a class="comment-edit-link" href="{{ path('delete_comment', {'commentid':comment.id}, relative = false) }}">Supprimer</a>
</span>
{% endif %}
<span class="comment-metadata">
<i class="far fa-clock"></i>
<time>
{{ comment.displaydate|date('d/m/Y') }}
</time>
</span>
</footer>
</article>
</li>
{% endfor %}
</ol>
<div id="respond" class="comment-respond ls">
<h5 class="comment-reply-title">Commenter</h5>
<div class="card box-shadow rounded-0 pt-0 mb-4">
<div class="card-body">
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
{{ form(formcomment) }}
{% else %}
Pour pouvoir laisser un commentaire <a class="" href="{{ path('app_login', {}, relative = false) }}"
style="text-decoration: underline">connectez-vous</a> ou <a class="" href="{{ path('signup', {}, relative = false) }}"
style="text-decoration: underline">créez un compte</a>.
{% endif %}
</div>
</div>
</div>
<!-- #respond -->
</div>
</main>
</div>
</div>
</section>
{% endblock %}