templates/page/home.html.twig line 32

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% macro agenda() %}
  3.     <div class="agenda">
  4.         <h2>
  5.             <a class="change-agenda previous" href="#" title="événements précédents"><i class="fas fa-hand-point-left fa-xs"></i></a>
  6.             Agenda
  7.             <a class="change-agenda next" href="#" title="événements suivants"><i class="fas fa-hand-point-right fa-xs"></i></a>
  8.         </h2>
  9.         <p class="mb-0 mt-0 text-center">
  10.             <a href="{{ path('suggestEvent') }}">Proposer un événement</a>
  11.         </p>
  12.         <div class="agenda-dyn-content">
  13.             {# {{ render(controller('App\\Controller\\EventController::agendaFromTo', {})) }} #}
  14.             {% set baseDateStr = "now"|date("Y-m-d_H-i-s") %}
  15.             {{ render(controller('App\\Controller\\AgendaController::agendaStepByStep', {stepNb: 10, offset: 0, baseDateStr: baseDateStr})) }}
  16.         </div>
  17.         <p class="mt-3 text-center">
  18.             {# <a class="change-agenda previous btn btn-dark btn-icig btn-sm" href="#">Jours précédents</a>
  19.             <a class="change-agenda next btn btn-dark btn-icig btn-sm" href="#">Jours suivants</a>
  20.             <br/><br/> #}
  21.             <a class="btn btn-dark btn-icig btn-sm" href="{{path("agenda")}}">Tout l'agenda</a>
  22.         </p>
  23.     </div>
  24. {% endmacro %}
  25. {% macro themes() %}
  26.     <div class="themes-search">
  27.         <h2>Thèmes</h2>
  28.         {# <p>Cliquez sur un thème :</p> #}
  29.         <div class="row row-cols-lg-2 row-cols-md-6 row-cols-sm-4 row-cols-3 themes">
  30.             {{ render(controller('App\\Controller\\ThemeController::showThemes')) }}
  31.         </div>
  32.     </div>
  33. {% endmacro %}
  34. {% macro tags() %}
  35.     <div class="recherche">
  36.         <h2>Mots-clés</h2>
  37.         {# {{ form(searchForm) }} #}
  38.         {{ render(controller('App\\Controller\\TagController::showTagForm')) }}
  39.     </div>
  40. {% endmacro %}
  41. {% import _self as selfm %}
  42. {# {% block title %}Ici grenoble : une média pratique pour Grenoble et ses environs!{% endblock %} #}
  43. {% block title %}{{ page.title|replace({ '<br>':'' }) }}{% endblock %}
  44. {% block stylesheets %}
  45.     {{ parent() }}
  46.     {{ encore_entry_link_tags('home') }}
  47. {% endblock %}
  48. {% set bodyClass = "home" %}
  49. {% block body %}
  50. {# <h1>S'informer autrement sur Grenoble et ses environs</h1> #}
  51.     <div class="row">
  52.         <div class="col-lg-3 col-12 left-column">
  53.             <h2>Bienvenue</h2>
  54.             <div class="bienvenue">
  55.                 {% if is_granted('ROLE_EDITOR') %}
  56.                     {% set url = ea_url()
  57.                         .setController('App\\Controller\\Admin\\PageCrudController')
  58.                         .setAction('edit')
  59.                         .setEntityId(page.id) %}
  60.                     <p><a class="adm-link" href="{{ url }}" target="_blank">administrer la page</a></p>
  61.                 {% endif %}
  62.                 {{ page.content|raw }}
  63.             </div>
  64.             <div class="d-none d-sm-block d-md-block d-lg-none">
  65.                 <!-- visible only on small and medium device ≥576px & <992px -->
  66.                 {# hidden smartphones : d-md-none d-lg-block, visible only smartphone : d-none d-md-block d-lg-none cf https://getbootstrap.com/docs/4.6/utilities/display/ #}
  67.                 {{ selfm.agenda() }}
  68.             </div>
  69.             {# <div class="carte">
  70.                 <h2>Cartes de Grenoble</h2>
  71.                 <a href="{{ path('carte') }}" class="text-center">
  72.                     <img src="/image/divers/carte.png" alt="carte de grenoble" class="img-fluid mb-2"><br/>
  73.                     <span>Trouver un lieu..<span>
  74.                 </a>
  75.             </div>
  76.             <div class="publications">
  77.                 <h2 class="text-center">Publications</h2>
  78.                 <ul class="text-left">
  79.                     {% for item in publications %}
  80.                         <li>
  81.                             <a href="{{path('showArticleBySlug', {slug:item.slug})}}">{{item.title}}</a>
  82.                         </li>
  83.                     {% endfor %}
  84.                 </ul>
  85.                 <p class="text-center">
  86.                     <a class="btn btn-dark btn-icig btn-sm" href="{{path('publicationsList')}}">Toutes les publications</a>
  87.                 </p>
  88.             </div> #}
  89.             <div class="d-none d-lg-block d-xl-block">
  90.                 <!-- visible only on large device ≥992px -->
  91.                 {# hidden smartphones : d-md-none d-lg-block, visible only smartphone : d-none d-md-block d-lg-none cf https://getbootstrap.com/docs/4.6/utilities/display/ #}
  92.                 {{ selfm.themes() }}
  93.             </div>
  94.             <div class="d-none d-lg-block d-xl-block">
  95.                 <!-- visible only on large device ≥992px -->
  96.                 {# hidden smartphones : d-md-none d-lg-block, visible only smartphone : d-none d-md-block d-lg-none cf https://getbootstrap.com/docs/4.6/utilities/display/ #}
  97.                 {{ selfm.tags() }}
  98.             </div>
  99.             
  100.         </div>
  101.         <div class="col-lg-6 col center-column">
  102.             <div class="alaune clearfix">
  103.                 <p class="text-center mb-2">À la une</p>
  104.                 {% set une = articlesUne|first %}
  105.                 <a class="widget-link" href="{{path('showArticleBySlug', {slug:une.slug})}}">
  106.                     <h2 class="text-center mb-3">{{ une.title|raw }}</h2>
  107.                     {% if une.medias is not empty %}
  108.                         {# <img class="thumbnail" src="/image/articles/apercu/yachts.jpg" alt="apercu article"> #}
  109.                         {# {% set media = articleUne.medias|first %}
  110.                         {{ dump(media) }}
  111.                         {% if media.file is not null %}
  112.                             <img class="thumbnail" src="{{ media.file }}" alt="{{ media.description }}">
  113.                         {% endif %} #}
  114.                         {% include 'media/postMedias.html.twig' with {'medias': une.medias, 'mediasType': 'thumbnails' } %}
  115.                     {% endif %}
  116.                     <p>
  117.                         {# {{ une.content|raw|slice(0,1000)|striptags|replace({'&agrave;':'à', '&egrave;':'è', '&eacute;':'é', '&euml;':'ë' }) }} #}
  118.                         {# {{ une.content|raw|striptags|slice(0,500) }}
  119.                         {% if une.content|raw|striptags|length > 500 %}...{% endif %} #}
  120.                         {{ une.content|raw|striptags|u.truncate(400, '...', false) }}
  121.                         
  122.                     </p>
  123.                     <p class="text-right">
  124.                         <span class="btn btn-dark btn-icig btn-sm">Lire la suite</span>
  125.                     </p>
  126.                 </a>
  127.             </div>
  128.             <div class="actualites clearfix">
  129.                 <h2 class="text-center mb-3">Actualités</h2>
  130.                 {% set articlesUne = articlesUne|slice(1) %}{# on enlève le premier article qu'on affiche avant #}
  131.                 {% include 'common/listWithImages.html.twig' with {'entityType': 'article', 'entities': articlesUne, 'type': "une" } %}
  132.                 {# -> list without images
  133.                     <ul>
  134.                     {% for item in articlesUne %}
  135.                         <li> 
  136.                             <span class="badge badge-pill badge-secondary">
  137.                                 <i class="fa fa-eye"></i>
  138.                             </span>
  139.                             <a href="{{path('showArticleBySlug', {slug:item.slug, display:"image"})}}"><i class="fa fa-eye"></i>{{item.title}}
  140.                                 {% if is_granted('ROLE_ADMIN') %}(p:{{ item.priority }}){% endif %}
  141.                             </a> 
  142.                         </li>
  143.                     </ul>
  144.                 {% endfor %} #}
  145.                 <p class="text-right">
  146.                     <a class="btn btn-dark btn-icig btn-sm" href="{{path('aLaUneList')}}">Toutes les actualités</a>
  147.                 </p>
  148.             </div>
  149.             <div class="d-none d-sm-block d-md-block d-lg-none">
  150.                 <!-- visible only on small and medium device ≥576px & <992px -->
  151.                 {# hidden smartphones : d-md-none d-lg-block, visible only smartphone : d-none d-md-block d-lg-none cf https://getbootstrap.com/docs/4.6/utilities/display/ #}
  152.                 {{ selfm.themes() }}
  153.             </div>
  154.             <div class="d-none d-sm-block d-md-block d-lg-none">
  155.                 <!-- visible only on small and medium device ≥576px & <992px -->
  156.                 {# hidden smartphones : d-md-none d-lg-block, visible only smartphone : d-none d-md-block d-lg-none cf https://getbootstrap.com/docs/4.6/utilities/display/ #}
  157.                 {{ selfm.tags() }}
  158.             </div>
  159.             <div class="articles-fond">
  160.                 <h2 class="text-center mb-3">Analyses</h2>
  161.                 {% include 'common/listWithImages.html.twig' with {'entityType': 'article', 'entities': articlesFond, 'type': "une" } %}
  162.                 {# -> list without images
  163.                     <ul>
  164.                     {% for item in articlesFond %}
  165.                         <li> 
  166.                             <span class="badge badge-pill badge-secondary">
  167.                                 <i class="fa fa-cube"></i>
  168.                             </span>
  169.                             <a href="{{path('showArticleBySlug', {slug:item.slug, display:"image"})}}"><i class="fa fa-cube"></i>{{item.title}}
  170.                                 {% if is_granted('ROLE_ADMIN') %}(p:{{ item.priority }}){% endif %}
  171.                             </a> 
  172.                         </li>
  173.                     </ul>
  174.                 {% endfor %} #}
  175.                 <p class="text-right">
  176.                     <a class="btn btn-dark btn-icig btn-sm" href="{{path('articlesFondList')}}">Toutes les analyses</a>
  177.                 </p>
  178.             </div>
  179.         </div>
  180.         <div class="col-lg-3 col-12 right-column">
  181.             {# <div class="d-md-none d-lg-block">
  182.                 <p class="text-center">
  183.                     <a class="btn btn-icig btn-md inverted" href="{{path('makeDonation')}}">Faire un don</a>
  184.                 </p>
  185.             </div> #}
  186.             <div class="d-none d-lg-block d-xl-block">
  187.                 <!-- visible only on large device ≥992px -->
  188.                 {# hidden smartphones : d-md-none d-lg-block, visible only smartphone : d-none d-md-block d-lg-none cf https://getbootstrap.com/docs/4.6/utilities/display/ #}
  189.                 {{ selfm.agenda() }}
  190.             </div>
  191.         </div>
  192.     </div>
  193. {% endblock %}
  194. {% block javascripts %}
  195.     {{ parent() }}
  196.     {{ encore_entry_script_tags('home') }}
  197. {% endblock %}