templates/home/listoffer.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Hello PagesController!{% endblock %}
  3. {% block body %}
  4.     <div class="container p-30">
  5.         <div class="row">
  6.             <div class="col-md-12 main-datatable">
  7.                 <div class="card_body">
  8.                     <div class="row d-flex">
  9.                         {% if is_granted('ROLE_ADMIN_STRUCTURE') or is_granted('ROLE_SUPER_ADMIN') %}
  10.                         <div class="col-sm-4 createSegment">
  11.                             <a class="btn dim_button create_new" href="{{ path('app_upload') }}"> <i
  12.                                         class="fa fa-plus"></i> Ajouter une nouvelle offre</a>
  13.                         </div>
  14.                         {% endif %}
  15.                         <div class="col-sm-8 add_flex">
  16.                             <div class="form-group searchInput">
  17.                                 <label for="email">Rechercher:</label>
  18.                                 <input type="search" class="form-control" id="filterbox" placeholder=" ">
  19.                             </div>
  20.                         </div>
  21.                     </div>
  22.                     <div class="overflow-x">
  23.                         <table style="width:100%;" id="filtertable" class="table cust-datatable dataTable no-footer ">
  24.                             <thead>
  25.                             <th style="min-width:150px;">Consulter l'offre</th>
  26.                             <th style="min-width:150px;">Titre de l'offre</th>
  27.                             <th style="min-width:150px;">Nom de la structure</th>
  28.                             <th style="min-width:150px;">Description de l'offre</th>
  29.                             <th style="min-width:100px;">Catégorie de l'offre</th>
  30.                             <th style="min-width:100px;">Date de publication</th>
  31.                             <th style="min-width:150px;">Localisation</th>
  32.                             {% if is_granted('ROLE_ADMIN_STRUCTURE') or is_granted('ROLE_SUPER_ADMIN') %}
  33.                                 <th style="min-width:150px;">Action</th>
  34.                             {% endif %}
  35.                             </thead>
  36.                             <tbody>
  37.                             {% for offer in offer %}
  38.                                 {% if offer.statut == 'Initial' %}
  39.                                     <tr>
  40.                                     <td>
  41.                                         <div class="btn-group consult">
  42.                                             <abbr title="Consulter"><a
  43.                                                         href="{{ path ('app_candidature',{id : offer.id}) }}">
  44.                                                     <button id="offerVue">Voir l'offre</button>
  45.                                                     </a></abbr>
  46.                                         </div>
  47.                                     </td>
  48.                                     <td><b> {{ offer.titre }} </b></td>
  49.                                     <td> {{ offer.nomStructure }} </td>
  50.                                     <td> {{ offer.descriptionPoste }} </td>
  51.                                     <td> {{ offer.categorieContrat }}</td>
  52.                                     <td> {{ offer.datePublication|date("d/m/Y") }} </td>
  53.                                     <td> {{ offer.Localisation }} </td>
  54.                                     {% if  is_granted('ROLE_SUPER_ADMIN') or is_granted('ROLE_ADMIN_STRUCTURE') %}
  55.                                         <td>
  56.                                             <div class="btn-group edit">
  57.                                                 <a href="{{ path('app_modif', {id : offer.id}) }}"><i class="bi bi-pencil-fill"></i></a>
  58.                                             </div>
  59.                                             <div class="btn-group delete">
  60.                                                 <a href="{{ path('app_delete', {id : offer.id}) }}"
  61.                                                    onclick="return confirm('Etes-vous sur de vouloir supprimer cette offre ?')"><i
  62.                                                             class="bi bi-trash-fill"></i></a>
  63.                                             </div>
  64.                                         </td>
  65.                                         </tr>
  66.                                     {% endif %}
  67.                                 {% endif %}
  68.                             {% endfor %}
  69.                             </tbody>
  70.                         </table>
  71.                     </div>
  72.                 </div>
  73.             </div>
  74.         </div>
  75.     </div>
  76.     <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
  77.     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  78.     <script src="https://cdn.datatables.net/1.10.14/js/jquery.dataTables.min.js"></script>
  79.     <script>
  80.         var dataTable = $('#filtertable').DataTable({
  81.             "pageLength": 5,
  82.             "scrollY": 400,
  83.             "scrollX": true,
  84.             "scrollCollapse": true,
  85.             "paging": false,
  86.             'aoColumnDefs': [{
  87.                 'bSortable': true,
  88.                 'aTargets': ['3'],
  89.             }],
  90.             columnDefs: [
  91.                 {type: 'date-dd-mm-yyyy', aTargets: [5]}
  92.             ],
  93.             "aoolumns": [
  94.                 null,
  95.                 null,
  96.                 null,
  97.                 null,
  98.                 null,
  99.                 null,
  100.                 null
  101.             ],
  102.             "order": false,
  103.             "bLengthChange": false,
  104.             "dom": '<"top">ct<"top"p><"clear">'
  105.         });
  106.         $("#filterbox").on('keyup change', function () {
  107.             dataTable.search(this.value).draw();
  108.         });
  109.     </script>
  110. {% endblock %}