templates/application/whileresume/application/enterprises/sidebar.html.twig line 1

Open in your IDE?
  1. <style>
  2.     .nav-wrap .nav-content-bttn.active{
  3.         background:var(--theme-color,#6C3AED) !important;
  4.         color:#fff !important;
  5.         border-radius:10px;
  6.     }
  7.     .nav-wrap .nav-content-bttn.active i,
  8.     .nav-wrap .nav-content-bttn.active span{
  9.         color:#fff !important;
  10.     }
  11.     .nav-wrap .nav-content-bttn.active:hover{
  12.         background:var(--theme-color,#6C3AED) !important;
  13.         color:#fff !important;
  14.     }
  15. </style>
  16. <nav class="navigation scroll-bar">
  17.     <div class="container ps-0 pe-0">
  18.         <div class="nav-content">
  19.             <div class="nav-wrap bg-white bg-transparent-card rounded-xxl shadow-xss pt-3 pb-1 mb-2 mt-2">
  20.                 <div class="nav-caption fw-600 font-xssss text-grey-500"><span></span>{{ 'sidebar.discover'|trans({}, 'whr-public') }}</div>
  21.                 <ul class="mb-1 top-content">
  22.                     <li class="logo d-none d-xl-block d-lg-block"></li>
  23.                     <li>
  24.                         <a href="{% if app.request.locale == 'en' %}{{ path('whileresume_homepage') }}{% else %}{{ path('locale_whileresume_homepage',{'_locale':app.request.locale}) }}{% endif %}" class="nav-content-bttn open-font">
  25.                             <i class="font-xl text-current feather-home me-3"></i>
  26.                             <span>{{ 'sidebar.home'|trans({}, 'whr-public') }}</span>
  27.                         </a>
  28.                     </li>
  29.                     {# Liste publique des offres (dashboard avec filtres) — actif sur toutes les pages /jobs/* #}
  30.                     {% set isOnJobs = app.request.attributes.get('_route') in ['whileresume_jobs_list','locale_whileresume_jobs_list','cvs_application_jobs_filter','locale_cvs_application_jobs_filter','cvs_application_jobs_filter_keyword','locale_cvs_application_jobs_filter_keyword','cvs_application_job_show','locale_cvs_application_job_show'] %}
  31.                     <li{% if isOnJobs %} class="active"{% endif %}>
  32.                         <a href="{% if app.request.locale == 'en' %}{{ path('whileresume_jobs_list') }}{% else %}{{ path('locale_whileresume_jobs_list',{'_locale':app.request.locale}) }}{% endif %}" class="nav-content-bttn open-font{% if isOnJobs %} active{% endif %}">
  33.                             <i class="font-xl text-current feather-briefcase me-3"></i>
  34.                             <span>{{ 'sidebar.jobs'|trans({}, 'whr-public') }}</span>
  35.                         </a>
  36.                     </li>
  37.                     {# Liste publique des entreprises — actif sur toutes les pages /companies/* et /company/* #}
  38.                     {% set isOnCompanies = app.request.attributes.get('_route') in ['whileresume_companies_list','locale_whileresume_companies_list','cvs_application_companies_filter','locale_cvs_application_companies_filter','cvs_application_companies_filter_keyword','locale_cvs_application_companies_filter_keyword','cvs_application_company_show','locale_cvs_application_company_show'] %}
  39.                     <li{% if isOnCompanies %} class="active"{% endif %}>
  40.                         <a href="{% if app.request.locale == 'en' %}{{ path('whileresume_companies_list') }}{% else %}{{ path('locale_whileresume_companies_list',{'_locale':app.request.locale}) }}{% endif %}" class="nav-content-bttn open-font{% if isOnCompanies %} active{% endif %}">
  41.                             <i class="font-xl text-current feather-globe me-3"></i>
  42.                             <span>{{ 'sidebar.companies'|trans({}, 'whr-public') }}</span>
  43.                         </a>
  44.                     </li>
  45.                 </ul>
  46.             </div>
  47.             {% if isCandidateUser %}
  48.             {% endif %}
  49.             {% if sidebarFiltersCities is defined and sidebarFiltersCities|length > 0 %}
  50.                 <div class="nav-wrap bg-white bg-transparent-card rounded-xxl shadow-xss pt-3 pb-1 mb-2 whr-filter-section" data-page-size="5">
  51.                     <div class="nav-caption fw-600 font-xssss text-grey-500"><span>{{ 'sidebar.companyFilterCitiesSection'|trans({}, 'whr-public') }}</span></div>
  52.                     {# Input de recherche live #}
  53.                     {% if sidebarFiltersCities|length > 5 %}
  54.                         <div class="px-3 pt-1 pb-2 whr-filter-search-wrap">
  55.                             <div class="whr-filter-search">
  56.                                 <span class="whr-filter-search-icon">
  57.                                     <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="M21 21l-4.35-4.35"/></svg>
  58.                                 </span>
  59.                                 <input type="text"
  60.                                        class="whr-filter-search-input"
  61.                                        placeholder="{{ 'sidebar.filterSearchCity'|trans({}, 'whr-public') }}"
  62.                                        autocomplete="off">
  63.                             </div>
  64.                         </div>
  65.                     {% endif %}
  66.                     <ul class="mb-1 whr-filter-list">
  67.                         {% for f in sidebarFiltersCities %}
  68.                             <li class="whr-filter-item" data-index="{{ loop.index0 }}" data-filter-label="{{ f.label }}"{% if loop.index0 >= 5 %} style="display:none"{% endif %}>
  69.                                 <a href="{% if app.request.locale == 'en' %}{{ path('cvs_application_companies_filter',{'slug':f.slug}) }}{% else %}{{ path('locale_cvs_application_companies_filter',{'_locale':app.request.locale,'slug':f.slug}) }}{% endif %}"
  70.                                    class="nav-content-bttn open-font h-auto pt-2 pb-2">
  71.                                     {% if f.icon is not empty %}
  72.                                         <span class="me-3" style="font-size:18px;line-height:1;display:inline-block;width:24px;text-align:center;">{{ f.icon }}</span>
  73.                                     {% else %}
  74.                                         <i class="font-sm feather-map-pin me-3 text-grey-500"></i>
  75.                                     {% endif %}
  76.                                     <span>{{ f.label }}</span>
  77.                                 </a>
  78.                             </li>
  79.                         {% endfor %}
  80.                         <li class="whr-filter-empty"><span>{{ 'sidebar.filterNoResults'|trans({}, 'whr-public') }}</span></li>
  81.                     </ul>
  82.                     {# Pagination ← 1/N → #}
  83.                     {% if sidebarFiltersCities|length > 5 %}
  84.                         <div class="px-3 pb-2 pt-1 whr-filter-pager-wrap">
  85.                             <div class="whr-filter-pager">
  86.                                 <button type="button" class="whr-filter-pager-btn whr-filter-pager-prev" aria-label="{{ 'sidebar.filterPrev'|trans({}, 'whr-public') }}">
  87.                                     <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="15 18 9 12 15 6"/></svg>
  88.                                 </button>
  89.                                 <span class="whr-filter-pager-info"><span class="whr-filter-pager-current">1</span>/<span class="whr-filter-pager-total">{{ ((sidebarFiltersCities|length - 1) // 5) + 1 }}</span></span>
  90.                                 <button type="button" class="whr-filter-pager-btn whr-filter-pager-next" aria-label="{{ 'sidebar.filterNext'|trans({}, 'whr-public') }}">
  91.                                     <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="9 18 15 12 9 6"/></svg>
  92.                                 </button>
  93.                             </div>
  94.                         </div>
  95.                     {% endif %}
  96.                 </div>
  97.             {% endif %}
  98.             {% if sidebarFiltersCities is defined and sidebarFiltersCities|length > 5 %}
  99.                 <style>
  100.                     /* Recherche */
  101.                     .whr-filter-search{position:relative;display:block}
  102.                     .whr-filter-search-input{
  103.                         width:100%;padding:6px 10px 6px 28px;
  104.                         border:1px solid #E5E7EB;border-radius:100px;
  105.                         font-size:11.5px;color:#1E1B2E;background:#FAFAFA;
  106.                         font-family:inherit;outline:none;box-sizing:border-box;
  107.                         transition:border-color .15s,background .15s
  108.                     }
  109.                     .whr-filter-search-input:focus{border-color:rgba(108,58,237,.4);background:#fff}
  110.                     .whr-filter-search-input::placeholder{color:#9CA3AF}
  111.                     .whr-filter-search-icon{
  112.                         position:absolute;left:10px;top:50%;transform:translateY(-50%);
  113.                         color:#9CA3AF;pointer-events:none;display:flex
  114.                     }
  115.                     .whr-filter-search-icon svg{width:11px;height:11px}
  116.                     /* État vide (aucun résultat de recherche) */
  117.                     .whr-filter-empty{display:none;list-style:none;padding:10px 14px;text-align:center}
  118.                     .whr-filter-empty span{font-size:11px;color:#9CA3AF;font-style:italic}
  119.                     .whr-filter-list.is-empty .whr-filter-empty{display:list-item}
  120.                     /* Pager */
  121.                     .whr-filter-pager{
  122.                         display:flex;align-items:center;justify-content:center;gap:8px;
  123.                         padding:4px;
  124.                     }
  125.                     .whr-filter-pager-btn{
  126.                         display:inline-flex;align-items:center;justify-content:center;
  127.                         width:26px;height:26px;
  128.                         background:transparent;border:1px solid rgba(108,58,237,.25);border-radius:8px;
  129.                         color:var(--theme-color,#6C3AED);
  130.                         font-family:inherit;cursor:pointer;
  131.                         transition:background .15s,border-color .15s,opacity .15s
  132.                     }
  133.                     .whr-filter-pager-btn:hover:not(:disabled){background:#F5F3FF;border-color:var(--theme-color,#6C3AED)}
  134.                     .whr-filter-pager-btn:disabled{opacity:.35;cursor:not-allowed}
  135.                     .whr-filter-pager-btn svg{width:12px;height:12px}
  136.                     .whr-filter-pager-info{
  137.                         font-size:11.5px;font-weight:600;color:#6B7280;
  138.                         min-width:36px;text-align:center;letter-spacing:.02em
  139.                     }
  140.                     .whr-filter-pager-current{color:var(--theme-color,#6C3AED)}
  141.                     /* Quand la recherche est active, on cache le pager (l'utilisateur voit déjà tous les matches) */
  142.                     .whr-filter-section.is-searching .whr-filter-pager-wrap{display:none}
  143.                 </style>
  144.                 <script>
  145.                     (function(){
  146.                         'use strict';
  147.                         function whrSlug(s){
  148.                             if(!s) return '';
  149.                             var t = String(s);
  150.                             t = t.normalize ? t.normalize('NFD').replace(/[\u0300-\u036f]/g, '') : t;
  151.                             return t.toLowerCase().trim();
  152.                         }
  153.                         document.querySelectorAll('.whr-filter-section').forEach(function(section){
  154.                             var pageSize = parseInt(section.getAttribute('data-page-size'), 10) || 5;
  155.                             var list = section.querySelector('.whr-filter-list');
  156.                             if(!list) return;
  157.                             var items = section.querySelectorAll('.whr-filter-item');
  158.                             var input = section.querySelector('.whr-filter-search-input');
  159.                             var pagerWrap = section.querySelector('.whr-filter-pager');
  160.                             var prevBtn = section.querySelector('.whr-filter-pager-prev');
  161.                             var nextBtn = section.querySelector('.whr-filter-pager-next');
  162.                             var currentSpan = section.querySelector('.whr-filter-pager-current');
  163.                             var totalSpan = section.querySelector('.whr-filter-pager-total');
  164.                             var total = items.length;
  165.                             var totalPages = Math.max(1, Math.ceil(total / pageSize));
  166.                             var currentPage = 1;
  167.                             function renderPage(){
  168.                                 var startIdx = (currentPage - 1) * pageSize;
  169.                                 var endIdx = startIdx + pageSize;
  170.                                 items.forEach(function(it, i){
  171.                                     it.style.display = (i >= startIdx && i < endIdx) ? '' : 'none';
  172.                                 });
  173.                                 if(currentSpan) currentSpan.textContent = currentPage;
  174.                                 if(prevBtn) prevBtn.disabled = (currentPage <= 1);
  175.                                 if(nextBtn) nextBtn.disabled = (currentPage >= totalPages);
  176.                                 list.classList.remove('is-empty');
  177.                             }
  178.                             function applySearch(query){
  179.                                 var q = whrSlug(query || '');
  180.                                 if(!q){
  181.                                     section.classList.remove('is-searching');
  182.                                     renderPage();
  183.                                     return;
  184.                                 }
  185.                                 section.classList.add('is-searching');
  186.                                 var visibleCount = 0;
  187.                                 items.forEach(function(it){
  188.                                     var label = it.getAttribute('data-filter-label') || '';
  189.                                     var matches = whrSlug(label).indexOf(q) !== -1;
  190.                                     it.style.display = matches ? '' : 'none';
  191.                                     if(matches) visibleCount++;
  192.                                 });
  193.                                 if(visibleCount === 0){
  194.                                     list.classList.add('is-empty');
  195.                                 } else {
  196.                                     list.classList.remove('is-empty');
  197.                                 }
  198.                             }
  199.                             if(prevBtn){
  200.                                 prevBtn.addEventListener('click', function(){
  201.                                     if(currentPage > 1){ currentPage--; renderPage(); }
  202.                                 });
  203.                             }
  204.                             if(nextBtn){
  205.                                 nextBtn.addEventListener('click', function(){
  206.                                     if(currentPage < totalPages){ currentPage++; renderPage(); }
  207.                                 });
  208.                             }
  209.                             if(input){
  210.                                 input.addEventListener('input', function(){
  211.                                     applySearch(input.value);
  212.                                 });
  213.                             }
  214.                             // Init
  215.                             renderPage();
  216.                         });
  217.                     })();
  218.                 </script>
  219.             {% endif %}
  220.             <div class="nav-wrap bg-white bg-transparent-card rounded-xxl shadow-xss pt-3 pb-1">
  221.                 <div class="nav-caption fw-600 font-xssss text-grey-500"><span></span>{{ 'sidebar.account'|trans({}, 'whr-public') }}</div>
  222.                 <ul class="mb-1">
  223.                     <li class="logo d-none d-xl-block d-lg-block"></li>
  224.                     {% if connectUser %}
  225.                         {% if isCandidateUser %}
  226.                             <li><a href="{% if app.request.locale == "en" %}{{ path('cvs_gestion_candidates_dashboard') }}{% else %}{{ path('locale_cvs_gestion_candidates_dashboard',{'_locale':app.request.locale}) }}{% endif %}" class="nav-content-bttn open-font h-auto pt-2 pb-2"><i class="font-sm feather-grid me-3 text-grey-500"></i><span>{{ 'layout.sidebar.dashboard'|trans({}, 'whr-candidates') }}</span></a></li>
  227.                             {% if app.user.first == 0 %}
  228.                                 <li><a href="{% if app.request.locale == "en" %}{{ path('cvs_gestion_candidates_profile_profile') }}{% else %}{{ path('locale_cvs_gestion_candidates_profile_profile',{'_locale':app.request.locale}) }}{% endif %}" class="nav-content-bttn open-font h-auto pt-2 pb-2"><i class="font-sm feather-user me-3 text-grey-500"></i><span>{{ 'layout.sidebar.my_profile'|trans({}, 'whr-candidates') }}</span></a></li>
  229.                             {% endif %}
  230.                         {% else %}
  231.                             <li><a href="{% if app.request.locale == "en" %}{{ path('cvs_gestion_enterprises_dashboard') }}{% else %}{{ path('locale_cvs_gestion_enterprises_dashboard',{'_locale':app.request.locale}) }}{% endif %}" class="nav-content-bttn open-font h-auto pt-2 pb-2" ><i class="font-sm feather-grid me-3 text-grey-500"></i> <span>{{ 'layout.nav.dashboard'|trans({}, 'whr-enterprises') }}</span></a></li>
  232.                             <li><a href="{% if app.request.locale == "en" %}{{ path('cvs_gestion_enterprises_profile_profile') }}{% else %}{{ path('locale_cvs_gestion_enterprises_profile_profile',{'_locale':app.request.locale}) }}{% endif %}" class="nav-content-bttn open-font h-auto pt-2 pb-2"><i class="font-sm feather-user me-3 text-grey-500"></i><span>{{ 'layout.nav.my_profile'|trans({}, 'whr-enterprises') }}</span></a></li>
  233.                             <li><a href="{% if app.request.locale == "en" %}{{ path('cvs_gestion_enterprises_settings') }}{% else %}{{ path('locale_cvs_gestion_enterprises_settings',{'_locale':app.request.locale}) }}{% endif %}" class="nav-content-bttn open-font h-auto pt-2 pb-2"><i class="font-sm feather-settings me-3 text-grey-500"></i><span>{{ 'layout.nav.settings'|trans({}, 'whr-enterprises') }}</span></a></li>
  234.                         {% endif %}
  235.                         {% if is_granted("ROLE_SUPER_ADMIN") %}
  236.                             <li><a href="{{ path('backoffice_dashboard') }}" class="nav-content-bttn open-font h-auto pt-2 pb-2"><i class="font-sm feather-settings me-3 text-grey-500"></i><span>{{ 'layout.nav.administration'|trans({}, 'whr-enterprises') }}</span></a></li>
  237.                         {% endif %}
  238.                         <li><a href="{{ path('app_logout') }}" class="nav-content-bttn open-font h-auto pt-2 pb-2"><i class="font-sm feather-log-out me-3 text-grey-500"></i><span>{{ 'layout.nav.logout'|trans({}, 'whr-enterprises') }}</span></a></li>
  239.                     {% else %}
  240.                         <li>
  241.                             <a href="{% if app.request.locale == 'en' %}{{ path('app_login') }}{% else %}{{ path('locale_app_login',{'_locale':app.request.locale}) }}{% endif %}" class="nav-content-bttn open-font h-auto pt-2 pb-2">
  242.                                 <i class="font-sm feather-log-in me-3 text-grey-500"></i>
  243.                                 <span>{{ 'sidebar.signin'|trans({}, 'whr-public') }}</span>
  244.                             </a>
  245.                         </li>
  246.                         <li>
  247.                             <a href="{% if app.request.locale == 'en' %}{{ path('whileresume_resume_en') }}{% else %}{{ path('whileresume_resume_fr') }}{% endif %}" class="nav-content-bttn open-font h-auto pt-2 pb-2">
  248.                                 <i class="font-sm feather-user-plus me-3 text-grey-500"></i>
  249.                                 <span>{{ 'sidebar.signup'|trans({}, 'whr-public') }}</span>
  250.                             </a>
  251.                         </li>
  252.                     {% endif %}
  253.                 </ul>
  254.             </div>
  255.         </div>
  256.     </div>
  257. </nav>