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