{% extends 'layout.html.twig' %}
{% block layout %}
<div class="row" style="display: block; max-width: 100%;">
<h3 class="news_title" style="text-align: center">
<strong>
{{ news.title }}
</strong>
</h3>
<div class="row" style="display: block;text-align: center;">
<i style="color:gray;">{{ news.createdAt|date('d/m/Y') }}</i>
<br/>
{% if news.listekeywords|length > 0 %}
{% for data in news.listekeywords %}
<a href="{{ path('keyword', {keyword: data.id}) }}">
<span class="badge badge-primary">
{{ data.keyword }}
</span>
</a>
{% endfor %}
{% endif %}
<br/>
{% if is_granted('ROLE_ADMIN') %}
<a href="{{ea_url()
.setController('App\\Controller\\Admin\\NewsCrudController')
.setAction('edit')
.setEntityId(news.id)}}">
<button type="button" class="btn btn-info">Modifier l'article</button>
</a>
{% endif %}
</div>
</div>
<div class="row">
<div class="col-lg-8 col-12">
{% if news.pdf is not null and news.pdf != '' %}
<br/>
<a href="{{ '/news-pdf/'~ news.pdf }}" target="_blank">
<button type="button" class="btn btn-primary" style="margin-left:10px">Voir le document joint</button>
</a>
{% endif %}
<div class="texte-principal">
{{ news.content|raw }}
</div>
<br>
</div>
{% if news.listelexique|length > 0 %}
<div class="col-lg-4 col-12">
<div style="padding:20px; margin:10px;border: 1px solid gray;border-radius:3px">
{% for data in news.listelexique %}
{% if data.active == true %}
<b>{{ data.word }} :</b> {{ data.definition|raw }}
<br/>
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
</div>
{% endblock %}