templates/front/agenda.html.twig line 1

Open in your IDE?
  1. {% extends 'base_front.html.twig' %}
  2. {% block title %}{{ parent() }} | {{ config.agendaTitre }}{% endblock %}
  3. {% block h1 %}
  4.     {{ config.agendaTitre }}
  5.     {% if app.user and is_granted('ROLE_MODO') %}
  6.         <a target="_blank" href="{{ path('app_admin_agenda_index') }}"><i class="text-danger" data-feather="unlock"></i></a>
  7.     {% endif %}
  8. {% endblock %}
  9. {% block ariane %}
  10.     <nav class="navigateur" aria-label="breadcrumb">
  11.         <ol class="breadcrumb">
  12.             <li class="breadcrumb-item"><a href="{{ path("home") }}">{{ config.titreAccueil }}</a></li>
  13.             <li class="breadcrumb-item active" aria-current="page">{{ config.agendaTitre }}</li>
  14.         </ol>
  15.     </nav>
  16. {% endblock %}
  17. {% block body %}
  18.     {% if config.agendaSrcImg %}
  19.         <div class="mx-12">
  20.             <img 
  21.                 src="{{ asset('images/configuration/' ~ config.agendaSrcImg) }}" 
  22.                 {% if config.agendaAltImg %}
  23.                     alt="{{ config.agendaAltImg }}" 
  24.                 {% endif %}
  25.                 {% if config.agendaTitleImg %}
  26.                     title="{{ config.agendaTitleImg }}"
  27.                 {% endif %}
  28.                 
  29.                 class="imgRatio rounded"
  30.             >
  31.         </div>
  32.     {% endif %}
  33.     {% if config.agendaDescription %}
  34.         <div class="my-4 mx-12 ck bg-white p-4 rounded">{{ config.agendaDescription|raw }}</div>
  35.     {% endif %}
  36.     {# <div class="my-4 mx-12  bg-white p-4 rounded">
  37.         <div class="text-center">
  38.             {% for year in years %}
  39.                 {% if yearActuel == year.annee %}
  40.                     <a class="bg-primary text-white px-3 py-2">{{ year.annee }}</a>
  41.                 {% elseif yearActuel > year.annee %}
  42.                     <a class="border border-primary px-3 py-2" href="{{ path('agenda', {'year' : year.annee, 'month' :  year.mois }) }}">{{ year.annee }}</a>
  43.                 {% elseif yearActuel < year.annee %}
  44.                     <a class="border border-primary px-3 py-2" href="{{ path('agenda', {'year' : year.annee, 'month' :  year.mois }) }}">{{ year.annee }}</a>
  45.                 {% endif %}
  46.             {% endfor %}
  47.         </div>
  48.         <div class="text-center mt-4">
  49.             {% for key,mois in moisAll %}
  50.                 {% if key == moisActuel %}
  51.                     <a class="bg-primary text-white px-2 py-2" >{{ mois.nom }}</a>
  52.                 {% else %}
  53.                     {% if mois.evenements %}
  54.                         <a class="border border-primary px-2 py-2" href="{{ path('agenda', {'year' : yearActuel, 'month' : key}) }}">{{ mois.nom }}</a>
  55.                     {% else %}
  56.                         <a class="px-2 py-2 bg-danger text-white">{{ mois.nom }}</a>
  57.                     {% endif %}
  58.                     
  59.                 {% endif %}
  60.             
  61.             {% endfor %}
  62.         </div>
  63.     </div> #}
  64.     
  65.     <div id="zoneAgenda">
  66.         {% include "front/_agenda_card.html.twig" %}
  67.     </div>
  68.     
  69.     
  70.     
  71. {% endblock %}
  72. {# {% block javascripts %}
  73.     <script src="{{ asset('js/cardShow.js') }}"></script>   
  74.     <script>
  75.         var elements = document.querySelectorAll(".taille");
  76.         sizeCard(elements);
  77.     </script>
  78. {% endblock %} #}
  79. {% block javascripts %}
  80.     <script src="{{ asset('js/cardShow.js') }}"></script>
  81.     <script>
  82.         $('body').on('click', '.changeYearMonth', function() {
  83.             let dataYear = $(this).data('year');
  84.             console.log(dataYear)
  85.             let dataMonth = $(this).data('month');
  86.             console.log(dataMonth)
  87.             const Params = new URLSearchParams();
  88.             Params.append('annee', dataYear);
  89.             Params.append('mois', dataMonth);
  90.             
  91.             const Url = new URL(window.location.href);
  92.     
  93.             fetch(Url.pathname + "?" + Params.toString() + "&ajax=xxx", {
  94.                 headers: {
  95.                     "X-Requested-With": "XMLHttpRequest"
  96.                 }
  97.             }).then(response => {
  98.                 return response.json()
  99.             }).then(data => {
  100.                 
  101.               const content = document.querySelector("#zoneAgenda");
  102.               content.innerHTML = data.content;
  103.               history.pushState({}, null, Url.pathname + "?" + Params.toString());
  104.               var elements = document.querySelectorAll(".taille");
  105.               sizeCard(elements);
  106.             
  107.             }).catch(e => alert(e));
  108.         });
  109.         
  110.         var elements = document.querySelectorAll(".taille");
  111.         sizeCard(elements);
  112.         $(window).on('resize', function() {
  113.             var elements = document.querySelectorAll(".taille");
  114.             sizeCard(elements);
  115.         });
  116.     </script>
  117.     
  118. {% endblock %}