{% extends 'Front/layout.html.twig' %}

{% import 'Front/Default/macro.html.twig' as m %}

{% set metatitle = actu.metatitle ? actu.metatitle : category.title ~ ' : ' ~ actu.title %}
{% set metadescription = actu.metadescription ? actu.metadescription : null %}

{% block metaOpengraph %}
    <meta property="og:url" content="{{ app.request.getSchemeAndHttpHost() ~ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}">
    <meta property="og:type" content="article">
    <meta property="og:locale" content="{{ app.request.locale }}">
    <meta property="og:image" content="{% if actu.picture != '' %}{{ app.request.getSchemeAndHttpHost() ~ asset(actu.getWebPath())|replace({' ':'%20'}) }}{% endif %}">
    <meta property="og:title" content="{{ actu.title }}">
    <meta property="og:description" content="{{ actu.article|striptags }}">
{% endblock %}

{% set bodyClass = parent.class %}

{% block body %}
    <div class="row">
        <div class="content simplePage col">
            

            <article class="content-text">
                {{ actu.article|replace_custom_keys|raw  }}
            </article>
            
            <br/><br/>
            <p>
                <a class="link-back link-back-theme" href="{{ path('list_actu', {id:parent.id, slug:parent.slug, catid:category.id, catslug:category.slug}) }}">
                    <span class="bubble bubble-xs">
                        <i class="icon-cgenial icon-arrow-left"></i>
                    </span>
                    Revenir à la liste des articles
                </a>
            </p>
        </div>

        {% include "Front/_part/sidebar.html.twig" %}
    </div>
{% endblock %}

{% block before_body %} 
    {% set pageHeaderTitle = actu.title %}
    {% set pageHeaderTitleTag = 'h1' %}
    {% set pageHeaderTitleClass = '' %}
    {% set pageHeaderPicture = ((actu.picture is not empty) ? asset(actu.getWebPath()) : null ) -%}
    {%- set pageHeaderIntroduction -%}
    <p class="font-italic">Le {{ actu.created|date("d/m/Y") }}, dans <strong>{{ category.title }}</strong></p>
    
    {%- endset -%}
    {% include "Front/_part/page-header.html.twig" %}
    {{ render(controller('AppBundle:Render:module', { position:'before_body' })) }}
{% endblock %}

{% block after_body %} 
    {{ render(controller('AppBundle:Render:module', { position:'after_body' })) }}
{% endblock %}