{% extends '@kohinos/common/layout.html.twig' %}

{% block content %}
<div class='container newslist mt-2'>
	{% include '@kohinos/block/breadcrumb.html.twig' with {'label': news.title, 'label2': 'Actualités', 'url2': path('news') } %}
  	<div class="card mb-2">
		<div class="card-header" style='cursor:pointer;'><h1>{{news.title}}</h1></div>
		<div class="card-body">
			<div class="card-text">
				{% if news.media %}
					{% set pathMedia = mediaurl(news.media, 'reference') %}
					{% if pathMedia ends with '.jpg' or pathMedia ends with '.jpeg' or pathMedia ends with '.png' or pathMedia ends with '.bmp' or pathMedia ends with '.gif' %}
						{% thumbnail news.media, 'big'  with {'class': 'rounded mx-auto d-block'} %}<br/>
					{% else %}
						<a href="{% path news.media, 'reference' %}">{{'Télécharger'|trans}}</a>
					{% endif %}

				{% endif %}
				{{news.content|raw}}
			</div>
		</div>
		<div class="card-footer text-muted">
	      {{ 'Crée le'|trans }} {{news.createdAt|date('d/m/Y')}}
	    </div>
	</div>
</div>
{% endblock %}
