templates/job_board/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% set extendClass = 'offer-page' %}
  3. {% block page_contents %}
  4. <section class="section section-page-title bg-gradient py-xl-5 py-4" data-aos='fade-down'>
  5.   <div class="container">
  6.     <div class="row">
  7.       <div class="col-12 text-center text-white">
  8.         <h1 class="page-name font-weight-bold my-2">
  9.           {% trans %}Offres d’emploi{% endtrans %}<br/>
  10.           {% trans %}Alternances et stages{% endtrans %}
  11.         </h1>
  12.         <div class='font-weight-bold'>{{ totalJob }} {% trans %}offres{% endtrans %}</div>
  13.       </div>
  14.     </div>
  15.   </div>
  16. </section>
  17. <section class="section section-form section-form-2 mb-2 mt-4">
  18.   <div class="container">
  19.     <div class="row">
  20.       <div class="col-12 mx-auto mb-4" data-aos='fade-up'>
  21.         <div class="offres-search-box py-3 px-xl-5 px-lg-4 px-3">
  22.           <div class="font-20 font-weight-bold mb-3 text-black text-uppercase text-center line-height-normal">{% trans %}RECHERCHEZ UNE OFFRE QUI CORRESPOND AVEC VOTRE PROFIL{% endtrans %}</div>
  23.           
  24.             <form id="filter-form" data-aos='fade-up'>
  25.               <div class="d-flex align-items-lg-start align-items-end">
  26.                 <div class="mr-4 flex-grow-1">
  27.                   <div class="row">
  28.                     <div class="col-lg-4">
  29.                       <div class="form-group">
  30.                         <select data-none-selected-text="{% trans %}Type de contrat{% endtrans %}" class="select-multiple form-control submit-change" name="contract[]" multiple="multiple">
  31.                           {% for contract in contracts %}
  32.                             <option value="{{ contract.id }}">{{ contract.name }}</option>
  33.                           {% endfor %}
  34.                         </select>
  35.                       </div>
  36.                     </div>
  37.                     <div class="col-lg-4">
  38.                       <div class="form-group">
  39.                         <select data-none-selected-text="{% trans %}Domaine/Expertise{% endtrans %}" class="select-multiple form-control submit-change" name="expertise[]" multiple="multiple">
  40.                           {% for expertise in expertises %}
  41.                             <option value="{{ expertise.id }}">{{ expertise.name }}</option>
  42.                           {% endfor %}
  43.                         </select>
  44.                       </div>
  45.                     </div>
  46.                     <div class="col-lg-4">
  47.                       <div class="form-group">
  48.                         <select data-none-selected-text="{% trans %}À proximité du campus{% endtrans %}" class="select-multiple form-control submit-change" name="campuses[]" multiple="multiple">
  49.                           {% for campus in campuses %}
  50.                             <option value="{{ campus.id }}">{{ campus.name }}</option>
  51.                           {% endfor %}
  52.                         </select>
  53.                       </div>
  54.                     </div>
  55.                   </div>
  56.                 </div>
  57.                 <div class="ml-auto">
  58.                   <div class="font-30 cursor mb-lg-0 mb-3" id="clear-filter" title="{% trans %}Annuler toutes les recherches{% endtrans %}" data-toggle="tooltip" data-placement="top"><i class="fa-solid fa-arrows-rotate"></i></div>
  59.                 </div>
  60.               </div>
  61.               <div class="text-dark-purple mb-2">{% trans %}Recherche par compétences{% endtrans %}</div>
  62.               <div class="list-offre-checkbox submit-checkbox">
  63.                 {% for i,skill in skills %}
  64.                 <label class="switch">
  65.                   <input type="checkbox" name="skill[{{ i }}]" value="{{ skill.id }}">
  66.                   <span class="slider">{{ skill.name }}</span>
  67.                 </label>
  68.                 {% endfor %}
  69.               </div>
  70.               <div class="show-all text-center mt-2">
  71.                 <a id="show-all"><i class="fal fa-angles-down bounce"></i></a>
  72.                 <a id="hide-all" style="display: none;"><i class="fal fa-angles-up bounce"></i></a>
  73.               </div>
  74.             </form>
  75.             
  76.         </div>
  77.       </div>
  78.     </div>
  79.   </div>
  80. </section>
  81. <section class="section section-offer mb-4">
  82.   <div class="container">
  83.   
  84.     <div class="row">
  85.       <div class="col-12 mb-4">
  86.         <div class="text-dark-purple" data-aos='fade-up'>(<span id="total-job">{{ totalJob }}</span>) {% trans %}résultat(s) trouvé(s){% endtrans %}</div>
  87.       </div>
  88.     </div>
  89.     <div class="row" id="result-data">
  90.       {% for job in jobs %}
  91.         {% include 'job_board/_item_job.html.twig' %}
  92.       {% endfor %}
  93.     </div>
  94.     
  95.   </div>
  96. </section>
  97. {% endblock %}
  98. {% block custom_javascripts %}
  99. <script src="{{ asset('assets/js/multiselect.js') }}"></script>
  100. <script type="text/javascript">
  101. $(document).ready(function(){
  102.   $('.select-multiple').each(function(){
  103.     var none_text = $(this).attr('data-none-selected-text');
  104.     $(this).multiselect({
  105.       afterSelect: function(values){
  106.         alert("Select value: "+values);
  107.       },
  108.       buttonTextAlignment: 'left',
  109.       nonSelectedText: none_text,
  110.       nSelectedText: '{% trans %}sélectionné(s){% endtrans %}'
  111.     });
  112.   });
  113.   $('.submit-change,.submit-checkbox input').change(function(){
  114.     filterData();
  115.   });
  116.   function filterData(){
  117.     let data = $('#filter-form').serialize(); console.log(data);
  118.     $.ajax({
  119.       url: "{{ path('job.filter') }}",
  120.       type: "POST",
  121.       dataType: 'json',
  122.       data : data,
  123.       success: function(result) {
  124.         $('#result-data').html(result.data);
  125.         $('#total-job').text(result.total);
  126.       }
  127.     }).always(function () {});
  128.   }
  129.   $('#clear-filter').click(function(){
  130.     $('.select-multiple').val('').multiselect('refresh');
  131.     $('.submit-checkbox input').prop('checked', false);
  132.     filterData();
  133.   });
  134. });
  135. </script>
  136. {% endblock %}