templates/backend/default/index.html.twig line 1

Open in your IDE?
  1. {% extends 'backend/base.html.twig' %}
  2. {% block title %}Accueil{% endblock %}
  3. {% block content %}
  4.     <div class="row justify-content-md-center">
  5.         <div class="col-12 col-lg-8 mb-4 mb-lg-0">
  6.             <div class="card h-100">
  7.                 <div class="card-header">
  8.                     <div class="row">
  9.                         <div class="col-12 col-lg-6">
  10.                             <h4>Adhérents par régions {{ mapSelectedYear }}</h4>
  11.                             <div class="text-sm"><i>Cliquez sur les numéros pour voir le détails</i></div>
  12.                         </div>
  13.                         <div class="col-12 col-lg-6 text-end">
  14.                             <a href="{{ path('app_homepage', {year: (nowYear - 2)}) }}" class="btn {{ (nowYear - 2) == mapSelectedYear ? 'btn-success' : 'btn-outline-secondary' }} btn-sm">{{ nowYear - 2 }}</a>
  15.                             <a href="{{ path('app_homepage', {year: (nowYear - 1)}) }}" class="btn {{ (nowYear - 1) == mapSelectedYear ? 'btn-success' : 'btn-outline-secondary' }} btn-sm">{{ nowYear - 1 }}</a>
  16.                             <a href="{{ path('app_homepage', {year: (nowYear)}) }}" class="btn {{ nowYear == mapSelectedYear ? 'btn-success' : 'btn-outline-secondary' }} btn-sm">{{ nowYear }}</a>
  17.                         </div>
  18.                     </div>
  19.                 </div>
  20.                 <div class="card-body">
  21.                     <div
  22.                             class="map mx-auto"
  23.                             data-controller="region-details-modal"
  24.                             data-region-details-modal-id-value="#regionDetail"
  25.                             data-region-details-modal-year-value="{{ mapSelectedYear }}"
  26.                             data-region-details-modal-display-value="{{ is_granted('ROLE_BOARD_DIRECTOR') or is_granted('ROLE_REGIONAL_AGENT') or is_granted('ROLE_UNION_PRESIDENT') ? 'false' : 'true' }}"
  27.                     >
  28.                         {% set color = '#000000' %}
  29.                         {% if memberPerRegion is not empty %}
  30.                             <span class="map-value" data-region-id="{{ memberPerRegion[6].id }}" style="top: 115px; right: -335px;" title="{{ memberPerRegion[6].name ~ '(' ~ memberPerRegion[6].id ~')' }}">
  31.                                 {{ memberPerRegion[6].countMember }}
  32.                             </span>
  33.                             <span class="map-value" data-region-id="{{ memberPerRegion[8].id }}" style="top: 163px;right: -203px;" title="{{ memberPerRegion[8].name ~ '(' ~ memberPerRegion[8].id ~')' }}">
  34.                                 {{ memberPerRegion[8].countMember }}
  35.                             </span>
  36.                             <span class="map-value" data-region-id="{{ memberPerRegion[7].id }}" style="top: 189px; right: -308px;" title="{{ memberPerRegion[7].name ~ '(' ~ memberPerRegion[7].id ~')' }}">
  37.                                 {{ memberPerRegion[7].countMember }}
  38.                             </span>
  39.                             <span class="map-value" data-region-id="{{ memberPerRegion[5].id }}" style="top: 189px; right: -421px;" title="{{ memberPerRegion[5].name ~ '(' ~ memberPerRegion[5].id ~')' }}">
  40.                                 {{ memberPerRegion[5].countMember }}
  41.                             </span>
  42.                             <span class="map-value" data-region-id="{{ memberPerRegion[1].id }}" style="top: 296px; right: -374px;" title="{{ memberPerRegion[1].name ~ '(' ~ memberPerRegion[1].id ~')' }}">
  43.                                 {{ memberPerRegion[1].countMember }}
  44.                             </span>
  45.                             <span class="map-value" data-region-id="{{ memberPerRegion[0].id }}" style="top: 416px;right: -347px;" title="{{ memberPerRegion[0].name ~ '(' ~ memberPerRegion[0].id ~')' }}">
  46.                                 {{ memberPerRegion[0].countMember }}
  47.                             </span>
  48.                             <span class="map-value" data-region-id="{{ memberPerRegion[12].id }}" style="top: 509px; right: -388px;" title="{{ memberPerRegion[12].name ~ '(' ~ memberPerRegion[12].id ~')' }}">
  49.                                 {{ memberPerRegion[12].countMember }}
  50.                             </span>
  51.                             <span class="map-value" data-region-id="{{ memberPerRegion[10].id }}" style="top: 505px; right: -204px;" title="{{ memberPerRegion[10].name ~ '(' ~ memberPerRegion[10].id ~')' }}">
  52.                                 {{ memberPerRegion[10].countMember }}
  53.                             </span>
  54.                             <span class="map-value" data-region-id="{{ memberPerRegion[9].id }}" style="top: 400px; right: -103px;" title="{{ memberPerRegion[9].name ~ '(' ~ memberPerRegion[9].id ~')' }}">
  55.                                 {{ memberPerRegion[9].countMember }}
  56.                             </span>
  57.                             <span class="map-value" data-region-id="{{ memberPerRegion[3].id }}" style="top: 285px; right: -142px;" title="{{ memberPerRegion[3].name ~ '(' ~ memberPerRegion[3].id ~')' }}">
  58.                                 {{ memberPerRegion[3].countMember }}
  59.                             </span>
  60.                             <span class="map-value" data-region-id="{{ memberPerRegion[2].id }}" style="top: 222px; right: 67px;" title="{{ memberPerRegion[2].name ~ '(' ~ memberPerRegion[2].id ~')' }}">
  61.                                 {{ memberPerRegion[2].countMember }}
  62.                             </span>
  63.                             <span class="map-value" data-region-id="{{ memberPerRegion[11].id }}" style="top: 222px; right: -19px;" title="{{ memberPerRegion[11].name ~ '(' ~ memberPerRegion[11].id ~')' }}">
  64.                                 {{ memberPerRegion[11].countMember }}
  65.                             </span>
  66.                             <span class="map-value" data-region-id="{{ memberPerRegion[4].id }}" style="top: 596px; right: -409px;" title="{{ memberPerRegion[4].name ~ '(' ~ memberPerRegion[4].id ~')' }}">
  67.                                 {{ memberPerRegion[4].countMember }}
  68.                             </span>
  69.                         {% endif %}
  70.                     </div>
  71.                 </div>
  72.             </div>
  73.         </div>
  74.         <div class="col-12 col-lg-4">
  75.             <div class="card">
  76.                 <div class="card-header"><h4>Adhésion sur les 3 dernières années</h4></div>
  77.                 <div class="card-body">
  78.                     {{ render_chart(chartMemberPerYear) }}
  79.                 </div>
  80.             </div>
  81.         </div>
  82.     </div>
  83.     <!-- Modal -->
  84.     <div class="modal fade" id="regionDetail" tabindex="-1" aria-labelledby="regionDetailLabel" aria-hidden="true">
  85.         <div class="modal-dialog modal-lg">
  86.             <div class="modal-content">
  87.                 <div class="modal-header">
  88.                     <h1 class="modal-title fs-5" id="regionDetailLabel"></h1>
  89.                     <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  90.                 </div>
  91.                 <div class="modal-body">
  92.                     <table class="table">
  93.                         <thead>
  94.                             <tr>
  95.                                 <th>Raison sociale</th>
  96.                                 <th class="text-center">Action(s)</th>
  97.                             </tr>
  98.                         </thead>
  99.                         <tbody id="region-details">
  100.                         </tbody>
  101.                     </table>
  102.                 </div>
  103.             </div>
  104.         </div>
  105.     </div>
  106. {% endblock %}