src/Package/Openform/Front/Templates/Proposal/index.html.twig line 1

Open in your IDE?
  1. {% extends '@openform_front_templates/base.html.twig' %}
  2. {% block bodyAttr %}news-list-body{% endblock %}
  3. {% set pageSubTitle = entity.Translation[app.request.locale].title %}
  4. {% set metaTitle = entity.Translation[app.request.locale].metaTitle ? entity.Translation[app.request.locale].metaTitle : entity.Translation[app.request.locale].title %}
  5. {% set metaDescription = entity.Translation[app.request.locale].metaDescription %}
  6. {% set metaKeywords = entity.Translation[app.request.locale].metaKeywords %}
  7. {% set pageImage = entity.imagePath ? openform_front_util.getImagePathByType(entity.Thumb,'banner') : '' %}
  8. {% block content %}
  9.     {% set mobile = openform_front_util.isMobileDevice() %}
  10.     {% if mobile %}
  11.         <h1 class="index-news__title--mobile">{{ ('T_' ~ entity.idname|upper ~ '_TITLE')|trans({}, 'openform_front', app.request.locale) }}</h1>
  12.         {% if entity.imagePath %}
  13.             <div class="index-news__image-mobile">
  14.                 <img src="{{pageImage}}" alt="{{ entity.Translation[app.request.locale].alt }}">
  15.             </div>
  16.         {% endif %}
  17.     {% endif %}
  18.     {% 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) : '' } %}
  19.     <section class="index-news">
  20.         <div class="index-news__wrapper index-news__wrapper--exh js-list-data container">
  21.             {% if mobile %}
  22.             {% else %}
  23.                 <h1 class="index-news__title--desktop">{{ ('T_' ~ entity.idname|upper ~ '_TITLE')|trans({}, 'openform_front', app.request.locale) }}</h1>
  24.             {% endif %}
  25.             {% if entities|length > 0 %}
  26.                 <div class="index-news__items js-result-content" 
  27.                     data-url="{{ toolkit_route_localizer.generate('proposal_list_filter_ajax', {}, app.request.locale) }}" >
  28.                     {% include '@openform_front_templates/Proposal/components/_list.html.twig' %}
  29.                 </div>
  30.                 {% include "@openform_front_templates/_includes/_pagination.html.twig" with { pages: maxPages } %}
  31.             {% endif %}
  32.             
  33.             {{ filters.featured is defined and entities|length == 0 ? 'T_NO_FEATURED_PROJECTS_FOUND'|trans({}, 'openform_front', app.request.locale) }}
  34.             {% if filters.featured is defined %}
  35.                 {% set listAllPage = openform_front_util.getPageByIdname('page_proposal_all', app.request.locale) %}
  36.                 {% set href = toolkit_route_localizer.generate('page',{ slug : listAllPage.Translation[app.request.locale].slug }, app.request.locale) %}
  37.                 <a href="{{href}}" class="btn btn--center-margin-top"><span>{{ 'T_SHOW_ALL'|trans({}, 'openform_front', app.request.locale) }}</span></a>
  38.             {% endif %}
  39.         </div>
  40.     </section>
  41.     {% if app.request.get('featured') %}
  42.         {% 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) : '' } %}
  43.     {% endif %}
  44. {% endblock %}
  45.