templates/Theme/navbar.html.twig line 1

Open in your IDE?
  1. {% set currentPath = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
  2. <style>
  3.     .progress {
  4.         width: 45px;
  5.         height: 45px;
  6.         background: none;
  7.         position: relative;
  8.         top: 0px;
  9.         right: 10px;
  10.     }
  11.     .progress::after {
  12.         content: "";
  13.         width: 100%;
  14.         height: 100%;
  15.         border-radius: 50%;
  16.         border: 6px solid #fff;
  17.         position: absolute;
  18.         top: 0;
  19.         left: 0;
  20.     }
  21.     .progress > span {
  22.         width: 50%;
  23.         height: 100%;
  24.         overflow: hidden;
  25.         position: absolute;
  26.         top: 0;
  27.         z-index: 1;
  28.     }
  29.     .progress .progress-left {
  30.         left: 0;
  31.     }
  32.     .progress .progress-bar {
  33.         width: 100%;
  34.         height: 100%;
  35.         background: none;
  36.         border-width: 6px;
  37.         border-style: solid;
  38.         position: absolute;
  39.         top: 0;
  40.         border-color: #db1a21 !important;
  41.     }
  42.     .progress .progress-left .progress-bar {
  43.         left: 100%;
  44.         border-top-right-radius: 80px;
  45.         border-bottom-right-radius: 80px;
  46.         border-left: 0;
  47.         -webkit-transform-origin: center left;
  48.         transform-origin: center left;
  49.     }
  50.     .progress .progress-right {
  51.         right: 0;
  52.     }
  53.     .progress .progress-right .progress-bar {
  54.         left: -100%;
  55.         border-top-left-radius: 80px;
  56.         border-bottom-left-radius: 80px;
  57.         border-right: 0;
  58.         -webkit-transform-origin: center right;
  59.         transform-origin: center right;
  60.     }
  61.     .progress .progress-value {
  62.         position: absolute;
  63.         top: 0;
  64.         left: 0;
  65.     }
  66.     .progress .progress-value .h2 {
  67.         font-size: 11px;
  68.         color: #ffffff;
  69.         margin: 0;
  70.     }
  71.     @media (min-width: 768px) {
  72.         .progress {
  73.             position: absolute;
  74.             top: 10px;
  75.             right: calc(50% - 150px);
  76.         }
  77.     }
  78.     @media (min-width: 992px) {
  79.         .progress {
  80.             position: absolute;
  81.             top: 10px;
  82.             right: calc(30% - 150px);
  83.         }
  84.     }
  85.     @media (min-width: 1200px) {
  86.         .progress {
  87.             position: absolute;
  88.             top: 10px;
  89.             right: calc(30% - 150px);
  90.         }
  91.     }
  92.     @media (min-width: 1400px) {
  93.         .progress {
  94.             position: absolute;
  95.             top: 10px;
  96.             right: calc(23% - 150px);
  97.         }
  98.     }
  99. </style>
  100. <script>
  101.     $(function () {
  102.         $(".progress").each(function () {
  103.             var value = $(this).attr('data-value');
  104.             var left = $(this).find('.progress-left .progress-bar');
  105.             var right = $(this).find('.progress-right .progress-bar');
  106.             if (value > 0) {
  107.                 if (value <= 50) {
  108.                     right.css('transform', 'rotate(' + percentageToDegrees(value) + 'deg)')
  109.                 } else {
  110.                     right.css('transform', 'rotate(180deg)')
  111.                     left.css('transform', 'rotate(' + percentageToDegrees(value - 50) + 'deg)')
  112.                 }
  113.             }
  114.         })
  115.         function percentageToDegrees(percentage) {
  116.             return percentage / 100 * 360
  117.         }
  118.     });
  119. </script>
  120. {% if is_granted('ROLE_INCOMPLETE_USER') and not (currentPath starts with '/express/') and not (currentPath starts with '/login') %}
  121.     {% include 'Theme/_userNavbar.html.twig' %}
  122. {% else %}
  123.     <nav class="navbar navbar-expand-lg sticky-top">
  124.         <div class="container p-0">
  125.             <div class="d-flex container-fluid justify-content-between p-0 position-relative">
  126.             
  127.                 {% if currentPath is same as '/user/' %}
  128.                 <div class="d-md-none">
  129.                         <a class="nav-link d-flex h-100 align-items-center minimize_sidebar d-lg-none">
  130.                             <i class="far fa-bars "></i>
  131.                         </a>
  132.                 </div>
  133.                 {% elseif breadcrumbComplaintExpress is not defined  %}
  134.                 <div class="d-md-none">
  135.                     <a class="nav-link nav-link d-flex h-100 align-items-center" href="{{ returnUrl is defined ? returnUrl : "javascript:customHistoryBack()" }}" id="back">
  136.                         <i class="far fa-angle-left fz-30"></i>
  137.                     </a>
  138.                 </div>
  139.                 {% elseif (app.request.get('_route') in ['express_complaint_register']) or (app.request.query.get('complaint') == 1) %}
  140.                 <div class="d-md-none">
  141.                     <a class="nav-link nav-link d-flex h-100 align-items-center" href="javascript:customHistoryBack()" id="back">
  142.                         <i class="far fa-angle-left fz-30"></i>
  143.                     </a>
  144.                 </div>
  145.                 {% elseif (app.request.get('_route') in ['express_complaint_register']) or (app.request.query.get('complaint') == 1) or (app.user is not null and breadcrumbComplaintExpress is defined and app.request.get('_route') != 'express_complaint_x_identite') %}
  146.                 <div class="d-none">
  147.                     <a class="nav-link nav-link d-flex h-100 align-items-center" href="{{ returnUrl is defined ? returnUrl : "javascript:customHistoryBack()" }}    " id="back">
  148.                         <i class="far fa-angle-left fz-30"></i>
  149.                     </a>
  150.                 </div>
  151.                 {% endif %}
  152.                 <div class="d-none">
  153.                     {% if currentPath starts with '/express/' or (currentPath starts with '/login')%}
  154.                         <a class="nav-link" href="javascript:customHistoryBack()" id="back">
  155.                             <i class="far fa-angle-left "></i>
  156.                         </a>
  157.                     {% endif %}
  158.                 </div>
  159.                     {#        <div> #}
  160.                     {#            {% if is_granted('ROLE_INCOMPLETE_USER') and not (currentPath starts with '/express/') %} #}
  161.                     {#            {% if(currentPath is same as '/user/') %} #}
  162.                     {#                <a class="nav-link minimize_sidebar d-lg-none" href="#"> #}
  163.                     {#                    <i class="far fa-bars "></i> #}
  164.                     {#                </a> #}
  165.                     {#            {% else %} #}
  166.                     {#                <a class="nav-link" href="javascript:customHistoryBack()" id="back" > #}
  167.                     {#                    <i class="far fa-angle-left "></i> #}
  168.                     {#                </a> #}
  169.                     {#            {% endif %} #}
  170.                     {#        </div> #}
  171.                 {% if is_granted('ROLE_INCOMPLETE_USER') and not (currentPath starts with '/express/') and not (currentPath starts with '/login')%}
  172.                     {#            <div class="text-center text-white"> #}
  173.                     {#            <div class="text-center d-none d-lg-block text-white"> #}{#            <div class="text-blue-riposte text-center d-none d-lg-block"> #}
  174.                     <div class="text-blue-riposte text-center d-lg-none d-xl-none d-xxl-none">{{ heading }}
  175.                     </div> 
  176.                 {% else %}
  177.                     <div class="d-flex justify-content-center align-items-center text-center text-white text-mobile"
  178.                          style="color: white;">
  179.                         <div class="d-flex justify-content-center align-items-center text-center text-white text-mobile brand px-3 ms-0">
  180.                             <div>
  181.                                 <img style="height: 60px;" src="{{ asset('/assets/img/svg/riposte_logo.svg') }}">
  182.                             </div>
  183.                         </div>
  184.                     </div>
  185.                     <div class="complaint_cancel ms-md-auto d-flex {{ breadcrumbComplaintExpress is defined and app.request.get('_route') not in ['login', 'login_register', 'express_complaint_register'] ? 'pause' : '' }}">
  186.                         {% if app.user is not null and breadcrumbComplaintExpress is defined %}
  187.                             <button href="{{ path('user_homepage') }}" data-bs-toggle="modal"
  188.                                     data-bs-target="#modalComplaintPause">
  189.                                 <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24"
  190.                                      stroke-width="3" stroke="currentColor" class="w-6 h-6">
  191.                                     <path stroke-linecap="round" stroke-linejoin="round"
  192.                                           d="M15.75 5.25v13.5m-7.5-13.5v13.5"/>
  193.                                 </svg>
  194.                                 <span class="d-none d-md-inline">Pause</span>
  195.                             </button>
  196.                         {% else %}
  197.                             <a href="{{ path(app.user is null ? 'portal' : 'user_homepage') }}">
  198.                                 <img src="{{ asset('assets/img/svg/cancel.svg') }}"/>
  199.                                 <span class="d-none d-md-inline">Quitter</span>
  200.                             </a>
  201.                         {% endif %}
  202.                     </div>
  203.                 {% endif %}
  204.                 <div class="menu-last">
  205.                     {% if is_granted('ROLE_INCOMPLETE_USER') and not (currentPath starts with '/express/') and not (currentPath starts with '/login')%}
  206.                         {% if currentPath is same as '/user/' %}
  207.                             {#                    <a class="nav-link minimize_sidebar d-lg-none"> #}
  208.                             {#                        <i class="far fa-bars "></i> #}
  209.                             {#                    </a> #}
  210.                             <a class="nav-link d-lg-none" href="{{ path('logout') }}" title="Déconnexion"> <i
  211.                                         class="fas fa-sign-out-alt"></i>
  212.                             </a>
  213.                         {% else %}
  214.                             <a class="nav-link d-lg-none" href="{{ path('user_home', {sidebar: 'expanded'}) }}">
  215.                                 <i class="far fa-bars "></i>
  216.                             </a>
  217.                         {% endif %}
  218.                     {% else %}
  219.                         {% if not (currentPath starts with '/express/') and not (currentPath starts with '/login') %}
  220.                             {#                {% if is_granted('ROLE_INCOMPLETE_USER') %} #}
  221.                             {#                    <a class="nav-link" href="{{path('user_home', {sidebar: 'expanded'})}}"> #}
  222.                             {#                    <a class="nav-link minimize_sidebar d-lg-none" href="{{path('user_home', {sidebar: 'expanded'})}}"> #}
  223.                             <a class="nav-link d-lg-none" href="{{ path('user_home', {sidebar: 'expanded'}) }}"> <i
  224.                                         class="far fa-bars "></i>
  225.                             </a>
  226.                             {#                {% endif %} #}
  227.                         {% else %}
  228.                             {% if breadcrumbExpress is defined or breadcrumbComplaintExpress is defined  %}
  229.                                 {% if app.request.get('_route') not in ['login', 'login_register', 'express_complaint_register'] %}
  230.                                 <div class="progress mx-auto ms-3"
  231.                                      data-value="{% if progressValue is defined %}{{ progressValue }}{% endif %}">
  232.                                     <span class="progress-left">
  233.                                         <span class="progress-bar border-primary"></span>
  234.                                     </span>
  235.                                             <span class="progress-right">
  236.                                         <span class="progress-bar border-primary"></span>
  237.                                     </span>
  238.                                     <div class="progress-value w-100 h-100 rounded-circle d-flex align-items-center justify-content-center">
  239.                                         <div class="h2 font-weight-bold">
  240.                                             {% if progressValue is defined %}
  241.                                                 {{ progressValue }}
  242.                                             {% endif %}%
  243.                                         </div>
  244.                                     </div>
  245.                                 </div>
  246.                                 {% endif %}
  247.                             {% endif %}
  248.                         {% endif %}
  249.                     {% endif %}
  250.                 </div>
  251.             </div>
  252.         </div>
  253.         {# Desktop RIGHT Menu Espace Personnel #}
  254.         {# Desktop RIGHT Déconnexion button #}
  255.         {# -> excluded on Express process #}
  256.     </nav>
  257. {% endif %}
  258. {% if not is_granted('ROLE_INCOMPLETE_USER') or (currentPath starts with '/express/') or (currentPath starts with '/login')%}
  259.     <div class="container ">
  260.         <div class="container-fluid">
  261.             <div class="complaint_title text-center {{ currentPath starts with '/express/' ? 'd-flex justify-content-center' : '' }}">
  262.                 
  263.                 {% if breadcrumbComplaintExpress is not defined or app.request.get('_route') in ['express_complaint_x_params', 'express_complaint_x_steal_breaking', 'express_complaint_x_resident_type'] %}
  264.                     <img src="{{ asset('assets/img/svg/pencil.svg') }}"/>
  265.                     Porter plainte
  266.                 {% else %}
  267.                     {{ app.request.session.get('expressComplaintCategoryName', 'Porter plainte') }}
  268.                 {% endif %}
  269.             </div>
  270.         </div>
  271.     </div>
  272. {% endif %}
  273. {% include "Commons/modalComplaintPause.html.twig" %}
  274. <script>
  275.     const lastItemMenu = document.querySelector('.menu-last');
  276.     if (lastItemMenu && lastItemMenu.innerHTML.trim() === '') {
  277.         lastItemMenu.parentElement.removeChild(lastItemMenu);
  278.     }
  279. </script>