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

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