templates/backend/advanced_search/partials/_adv_search_entreprise_results.html.twig line 1

Open in your IDE?
  1. {# @var \App\Entity\Entreprise entity #}
  2. <div class="mt-2">
  3.     {% include 'backend/partials/_table_result_header.html.twig' with {
  4.         entityName: 'Entreprise(s)',
  5.         count: advancedSearchResults.getTotalItemCount,
  6.         showExportButtons: searchParams.is_exportable,
  7.         buttons: [{
  8.             display: is_granted('ROLE_ADD_ENTITY') ? true : false,
  9.             url: path('create_enterprise'),
  10.             class: 'btn btn-sm btn-success',
  11.             icon: 'fas fa-plus',
  12.             label: 'Ajouter'
  13.         }]
  14.     } %}
  15.     <div class="table-responsive">
  16.         <table class="table" id="table-result">
  17.             <thead>
  18.                 <tr>
  19.                     <th>Raison Sociale</th>
  20.                     <th>Type</th>
  21.                     <th>Adhésion</th>
  22.                     <th>Département</th>
  23.                     <th>Région</th>
  24.                     <th>Code postal</th>
  25.                     <th>Commune/Ville</th>
  26.                     <th>Syndicat de rattachement</th>
  27.                     <th>Région de rattachement</th>
  28.                     <th>Date cessation</th>
  29.                     <th>#</th>
  30.                     <th class="text-center">Actions</th>
  31.                 </tr>
  32.             </thead>
  33.             <tbody>
  34.                 {% for key, entity in advancedSearchResults %}
  35.                     <tr>
  36.                         <td>
  37.                             <a href="{{ path('show_entreprise', {'id': entity.id }) }}">
  38.                                 {{ entity.raisonSocial|upper }}
  39.                             </a>
  40.                         </td>
  41.                         <td>{{ entity.firmType ? entity.firmType.name }}</td>
  42.                         <td>
  43.                             <span class="mx-2 badge bg-{{ entity.isMember ? 'success' : 'danger' }} p-2">
  44.                                 {{ (entity.isMember ? 'adhésion payée' : 'adhésion non payée')|upper }}
  45.                             </span>
  46.                         </td>
  47.                         <td>
  48.                             {% if entity.departement %}
  49.                                 {{ entity.departement.nom }}
  50.                             {% endif %}
  51.                         </td>
  52.                         <td>
  53.                             {{ entity.departement is not null and entity.departement.regions is not null ? entity.departement.regions.first.nom : '' }}
  54.                             {#
  55.                                 {{ entity.homeRegion ? entity.homeRegion.nom : '' }}
  56.                                 {% if entity.departement %}
  57.                                     {% for region in entity.departement.regions %}
  58.                                         {{ region.nom }}
  59.                                     {% endfor %}
  60.                                 {% endif %}
  61.                             #}
  62.                         </td>
  63.                         <td>
  64.                             {% if entity.codePostal %}
  65.                                 {{ entity.codePostal }}
  66.                             {% endif %}
  67.                         </td>
  68.                         <td>
  69.                             {% if entity.ville %}
  70.                                 {{ entity.ville }}
  71.                             {% endif %}
  72.                         </td>
  73.                         <td>
  74.                             {% if entity.syndicat %}
  75.                                 {{ entity.syndicat.nom }}
  76.                             {% endif %}
  77.                         </td>
  78.                         <td>{{ entity.homeRegion ? entity.homeRegion.nom : '' }}</td>
  79.                         <td>{{ entity.dateCessation ? entity.dateCessation|date('d/m/Y') }}</td>
  80.                         <td>{{ entity.id }}</td>
  81.                         <td class="text-center">
  82.                             <button class="btn btn-outline-secondary btn-icon btn-rounded dropdown-toggle custom-dropdown" type="button" id="dropdownMenu_{{ key }}" data-bs-toggle="dropdown" aria-expanded="false">
  83.                                 <i class="fa-solid fa-ellipsis"></i>
  84.                             </button>
  85.                             <ul class="dropdown-menu" aria-labelledby="dropdownMenu_{{ key }}">
  86.                                 <li>
  87.                                     <a class="dropdown-item" href="{{ path('show_entreprise', {'id': entity.id }) }}">
  88.                                         <i class="fas fa-eye"></i> Consulter
  89.                                     </a>
  90.                                 </li>
  91.                                 {% if is_granted('ROLE_UPDATE_ENTITY') %}
  92.                                     <li>
  93.                                         <a class="dropdown-item" href="{{ path('edit_entreprise', {'id': entity.id }) }}">
  94.                                             <i class="fas fa-edit"></i> Editer
  95.                                         </a>
  96.                                     </li>
  97.                                 {% endif %}
  98.                                 {% if is_granted('ROLE_DELETE_ENTITY') %}
  99.                                     <li>
  100.                                         <a
  101.                                                 class="dropdown-item"
  102.                                                 href="#"
  103.                                                 data-controller="confirm-delete"
  104.                                                 data-confirm-delete-url-value="{{ path('archive_enterprise', {id: entity.id}) }}"
  105.                                                 data-confirm-delete-message-value="Etes-vous sûr de vouloir archiver cet entreprise ?"
  106.                                                 data-confirm-delete-token-value="{{ csrf_token('entreprise_' ~ entity.id) }}"
  107.                                                 data-confirm-delete-action-value="reload"
  108.                                         >
  109.                                             <i class="fas fa-archive"></i> Archiver
  110.                                         </a>
  111.                                     </li>
  112.                                 {% endif %}
  113.                             </ul>
  114.                         </td>
  115.                     </tr>
  116.                 {% endfor %}
  117.             </tbody>
  118.         </table>
  119.         <div class="navigation mt-4 text-end">
  120.             {{ knp_pagination_render(advancedSearchResults) }}
  121.         </div>
  122.     </div>
  123. </div>