templates/ecommerce/profile/team-list-roles.html.twig line 1

Open in your IDE?
  1. {% for role in roles %}
  2.     <div class="card shadow-sm mb-3">
  3.         <div class="card-body">
  4.             <h5 class="card-title">
  5.                 {{ role.name }}
  6.                 {% if not role.notRemovable %}
  7.                     <button class="btn btn-sm btn-danger float-end" onclick="deleteRole('{{ role.id }}')">
  8.                         <i class="bi bi-x"></i> <!-- Icone Bootstrap de croix -->
  9.                     </button>
  10.                 {% endif %}
  11.             </h5>
  12.             <p class="card-text">
  13.                 <strong>Actions autorisées :</strong><br>
  14.             <ul class="list-group">
  15.                 {% for action in role.rolesAuthorizedActions %}
  16.                     {% if not action.deleted %}
  17.                         <li class="list-group-item d-flex justify-content-between align-items-center">
  18.                             <span>{{ action.authorizedAction.name }}</span>
  19.                             <button class="btn btn-sm btn-danger" onclick="deleteAction('{{ action.id }}')">
  20.                                 <i class="bi bi-x"></i> <!-- Icone Bootstrap de croix -->
  21.                             </button>
  22.                         </li>
  23.                     {% endif %}
  24.                 {% else %}
  25.                     <span class="text-muted">Aucune action autorisée</span>
  26.                 {% endfor %}
  27.                 </li>
  28.             </ul>
  29.             </p>
  30.             <button class="btn btn-sm btn-primary" onclick="$('#listofActions{{ role.id }}').toggle()">
  31.                 <i class="bi bi-plus"></i> Ajouter une action
  32.             </button>
  33.             <div id="listofActions{{ role.id }}" style="display:none">
  34.                 {% for action in actions %}
  35.                     <li class="list-group-item d-flex justify-content-between align-items-center mt-2">
  36.                         <span>{{ action.name }}</span>
  37.                         <a onclick="editAuthorizedAction({{ role.id }}, {{ action.id }})" class="btn btn-sm btn-success">
  38.                             <i class="bi bi-plus"></i> Ajouter
  39.                         </a>
  40.                     </li>
  41.                 {% endfor %}
  42.             </div>
  43.         </div>
  44.     </div>
  45. {% endfor %}