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