templates/pages/job/job_single.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{% endblock %}
  3. {% block body %}
  4.     {% include ("pages/job/header.html.twig") %}
  5.     <script type="application/ld+json">
  6.     {
  7.       "@type" : "JobPosting",
  8.       "title" : "{{ data[0]["specialite"] }}",
  9.       
  10.       "description" : "{{ data[0]['infoPratique'] | escape  }} ",
  11.       
  12.       "datePosted" : "{{ data[0]["createAt"]['date'] | date('d-m-Y') }}",
  13.       "hiringOrganization" : {
  14.         "@type" : "Organization",
  15.         "name" : "Réseau Médical Service",
  16.         "sameAs" : "https://reseaumedical.fr/",
  17.         "logo" : "http://img.mailinblue.com/2078301/images/rnb/original/5c20a51c5fb5f9000e5a5a1d.jpg"
  18.       },
  19.       "jobLocation": {
  20.         "@type": "Place",
  21.         "address": {
  22.         "@type": "PostalAddress",
  23.         "streetAddress": "{{ data[0]["departement"] }}",
  24.         "addressRegion": "{{ data[0]["departement"] }}",
  25.         "postalCode": "{{ data[0]["numeroDepartement"] }}",
  26.         "addressCountry": "FR"
  27.         }
  28.       }
  29.     }
  30.     </script>
  31.     <section class="ftco-section ftco-degree-bg" style="color : black ">
  32.         <div class="container">
  33.             <div class="row">
  34.                 <div class="col-md-7 ftco-animate">
  35.                     <span class="subadge">Intérim</span>
  36.                     <h1>{{ data[0]["specialite"] }}</h1>
  37.                     <div class="tagcloud mb-3">
  38.                         <a href="#" class="tag-cloud-link">
  39.                             <span class="icon-my_location"></span>&ensp; {{ data[0]["departement"] }} {{ data[0]["numeroDepartement"] }}
  40.                         </a>
  41.                         <a href="#" class="tag-cloud-link">{{ data| length }} Date(s)</a>
  42.                         <a href="#" class="tag-cloud-link">
  43.                             <span class="icon-date_range"></span>
  44.                             Publié {{ data[0]["createAt"]['date'] | date('d-m-Y') }}
  45.                         </a>
  46.                     </div>{{ data[0]["infoPratique"] | raw }}
  47.                 </div> <!-- .col-md-8 -->
  48.                 <div class="col-md-5 pl-md-5 sidebar ftco-animate">
  49.                     <div class="sidebar-box ftco-animate">
  50.                         <div class="categories" data-spy="scroll" data-offset="0">
  51.                             <h3 class="heading-3">Date à Pourvoir </h3>
  52.                             {% for period  in periods %}
  53.                                 {% if (period|length) == 1 %}
  54.                                     <li style="font-size: 14px"><a href="#">{{ period[0]["jour"] | date('d-m-Y') }}
  55.                                             <span>{{ period[0]["designation"] }}</span></a></li>
  56.                                 {% else %}
  57.                                     <li style="font-size: 14px"><a href="#">Du {{ period[0]["jour"] | date('d-m-Y') }}
  58.                                             au {{ period[(period|length)-1]["jour"] | date('d-m-Y') }}
  59.                                             <span>{{ period[0]["designation"] }}</span></a></li>
  60.                                 {% endif %}
  61.                             {% endfor %}
  62.                         </div>
  63.                     </div>
  64.                     <div class="row">
  65.                         <div class="col-6">
  66.                             <button class="btn btn-secondary" data-toggle="modal" data-target="#modalMaintenance"
  67.                                     style="font-size: 14px">Postuler avec Myrms
  68.                             </button>
  69.                         </div>
  70.                         <div class="col-6">
  71.                             <button class="btn btn-primary py-2" data-toggle="modal" data-target="#modalCandidatureCV"
  72.                                     style="font-size: 14px">Postuler avec votre Cv
  73.                             </button>
  74.                         </div>
  75.                     </div>
  76.                     <div class="sidebar-box ftco-animate">
  77.                         <h3 class="heading-3">Partager</h3>
  78.                         <ul class="ftco-footer-social list-unstyled float-md-left float-lft mt-3">
  79.                             <li class="ftco-animate"><a
  80.                                         href="https://twitter.com/intent/tweet?url={{ url('app_job_single', {'refererence':data[0]['reference'] }) }}&text=Regardez cette offre de Réseau Médical Services!"
  81.                                         target="_blank"><span class="icon-twitter"></span></a></li>
  82.                             <li class="ftco-animate"><a
  83.                                         href="https://www.linkedin.com/shareArticle?mini=true&url={{ url('app_job_single', {'refererence':data[0]['reference'] }) }}"
  84.                                         target="_blank"><span class="icon-linkedin"></span></a></li>
  85.                             <li class="ftco-animate"><a
  86.                                         href="https://www.facebook.com/sharer/sharer.php?u={{ url('app_job_single', {'refererence':data[0]['reference'] }) }}"
  87.                                         target="_blank"><span class="icon-facebook"></span></a></li>
  88.                         </ul>
  89.                     </div>
  90.                 </div>
  91.             </div>
  92.         </div>
  93.     </section> <!-- .section -->
  94.     <!-- Modal candidature cv -->
  95.     <div class="modal fade" id="modalCandidatureCV" tabindex="-1" role="dialog" aria-labelledby="modalCandidatureCV"
  96.          aria-hidden="true">
  97.         <div class="modal-dialog modal-dialog-centered" role="document">
  98.             <div class="modal-content">
  99.                 <div class="modal-header">
  100.                     <h5 class="modal-title" id="modalCandidatureCV">Postuler pour cette Offre</h5>
  101.                     <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  102.                         <span aria-hidden="true">&times;</span>
  103.                     </button>
  104.                 </div>
  105.                 <div class="modal-body">
  106.                     <div class="container-fluid">
  107.                         {% include ('pages/candidature/candidature_cv.html.twig') %}
  108.                     </div>
  109.                 </div>
  110.                 <div class="modal-footer">
  111.                     {#          <button type="button" class="btn btn-secondary">Candidature avec Myrms</button>#}
  112.                     {#          <a href="{{ path('app_candidature_cv',{reference:data[0]['reference']}) }}" type="button" class="btn btn-primary">Candidature avec Cv</a>#}
  113.                 </div>
  114.             </div>
  115.         </div>
  116.     </div>
  117.         <div class="modal fade" id="modalMaintenance" tabindex="-1" role="dialog" aria-labelledby="modalMaintenance"
  118.          aria-hidden="true">
  119.         <div class="modal-dialog modal-dialog-centered" role="document">
  120.             <div class="modal-content">
  121.                 <div class="modal-header">
  122.                     <h5 class="modal-title" id="modalMaintenance">Postuler pour cette Offre</h5>
  123.                     <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  124.                         <span aria-hidden="true">&times;</span>
  125.                     </button>
  126.                 </div>
  127.                 <div class="modal-body">
  128.                     <div class="container-fluid">
  129.                        <h2>Espace MyRMS en Maintenance</h2>
  130.                         <h5>Nous sommes désolés, veillez postuler directement avec votre CV.</h5>
  131.                     </div>
  132.                 </div>
  133.                 <div class="modal-footer">
  134.                     {#          <button type="button" class="btn btn-secondary">Candidature avec Myrms</button>#}
  135.                     {#          <a href="{{ path('app_candidature_cv',{reference:data[0]['reference']}) }}" type="button" class="btn btn-primary">Candidature avec Cv</a>#}
  136.                 </div>
  137.             </div>
  138.         </div>
  139.     </div>
  140.     <!-- Modal candidature MyRMS -->
  141.      <div class="modal fade" id="modalCandidatureMyRMS" tabindex="-1" role="dialog"
  142.          aria-labelledby="modalCandidatureMyRMS" aria-hidden="true">
  143.         <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
  144.             <div class="modal-content">
  145.                 <div class="modal-header">
  146.                     <h5 class="modal-title" id="modalCandidatureMyRMS">Postuler pour cette Offre</h5>
  147.                     <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  148.                         <span aria-hidden="true">&times;</span>
  149.                     </button>
  150.                 </div>
  151.                 <div class="modal-body">
  152.                     <div class="container-fluid">
  153.                     <div id = "candidatureMyRMS">
  154.                         <h2>Espace MyRMS en Maintenance</h2>
  155.                         <h5>Nous sommes désolés, veillez postuler directement avec votre CV.</h5>
  156.                 {#<div id="checkbox-container"></div>
  157.                 <div class="pagination">
  158.                 <button id="prev-btn" disabled>Précédent</button>
  159.                 <span id="page-counter">Page 1</span>
  160.                 <button id="next-btn">Suivant</button>
  161.                 </div>
  162.                 <div id="data-container" data-data="{{ data|json_encode }}"></div>
  163.                 <script>
  164.                      var dataFromServer = JSON.parse(document.getElementById("data-container").getAttribute("data-data"));
  165.                     var taille_data = dataFromServer.length;
  166.                     var n_page =  Math.floor(taille_data / 12) + 1;
  167.                     const checkboxContainer = document.getElementById("checkbox-container");
  168.                     const prevButton = document.getElementById("prev-btn");
  169.                     const nextButton = document.getElementById("next-btn");
  170.                     const pageCounter = document.getElementById("page-counter");
  171.  
  172.                     const totalPages = n_page ; // le nombre total de pages
  173.                     let currentPage = 1;
  174.                     function formatDateFromString(dateString) {
  175.                         const parts = dateString.split(' ');
  176.                         const datePart = parts[0];
  177.                         const timePart = parts[1];
  178.   
  179.                         const dateComponents = datePart.split('-');
  180.                         const year = parseInt(dateComponents[0]);
  181.                         const month = parseInt(dateComponents[1]) - 1; 
  182.                         const day = parseInt(dateComponents[2]);
  183.                         const timeComponents = timePart.split(':');
  184.                         const hour = parseInt(timeComponents[0]);
  185.                         const minute = parseInt(timeComponents[1]);
  186.                         const second = parseInt(timeComponents[2]);
  187.   
  188.                         return new Date(year, month, day, hour, minute, second);
  189.                     }
  190.                     function formatDate(date) {
  191.                         const day = String(date.getDate()).padStart(2, '0');
  192.                         const month = String(date.getMonth() + 1).padStart(2, '0');
  193.                         const year = date.getFullYear();
  194.   
  195.                         return `${day}-${month}-${year}`;
  196.                     }
  197.  
  198.                     function updatePaginationButtons() {
  199.                         prevButton.disabled = currentPage === 1;
  200.                         nextButton.disabled = currentPage === totalPages;
  201.                         pageCounter.textContent = `Page ${currentPage}`;
  202.                     }
  203.  
  204.                     function createCheckboxes(page) {
  205.                         checkboxContainer.innerHTML = "";
  206.                     
  207.                         const startIndex = (page - 1) * 12;
  208.                         const endIndex = Math.min(taille_data, startIndex + 12, totalPages * 12);
  209.             
  210.                         const table = document.createElement("table");
  211.                         table.classList.add("table-paginated");
  212.                         
  213.                         const row1 = document.createElement("tr");
  214.                         const titre1 = document.createElement("th");
  215.                         const titre2 = document.createElement("th");
  216.                         const titre3 = document.createElement("th");
  217.                         const titre4 = document.createElement("th");
  218.                         const titre5 = document.createElement("th");
  219.                         const titre6 = document.createElement("th");
  220.             
  221.                         titre1.textContent = `#`;
  222.                         titre2.textContent = ` `;
  223.                         titre3.textContent = `Date`;
  224.                         titre4.textContent = `Libelle`;
  225.                         titre5.textContent = `Debut`;
  226.                         titre6.textContent = `Fin`;
  227.                         row1.appendChild(titre1);
  228.                         row1.appendChild(titre2);
  229.                         row1.appendChild(titre3);
  230.                         row1.appendChild(titre4);
  231.                         row1.appendChild(titre5);
  232.                         row1.appendChild(titre6);
  233.                         table.appendChild(row1);
  234.                         for (let i = startIndex; i < endIndex; i++) {
  235.                 
  236.                             const row = document.createElement("tr");
  237.                             const content1Cell = document.createElement("td");
  238.                             content1Cell.textContent = i+1;
  239.                 
  240.                             const checkboxCell = document.createElement("td");
  241.                             const checkbox = document.createElement("input");
  242.                             checkbox.type = "checkbox";
  243.                             checkboxCell.appendChild(checkbox);
  244.                             const content2Cell = document.createElement("td");
  245.                             const inputDate = formatDateFromString(dataFromServer[i]["date"]["date"]);
  246.                             const formattedDate = formatDate(inputDate);
  247.                             content2Cell.textContent = formattedDate;
  248.                             const content3Cell = document.createElement("td");
  249.                             content3Cell.textContent = dataFromServer[i]["designation"];
  250.                             const content4Cell = document.createElement("td");
  251.                             content4Cell.textContent = `...`;
  252.                             const content5Cell = document.createElement("td");
  253.                             content5Cell.textContent = `...`;
  254.                 
  255.                 
  256.                             row.appendChild(content1Cell);
  257.                             row.appendChild(checkboxCell);
  258.                             row.appendChild(content2Cell);
  259.                             row.appendChild(content3Cell);
  260.                             row.appendChild(content4Cell);
  261.                             row.appendChild(content5Cell);
  262.             
  263.                             table.appendChild(row);
  264.                         }
  265.         
  266.                     checkboxContainer.appendChild(table);
  267.                     updatePaginationButtons();
  268.                 }
  269.                 prevButton.addEventListener("click", () => {
  270.                         if (currentPage > 1) {
  271.                             currentPage--;
  272.                             createCheckboxes(currentPage);
  273.                         }
  274.                 });
  275.  
  276.                 nextButton.addEventListener("click", () => {
  277.                     if (currentPage < totalPages) {
  278.                         currentPage++;
  279.                         createCheckboxes(currentPage);
  280.                     }
  281.                 });
  282.  
  283.                 // Initialiser la pagination avec la première page
  284.                 createCheckboxes(currentPage);
  285.                 </script>
  286.                         <br>
  287.                         <div class="form-check  mb-4">
  288.                         <input class="form-check-input"  v-model="cgu" required type="checkbox" value="" id="flexCheckDefault" />
  289.                         <label class="form-check-label" for="flexCheckDefault">J'ai lu et j'accepte les Conditions Générales d'Utilisation, notamment la mention relative à la protection des données personnelles.<a href="{{ url('app_r_g_p_d') }}">(CGU)</a></label>
  290.                         </div>
  291.                             <!-- Submit button -->
  292.                             <button type="submit"  class="btn btn-primary btn-block mb-3">Soumettre</button>
  293.                         </form>
  294.                     </div>
  295.                 </div>
  296.                 </div>
  297.                 <div class="modal-footer">#}
  298.                     {#          <button type="button" class="btn btn-secondary">Candidature avec Myrms</button>#}
  299.                     {#          <a href="{{ path('app_candidature_cv',{reference:data[0]['reference']}) }}" type="button" class="btn btn-primary">Candidature avec Cv</a>#}
  300.                 {#</div>#}
  301.             </div>
  302.         </div>
  303.     </div> 
  304.     
  305.     
  306. {% endblock %}