templates/application/whileresume/application/jobs/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.                     {% if isCandidateUser %}
  46.                         <li>
  47.                             <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">
  48.                                 <i class="font-xl text-current feather-heart me-3"></i>
  49.                                 <span>{{ 'sidebar.favorites'|trans({}, 'whr-public') }}</span>
  50.                             </a>
  51.                         </li>
  52.                     {% endif %}
  53.                 </ul>
  54.             </div>
  55.             {% if isCandidateUser %}
  56.             {% endif %}
  57.             {% if sidebarFiltersCities is defined and sidebarFiltersCities|length > 0 %}
  58.                 <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">
  59.                     <div class="nav-caption fw-600 font-xssss text-grey-500"><span>{{ 'sidebar.filterCitiesSection'|trans({}, 'whr-public') }}</span></div>
  60.                     {# Input de recherche live #}
  61.                     {% if sidebarFiltersCities|length > 5 %}
  62.                         <div class="px-3 pt-1 pb-2 whr-filter-search-wrap">
  63.                             <div class="whr-filter-search">
  64.                                 <span class="whr-filter-search-icon">
  65.                                     <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>
  66.                                 </span>
  67.                                 <input type="text"
  68.                                        class="whr-filter-search-input"
  69.                                        placeholder="{{ 'sidebar.filterSearchCity'|trans({}, 'whr-public') }}"
  70.                                        autocomplete="off">
  71.                             </div>
  72.                         </div>
  73.                     {% endif %}
  74.                     <ul class="mb-1 whr-filter-list">
  75.                         {% for f in sidebarFiltersCities %}
  76.                             <li class="whr-filter-item" data-index="{{ loop.index0 }}" data-filter-label="{{ f.label }}"{% if loop.index0 >= 5 %} style="display:none"{% endif %}>
  77.                                 <a href="{% if app.request.locale == 'en' %}{{ path('cvs_application_jobs_filter',{'slug':f.slug}) }}{% else %}{{ path('locale_cvs_application_jobs_filter',{'_locale':app.request.locale,'slug':f.slug}) }}{% endif %}"
  78.                                    class="nav-content-bttn open-font h-auto pt-2 pb-2">
  79.                                     {% if f.icon is not empty %}
  80.                                         <span class="me-3" style="font-size:18px;line-height:1;display:inline-block;width:24px;text-align:center;">{{ f.icon }}</span>
  81.                                     {% else %}
  82.                                         <i class="font-sm feather-map-pin me-3 text-grey-500"></i>
  83.                                     {% endif %}
  84.                                     <span>{{ f.label }}</span>
  85.                                 </a>
  86.                             </li>
  87.                         {% endfor %}
  88.                         <li class="whr-filter-empty"><span>{{ 'sidebar.filterNoResults'|trans({}, 'whr-public') }}</span></li>
  89.                     </ul>
  90.                     {# Pagination ← 1/N → #}
  91.                     {% if sidebarFiltersCities|length > 5 %}
  92.                         <div class="px-3 pb-2 pt-1 whr-filter-pager-wrap">
  93.                             <div class="whr-filter-pager">
  94.                                 <button type="button" class="whr-filter-pager-btn whr-filter-pager-prev" aria-label="{{ 'sidebar.filterPrev'|trans({}, 'whr-public') }}">
  95.                                     <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="15 18 9 12 15 6"/></svg>
  96.                                 </button>
  97.                                 <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>
  98.                                 <button type="button" class="whr-filter-pager-btn whr-filter-pager-next" aria-label="{{ 'sidebar.filterNext'|trans({}, 'whr-public') }}">
  99.                                     <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="9 18 15 12 9 6"/></svg>
  100.                                 </button>
  101.                             </div>
  102.                         </div>
  103.                     {% endif %}
  104.                 </div>
  105.             {% endif %}
  106.             {% if sidebarFiltersCategories is defined and sidebarFiltersCategories|length > 0 %}
  107.                 <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">
  108.                     <div class="nav-caption fw-600 font-xssss text-grey-500"><span>{{ 'sidebar.filterCategoriesSection'|trans({}, 'whr-public') }}</span></div>
  109.                     {% if sidebarFiltersCategories|length > 5 %}
  110.                         <div class="px-3 pt-1 pb-2 whr-filter-search-wrap">
  111.                             <div class="whr-filter-search">
  112.                                 <span class="whr-filter-search-icon">
  113.                                     <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>
  114.                                 </span>
  115.                                 <input type="text"
  116.                                        class="whr-filter-search-input"
  117.                                        placeholder="{{ 'sidebar.filterSearchCategory'|trans({}, 'whr-public') }}"
  118.                                        autocomplete="off">
  119.                             </div>
  120.                         </div>
  121.                     {% endif %}
  122.                     <ul class="mb-1 whr-filter-list">
  123.                         {% for f in sidebarFiltersCategories %}
  124.                             <li class="whr-filter-item" data-index="{{ loop.index0 }}" data-filter-label="{{ f.label }}"{% if loop.index0 >= 5 %} style="display:none"{% endif %}>
  125.                                 <a href="{% if app.request.locale == 'en' %}{{ path('cvs_application_jobs_filter',{'slug':f.slug}) }}{% else %}{{ path('locale_cvs_application_jobs_filter',{'_locale':app.request.locale,'slug':f.slug}) }}{% endif %}"
  126.                                    class="nav-content-bttn open-font h-auto pt-2 pb-2">
  127.                                     {% if f.icon is not empty %}
  128.                                         <span class="me-3" style="font-size:18px;line-height:1;display:inline-block;width:24px;text-align:center;">{{ f.icon }}</span>
  129.                                     {% else %}
  130.                                         <i class="font-sm feather-briefcase me-3 text-grey-500"></i>
  131.                                     {% endif %}
  132.                                     <span>{{ f.label }}</span>
  133.                                 </a>
  134.                             </li>
  135.                         {% endfor %}
  136.                         <li class="whr-filter-empty"><span>{{ 'sidebar.filterNoResults'|trans({}, 'whr-public') }}</span></li>
  137.                     </ul>
  138.                     {% if sidebarFiltersCategories|length > 5 %}
  139.                         <div class="px-3 pb-2 pt-1 whr-filter-pager-wrap">
  140.                             <div class="whr-filter-pager">
  141.                                 <button type="button" class="whr-filter-pager-btn whr-filter-pager-prev" aria-label="{{ 'sidebar.filterPrev'|trans({}, 'whr-public') }}">
  142.                                     <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="15 18 9 12 15 6"/></svg>
  143.                                 </button>
  144.                                 <span class="whr-filter-pager-info"><span class="whr-filter-pager-current">1</span>/<span class="whr-filter-pager-total">{{ ((sidebarFiltersCategories|length - 1) // 5) + 1 }}</span></span>
  145.                                 <button type="button" class="whr-filter-pager-btn whr-filter-pager-next" aria-label="{{ 'sidebar.filterNext'|trans({}, 'whr-public') }}">
  146.                                     <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="9 18 15 12 9 6"/></svg>
  147.                                 </button>
  148.                             </div>
  149.                         </div>
  150.                     {% endif %}
  151.                 </div>
  152.             {% endif %}
  153.             {% if (sidebarFiltersCities is defined and sidebarFiltersCities|length > 5)
  154.                 or (sidebarFiltersCategories is defined and sidebarFiltersCategories|length > 5) %}
  155.                 <style>
  156.                     /* Recherche */
  157.                     .whr-filter-search{position:relative;display:block}
  158.                     .whr-filter-search-input{
  159.                         width:100%;padding:6px 10px 6px 28px;
  160.                         border:1px solid #E5E7EB;border-radius:100px;
  161.                         font-size:11.5px;color:#1E1B2E;background:#FAFAFA;
  162.                         font-family:inherit;outline:none;box-sizing:border-box;
  163.                         transition:border-color .15s,background .15s
  164.                     }
  165.                     .whr-filter-search-input:focus{border-color:rgba(108,58,237,.4);background:#fff}
  166.                     .whr-filter-search-input::placeholder{color:#9CA3AF}
  167.                     .whr-filter-search-icon{
  168.                         position:absolute;left:10px;top:50%;transform:translateY(-50%);
  169.                         color:#9CA3AF;pointer-events:none;display:flex
  170.                     }
  171.                     .whr-filter-search-icon svg{width:11px;height:11px}
  172.                     /* État vide (aucun résultat de recherche) */
  173.                     .whr-filter-empty{display:none;list-style:none;padding:10px 14px;text-align:center}
  174.                     .whr-filter-empty span{font-size:11px;color:#9CA3AF;font-style:italic}
  175.                     .whr-filter-list.is-empty .whr-filter-empty{display:list-item}
  176.                     /* Pager */
  177.                     .whr-filter-pager{
  178.                         display:flex;align-items:center;justify-content:center;gap:8px;
  179.                         padding:4px;
  180.                     }
  181.                     .whr-filter-pager-btn{
  182.                         display:inline-flex;align-items:center;justify-content:center;
  183.                         width:26px;height:26px;
  184.                         background:transparent;border:1px solid rgba(108,58,237,.25);border-radius:8px;
  185.                         color:var(--theme-color,#6C3AED);
  186.                         font-family:inherit;cursor:pointer;
  187.                         transition:background .15s,border-color .15s,opacity .15s
  188.                     }
  189.                     .whr-filter-pager-btn:hover:not(:disabled){background:#F5F3FF;border-color:var(--theme-color,#6C3AED)}
  190.                     .whr-filter-pager-btn:disabled{opacity:.35;cursor:not-allowed}
  191.                     .whr-filter-pager-btn svg{width:12px;height:12px}
  192.                     .whr-filter-pager-info{
  193.                         font-size:11.5px;font-weight:600;color:#6B7280;
  194.                         min-width:36px;text-align:center;letter-spacing:.02em
  195.                     }
  196.                     .whr-filter-pager-current{color:var(--theme-color,#6C3AED)}
  197.                     /* Quand la recherche est active, on cache le pager (l'utilisateur voit déjà tous les matches) */
  198.                     .whr-filter-section.is-searching .whr-filter-pager-wrap{display:none}
  199.                 </style>
  200.                 <script>
  201.                     (function(){
  202.                         'use strict';
  203.                         function whrSlug(s){
  204.                             if(!s) return '';
  205.                             var t = String(s);
  206.                             t = t.normalize ? t.normalize('NFD').replace(/[\u0300-\u036f]/g, '') : t;
  207.                             return t.toLowerCase().trim();
  208.                         }
  209.                         document.querySelectorAll('.whr-filter-section').forEach(function(section){
  210.                             var pageSize = parseInt(section.getAttribute('data-page-size'), 10) || 5;
  211.                             var list = section.querySelector('.whr-filter-list');
  212.                             if(!list) return;
  213.                             var items = section.querySelectorAll('.whr-filter-item');
  214.                             var input = section.querySelector('.whr-filter-search-input');
  215.                             var pagerWrap = section.querySelector('.whr-filter-pager');
  216.                             var prevBtn = section.querySelector('.whr-filter-pager-prev');
  217.                             var nextBtn = section.querySelector('.whr-filter-pager-next');
  218.                             var currentSpan = section.querySelector('.whr-filter-pager-current');
  219.                             var totalSpan = section.querySelector('.whr-filter-pager-total');
  220.                             var total = items.length;
  221.                             var totalPages = Math.max(1, Math.ceil(total / pageSize));
  222.                             var currentPage = 1;
  223.                             function renderPage(){
  224.                                 var startIdx = (currentPage - 1) * pageSize;
  225.                                 var endIdx = startIdx + pageSize;
  226.                                 items.forEach(function(it, i){
  227.                                     it.style.display = (i >= startIdx && i < endIdx) ? '' : 'none';
  228.                                 });
  229.                                 if(currentSpan) currentSpan.textContent = currentPage;
  230.                                 if(prevBtn) prevBtn.disabled = (currentPage <= 1);
  231.                                 if(nextBtn) nextBtn.disabled = (currentPage >= totalPages);
  232.                                 list.classList.remove('is-empty');
  233.                             }
  234.                             function applySearch(query){
  235.                                 var q = whrSlug(query || '');
  236.                                 if(!q){
  237.                                     section.classList.remove('is-searching');
  238.                                     renderPage();
  239.                                     return;
  240.                                 }
  241.                                 section.classList.add('is-searching');
  242.                                 var visibleCount = 0;
  243.                                 items.forEach(function(it){
  244.                                     var label = it.getAttribute('data-filter-label') || '';
  245.                                     var matches = whrSlug(label).indexOf(q) !== -1;
  246.                                     it.style.display = matches ? '' : 'none';
  247.                                     if(matches) visibleCount++;
  248.                                 });
  249.                                 if(visibleCount === 0){
  250.                                     list.classList.add('is-empty');
  251.                                 } else {
  252.                                     list.classList.remove('is-empty');
  253.                                 }
  254.                             }
  255.                             if(prevBtn){
  256.                                 prevBtn.addEventListener('click', function(){
  257.                                     if(currentPage > 1){ currentPage--; renderPage(); }
  258.                                 });
  259.                             }
  260.                             if(nextBtn){
  261.                                 nextBtn.addEventListener('click', function(){
  262.                                     if(currentPage < totalPages){ currentPage++; renderPage(); }
  263.                                 });
  264.                             }
  265.                             if(input){
  266.                                 input.addEventListener('input', function(){
  267.                                     applySearch(input.value);
  268.                                 });
  269.                             }
  270.                             // Init
  271.                             renderPage();
  272.                         });
  273.                     })();
  274.                 </script>
  275.             {% endif %}
  276.             <div class="nav-wrap bg-white bg-transparent-card rounded-xxl shadow-xss pt-3 pb-1">
  277.                 <div class="nav-caption fw-600 font-xssss text-grey-500"><span></span>{{ 'sidebar.account'|trans({}, 'whr-public') }}</div>
  278.                 <ul class="mb-1">
  279.                     <li class="logo d-none d-xl-block d-lg-block"></li>
  280.                     {% if connectUser %}
  281.                         {% if isCandidateUser %}
  282.                             <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>
  283.                             {% if app.user.first == 0 %}
  284.                                 <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>
  285.                             {% endif %}
  286.                         {% else %}
  287.                             <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>
  288.                             <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>
  289.                             <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>
  290.                         {% endif %}
  291.                         {% if is_granted("ROLE_SUPER_ADMIN") %}
  292.                             <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>
  293.                         {% endif %}
  294.                         <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>
  295.                     {% else %}
  296.                         <li>
  297.                             <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">
  298.                                 <i class="font-sm feather-log-in me-3 text-grey-500"></i>
  299.                                 <span>{{ 'sidebar.signin'|trans({}, 'whr-public') }}</span>
  300.                             </a>
  301.                         </li>
  302.                         <li>
  303.                             <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">
  304.                                 <i class="font-sm feather-user-plus me-3 text-grey-500"></i>
  305.                                 <span>{{ 'sidebar.signup'|trans({}, 'whr-public') }}</span>
  306.                             </a>
  307.                         </li>
  308.                     {% endif %}
  309.                 </ul>
  310.             </div>
  311.         </div>
  312.     </div>
  313. </nav>