{% extends 'base.html.twig' %}
{% block title %}CEP-I Actualité{% endblock %}
{% block stylesheets %}
<link rel="shortcut icon" type="image/x-icon" href="/assets/images/favicon.ico">
<link rel="stylesheet" type="text/css" href="/assets/vendor/magnific-popup.css">
<link rel="stylesheet" type="text/css" href="/assets/vendor/slick-master/slick/slick.css">
<link rel="stylesheet" type="text/css" href="/assets/vendor/selectric/public/selectric.css">
<link rel="stylesheet" type="text/css" href="/assets/css/bundle.css">
<link rel="stylesheet" type="text/css" href="/assets/font-awesome/css/fontawesome-all.css">
<style>
.block_file img {
display: block;
margin: auto;
max-width: 100% !important;
}
</style>
<script src="/assets/vendor/jquery-3.1.1.min.js"></script>
{% endblock %}
{% block breadcrumps %}
<div class="breadcrumps">
<div class="shell">
<ul>
<li>
<a href="{{ path('accueil') }}">Accueil</a>
</li>
<li>
<a href="{{ path('actualites') }}">Actualités</a>
</li>
<li>
<a href="{{ path('actualite_view', {'title' : actualite.link}) }}">{{ actualite.title }}</a>
</li>
</ul>
</div><!-- /.shell -->
</div><!-- /.breadcrumps -->
{% endblock %}
{% block body %}
<section class="section-secondary section-secondary--def">
<div class="shell shell--alt">
<div class="section__body">
<a href="{{ path('actualites') }}" class="link link-back">
<span class="ico-container">
<i class="ico-arrow-back"></i>
<i class="ico-arrow-back-green"></i>
</span>
Retour Aux Actualités
</a>
<header class="section__head">
<h5>
{% set categories = actualite.category|split(',') %}
{% for cat in categories %}
{{ util_service.articleCategorieVersLabel(cat) }}
{% endfor %}
</h5>
<h2>
{{ actualite.title ?? '' }}
</h2>
<h6>Le {{ actualite.publishDate|date('d/m/Y') }}</h6>
<div>
{{ actualite.description ? actualite.description|nl2br : '' }}
</div>
</header><!-- /.section__head -->
<div class="intro intro--small-alt">
{% if actualite.id is defined and actualite.image is defined and actualite.image is not null %}
<div class="intro__bg" style="background-image: url(
{{ '/assets/uploads/actualite/' ~ actualite.id ~ '/' ~ actualite.image }}
);"></div>
{% endif %}
</div><!-- /.intro-small -->
{% for paragraphe in paragraphes %}
{% set mediaPosition = paragraphe.mediaPosition == 'Droite' ? 'float: right;' : 'float: left;' %}
<div class="section__content" id="{{ loop.index }}">
<h3>{{ paragraphe.title ?? null }}</h3>
{% if paragraphe.image is defined and paragraphe.image is not null and paragraphe.image is not empty %}
<figure class="figure-image" style="{{ mediaPosition }}">
<img style="height: auto; max-height: 320px;"
src="{{ '/assets/uploads/paragraphe/' ~ paragraphe.id ~ '/' ~ paragraphe.image }}" alt
>
</figure>
<p>{{ paragraphe.content ? util_service.bbcodeToHtml(paragraphe.content|escape)|raw|nl2br : null }}</p>
<div style="clear: both;"></div>
{% elseif paragraphe.video is defined and paragraphe.video is not null and paragraphe.video is not empty %}
<figure class="figure-video" style="{{ mediaPosition }}">
<div class="video">
<iframe src="{{ paragraphe.video|replace({'youtube.com/watch?v=' : 'youtube.com/embed/'}) }}"
frameborder="0" allowfullscreen
></iframe>
</div>
</figure>
<p>{{ paragraphe.content ? util_service.bbcodeToHtml(paragraphe.content|escape)|raw|nl2br : null }}</p>
<div style="clear: both;"></div>
{% else %}
<p>{{ paragraphe.content ? util_service.bbcodeToHtml(paragraphe.content|escape)|raw|nl2br : null }}</p>
{% endif %}
{% if actualite.files %}
{% set fic = actualite.files|split('/') %}
{% set filePath = "/assets/uploads/actualite/" ~ actualite.id ~ "/" ~ actualite.files %}
<div class="block_file" style="width: 250px;text-align: center; font-size: 45px">
{{ previewFile(fic[fic|length - 1],filePath)|raw }}
</div>
{% endif %}
</div>
{% endfor %}
</div><!-- /.section__body -->
</div><!-- /.shell -->
</section><!-- /.section -->
<section class="section section--features section--features-def">
<div class="section__bg" style="background-image: url(/assets/images/temp/bg-1.jpg);"></div><!-- /.section__bg -->
<div class="shell">
<header class="section__head">
<h2 class="title">Les Autres Actualités</h2>
</header><!-- /.section__head -->
<div class="section__body">
<div class="features">
{% for autre in autres %}
<div class="feature feature--primary">
<a href="{{ path('actualite_view', {'title' : autre.link}) }}">
{% if autre.image is defined and autre.image is not null %}
<div class="feature__image" style="background-image: url(
{{ '/assets/uploads/actualite/' ~ autre.id ~ '/' ~ autre.image }}
);"></div>
{% else %}
<div class="feature__image" style="background-color: #A0C32E;"></div>
{% endif %}
<div class="feature__body">
<h5>
{% set categories = autre.category|split(',') %}
{% for cat in categories %}
{{ util_service.articleCategorieVersLabel(cat) }}
{% endfor %}
</h5>
<p>
{{ autre.title }}
</p>
</div><!-- /.feature__body -->
</a>
</div><!-- /.feature -->
{% endfor %}
</div><!-- /.features -->
</div><!-- /.section__body -->
</div><!-- /.shell -->
</section><!-- /.section -->
{% include '__includes__/newsletterForm.html.twig' %}
<script>
let styleDynamicImage = function() {
let imageFigures = document.getElementsByClassName('figure-image');
for (let figure of imageFigures) {
let img = figure.getElementsByTagName('img')[0];
if (img.naturalHeight > img.naturalWidth) {
figure.style.maxWidth = 'none';
img.style.maxHeight = '320px';
}
}
};
// window.onload = styleDynamicImage;
</script>
{% endblock %}
{% block javascripts %}
<script src="/assets/vendor/magnific-popup.js"></script>
<script src="/assets/vendor/slick-master/slick/slick.min.js"></script>
<script src="/assets/vendor/selectric/public/jquery.selectric.min.js"></script>
<script src="/assets/vendor/jquery-scrollLock.min.js"></script>
<script src="/assets/vendor/validator.js"></script>
<script src="/assets/js/bundle.js"></script>
{% endblock %}