{% extends '@openform_front_templates/base.html.twig' %}
{% block bodyAttr %}news-list-body{% endblock %}
{% set pageSubTitle = entity.Translation[app.request.locale].title %}
{% set metaTitle = entity.Translation[app.request.locale].metaTitle ? entity.Translation[app.request.locale].metaTitle : entity.Translation[app.request.locale].title %}
{% set metaDescription = entity.Translation[app.request.locale].metaDescription %}
{% set metaKeywords = entity.Translation[app.request.locale].metaKeywords %}
{% set pageImage = entity.imagePath ? openform_front_util.getImagePathByType(entity.Thumb,'banner') : '' %}
{% block content %}
{% set mobile = openform_front_util.isMobileDevice() %}
{% if mobile %}
<h1 class="index-news__title--mobile">{{ ('T_' ~ entity.idname|upper ~ '_TITLE')|trans({}, 'openform_front', app.request.locale) }}</h1>
{% if entity.imagePath %}
<div class="index-news__image-mobile">
<img src="{{pageImage}}" alt="{{ entity.Translation[app.request.locale].alt }}">
</div>
{% endif %}
{% endif %}
{% include "@openform_front_templates/_blocks_sections/block.html.twig" with { sections: openform_front_util.getSections(entity)|length > 0 ? openform_front_util.getSections(entity)|slice(0, 1) : '' } %}
<section class="index-news">
<div class="index-news__wrapper index-news__wrapper--exh js-list-data container">
{% if mobile %}
{% else %}
<h1 class="index-news__title--desktop">{{ ('T_' ~ entity.idname|upper ~ '_TITLE')|trans({}, 'openform_front', app.request.locale) }}</h1>
{% endif %}
{% if entities|length > 0 %}
<div class="index-news__items js-result-content"
data-url="{{ toolkit_route_localizer.generate('proposal_list_filter_ajax', {}, app.request.locale) }}" >
{% include '@openform_front_templates/Proposal/components/_list.html.twig' %}
</div>
{% include "@openform_front_templates/_includes/_pagination.html.twig" with { pages: maxPages } %}
{% endif %}
{{ filters.featured is defined and entities|length == 0 ? 'T_NO_FEATURED_PROJECTS_FOUND'|trans({}, 'openform_front', app.request.locale) }}
{% if filters.featured is defined %}
{% set listAllPage = openform_front_util.getPageByIdname('page_proposal_all', app.request.locale) %}
{% set href = toolkit_route_localizer.generate('page',{ slug : listAllPage.Translation[app.request.locale].slug }, app.request.locale) %}
<a href="{{href}}" class="btn btn--center-margin-top"><span>{{ 'T_SHOW_ALL'|trans({}, 'openform_front', app.request.locale) }}</span></a>
{% endif %}
</div>
</section>
{% if app.request.get('featured') %}
{% include "@openform_front_templates/_blocks_sections/block.html.twig" with { sections: openform_front_util.getSections(entity)|length > 0 ? openform_front_util.getSections(entity)|slice(1, openform_front_util.getSections(entity)|length) : '' } %}
{% endif %}
{% endblock %}