templates/Nordinfo/Main/gabarit_list.html.twig line 1

Open in your IDE?
  1. {% extends 'Nordinfo/Main/base.html.twig' %}
  2. {% block title %}{{ title }} - Nord Info
  3. {% endblock %}
  4. {% block body_class %}
  5.   {% if is_favorites_page is defined and is_favorites_page == 1 %}body-favorites
  6.   {% endif %}
  7. {% endblock %}
  8. {% set show_btt = true %}
  9. {% block body %}
  10.   <main data-aria-hidden-by-modal tabindex="-1" id="mainContent" class="pBXL">
  11.     <h1 class="sr-only">{{ title }}</h1>
  12.     {% if tagbar == true %}
  13.       {{ include('Nordinfo/Main/parts/tags.html.twig') }}
  14.     {% endif %}
  15.     {% if cookie_search is defined and cookie_search == true %}
  16.       {% if false %}
  17.         {{ include('Nordinfo/Main/parts/add_tags_bar.html.twig', {'is_info' : true}) }}
  18.         <div class="addTagsBar">
  19.           <ul>
  20.             <li>
  21.               <a href="{{ path('vos_lieux') }}"
  22.                  aria-label="lieu(x) de vie :{% if cookie_territories is null %}Tous{% else %}{% for c in cookie_territories %}{{ c }}{% if loop.last == false %},{% endif %}{% endfor %}{% endif %} - Ajouter ou supprimer des lieux de vie">
  23.                 <div class="container">
  24.                   <div class="row">
  25.                     <div class="col">
  26.                       <div class="__inner">
  27.                         <p class="__text">
  28.                           <span class="text-secondary">Lieu(x) de vie :</span>
  29.                           {% if cookie_territories is null %}
  30.                             Tous
  31.                           {% else %}
  32.                             {% for c in cookie_territories %}
  33.                               {{ c }}{% if loop.last == false %}, {% endif %}
  34.                             {% endfor %}
  35.                           {% endif %}
  36.                         </p>
  37.                         <div class="__icon">
  38.                           <svg aria-hidden="true" focusable="false" data-name="Calque 1"
  39.                                xmlns="http://www.w3.org/2000/svg" viewbox="0 0 121.6 121.6">
  40.                             <g id="add">
  41.                               <path id="add-2" class="" d="M55.6,0V55.6H0V66H55.6v55.6H66V66h55.6V55.6H66V0Z"/>
  42.                             </g>
  43.                           </svg>
  44.                         </div>
  45.                       </div>
  46.                     </div>
  47.                   </div>
  48.                 </div>
  49.               </a>
  50.             </li>
  51.           </ul>
  52.         </div>
  53.       {% endif %}
  54.       <hr class="hrBrown mb-0 mt-0">
  55.     {% endif %}
  56.     {% if show_agenda_filters is defined %}
  57.       {% if show_agenda_filters == 1 %}
  58.         <div class="filtersBar">
  59.           <div class="container">
  60.             <ul>
  61.               <li {% if app.request.query.get('date') == 'today' %}class="active"{% endif %}>
  62.                 <a href="{{ path('agenda') }}{% if app.request.query.get('date') != 'today' %}?date=today{% endif %}"
  63.                    {% if app.request.query.get('date') == 'today' %}aria-current="true"{% endif %}>
  64.                   <span>Aujourd'hui</span>
  65.                 </a>
  66.               </li>
  67.               <li {% if app.request.query.get('date') == 'weekend' %}class="active"{% endif %}>
  68.                 <a
  69.                   href="{{ path('agenda') }}{% if app.request.query.get('date') != 'weekend' %}?date=weekend{% endif %}"
  70.                   {% if app.request.query.get('date') == 'weekend' %}aria-current="true"{% endif %}>
  71.                   <span>Ce Week-end</span>
  72.                 </a>
  73.               </li>
  74.               <li
  75.                 {% if app.request.query.get('date') != 'weekend' and app.request.query.get('date') != 'today' and app.request.query.get('date') != null %}class="active"{% endif %}>
  76.                 <button data-toggle="modal" data-target="#modalAgendaDateFilter"
  77.                         {% if app.request.query.get('date') != 'weekend' and app.request.query.get('date') != 'today' and app.request.query.get('date') != null %}aria-current="true"{% endif %}>
  78.                   <span>À partir du</span>
  79.                 </button>
  80.               </li>
  81.             </ul>
  82.           </div>
  83.         </div>
  84.       {% endif %}
  85.     {% endif %}
  86.     {% if show_date_bar is defined and show_date_bar == 1 %}
  87.       {% include 'Nordinfo/Main/parts/date_bar.html.twig' %}
  88.     {% endif %}
  89.     {% if is_favorites_page is defined and is_favorites_page == 1 %}
  90.       {{ include('Nordinfo/Main/parts/breadcrumb.html.twig') }}
  91.       {% if referer is not null %}
  92.         {% set url_back = referer %}
  93.       {% else %}
  94.         {% set url_back = path('info') %}
  95.       {% endif %}
  96.       {% include 'Nordinfo/Main/parts/back_btn.html.twig' with {'back_btn_class':'_list-page'} %}
  97.       <div class="container pb-4 pt-5">
  98.         <div class="containerPageHeader">
  99.           <h1>Mes favoris</h1>
  100.         </div>
  101.       </div>
  102.     {% endif %}
  103.     <div class="container _masonry pt-5">
  104.       {% if posts is empty and title == 'Favoris' %}
  105.         <div class="text-center">
  106.           Vous n’avez pas encore de favoris.
  107.         </div>
  108.       {% endif %}
  109.       {% if posts is empty and title == 'Agenda' %}
  110.         <div class="text-center">
  111.           Il n'y a aucun évènement correspondant à vos
  112.           <a href="{{ path('vos_lieux') }}">Lieux de vie</a>
  113.         </div>
  114.       {% endif %}
  115.       {% if posts is not empty %}
  116.         {% if list_type|default and list_type == 'podcasts' %}
  117.           {% for post in posts %}
  118.             {{ include('Nordinfo/Main/parts/item_list.html.twig') }}
  119.           {% endfor %}
  120.         {% else %}
  121.           <div class="gridMasonry" id="gridMasonry">
  122.             <div class="grid-sizer"></div>
  123.             {% for post in posts %}
  124.               {{ include('Nordinfo/Main/parts/item_list.html.twig') }}
  125.             {% endfor %}
  126.           </div>
  127.         {% endif %}
  128.       {% endif %}
  129.       {% if items_total > initial_limit %}
  130.         {% include 'Nordinfo/Main/parts/loader_ajax.html.twig' %}
  131.       {% endif %}
  132.     </div>
  133.     <div class="modal fade modalCustom" id="modalAgendaDateFilter" tabindex="-1" role="dialog"
  134.          aria-labelledby="modalAgendaDateFilterLabel" aria-hidden="true">
  135.       <div class="modal-dialog" role="document">
  136.         <button type="button" class="close" data-dismiss="modal">
  137.           <span aria-hidden="true">&times;</span>
  138.           <span class="sr-only">Fermer á partir du</span>
  139.         </button>
  140.         <div class="modal-content">
  141.           <div class="modal-header">
  142.             <h1 class="modal-title" id="modalAgendaDateFilterLabel">À partir du</h1>
  143.           </div>
  144.           <div class="modal-body">
  145.             <form action="#" id="formAgendaDateFilter">
  146.               <div class="form-group">
  147.                 <input type="hidden" id="example1" value="">
  148.               </div>
  149.               <div class="text-right">
  150.                 <button type="submit" class="btn btnSubmit">
  151.                   <span class="__text">Rechercher</span>
  152.                 </button>
  153.               </div>
  154.             </form>
  155.           </div>
  156.         </div>
  157.       </div>
  158.     </div>
  159.   </main>
  160. {% endblock %}
  161. {% block javascripts %}
  162.   <script src="{{ asset('plugins/jquery-date-dropdowns/dist/jquery.date-dropdowns.min.js') }}"></script>
  163.   <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/>
  164.   <script type="text/javascript">
  165.     $(function () {
  166.       var today = new Date();
  167.       currentYear = today.getFullYear();
  168.       $('#formAgendaDateFilter').on('submit', function (event) {
  169.         event.preventDefault();
  170.         var dateVal = $("#example1").val();
  171.         var notTimestamp = dateVal.includes("/");
  172.         var date = dateVal;
  173.         if (!notTimestamp) {
  174.           date = new Date(dateVal * 1000);
  175.           var day = date.getDate();
  176.           var month = date.getMonth() + 1;
  177.           var year = date.getFullYear();
  178.           date = day + "/" + month + "/" + year;
  179.         }
  180.         window.location.href = '/agenda?date=' + date;
  181.         return false;
  182.       });
  183.       $("#example1").dateDropdowns({
  184.         monthLongValues: [
  185.           'Janvier',
  186.           'Février',
  187.           'Mars',
  188.           'Avril',
  189.           'Mai',
  190.           'Juin',
  191.           'Juillet',
  192.           'Aout',
  193.           'Septembre',
  194.           'Octobre',
  195.           'Novembre',
  196.           'Décembre'
  197.         ],
  198.         submitFormat: 'dd/mm/yyyy',
  199.         minYear: currentYear,
  200.         maxYear: currentYear + 2,
  201.         yearLabel: 'Année',
  202.         daySuffixes: false,
  203.         monthLabel: 'Mois',
  204.         dayLabel: 'Jour',
  205.         dropdownClass: 'form-control',
  206.         required: true,
  207.         defaultDateFormat: 'unix',
  208.         defaultDate: Math.round(
  209.           (new Date()).getTime() / 1000
  210.         )
  211.       });
  212.       var selectsDay = document.querySelector('select.day');
  213.       var selectsMonth = document.querySelector('select.month');
  214.       var selectsYear = document.querySelector('select.year');
  215.       if (document.body.contains(selectsDay)) {
  216.         selectsDay.setAttribute('title', 'jour');
  217.         selectsDay.setAttribute('aria-describedby', 'modalAgendaDateFilterLabel');
  218.       }
  219.       if (document.body.contains(selectsMonth)) {
  220.         selectsMonth.setAttribute('title', 'mois');
  221.         selectsMonth.setAttribute('aria-describedby', 'modalAgendaDateFilterLabel');
  222.       }
  223.       if (document.body.contains(selectsYear)) {
  224.         selectsYear.setAttribute('title', 'année');
  225.         selectsYear.setAttribute('aria-describedby', 'modalAgendaDateFilterLabel');
  226.       }
  227.     });
  228.   </script>
  229.   {{ include('Nordinfo/Main/parts/cookieManager.js.html.twig') }}
  230.   {{ parent() }}
  231. {% endblock %}
  232. {% block footer_top %}
  233.   {% if sites is defined %}
  234.     {% include 'Nordinfo/Main/parts/our-websites.html.twig' %}
  235.   {% endif %}
  236.   {% include 'Nordinfo/Main/parts/preFooter.html.twig' with {prefooter_template: 'nordinfo'} %}
  237. {% endblock %}