parametres_applications.html 33 lignes · 2332 octets
{% import "components/badge.html" as badge %}
{% import "components/bouton.html" as b %}
{# E023-C1 — tableau des applications (fragment #applications) #}
<div id="applications"{% if oob %} hx-swap-oob="true"{% endif %} class="flex flex-col gap-sm">
  {% if applications.is_empty() %}
  <p class="rounded-sm bg-muted p-md text-sm text-muted-foreground">Aucune application pour l'instant : le portail s'installe sans.</p>
  {% else %}
  <div class="overflow-x-auto" tabindex="0" aria-label="Tableau des applications">
    <table class="w-full text-sm text-foreground">
      <thead><tr class="text-left text-xs text-muted-foreground"><th class="px-sm py-xs">Application</th><th class="px-sm py-xs">Protocole</th><th class="px-sm py-xs">Redirections, métadonnées ou service</th><th class="px-sm py-xs"><span class="sr-only">Actions</span></th></tr></thead>
      <tbody>
        {% for a in applications %}
        <tr class="border-t border-card-border align-top" id="application-{{ a.identifiant }}">
          <td class="px-sm py-sm">{{ a.nom }} <span class="block font-mono text-xs text-muted-foreground">{{ a.identifiant }}</span></td>
          <td class="px-sm py-sm">{% call badge::badge("neutre", a.protocole) %}{% endcall %}</td>
          <td class="px-sm py-sm break-all font-mono text-xs">{{ a.detail }}</td>
          <td class="px-sm py-sm">
            {% if !fige %}
            <div class="flex flex-wrap gap-xs">
              <button type="button" class="{% call b::classes("outline") %}{% endcall %} h-8 px-sm text-xs" x-data="ouvreDialogue" data-dialogue="dialogue-application" x-on:click="ouvrir"
                      hx-get="/install/parametres/lemonldap/applications/{{ a.identifiant }}" hx-target="#dialogue-application-corps" hx-swap="innerHTML">Modifier<span class="sr-only"> {{ a.nom }}</span></button>
              <button type="button" class="{% call b::classes("icone") %}{% endcall %}" hx-delete="/install/parametres/lemonldap/applications/{{ a.identifiant }}" hx-target="#applications" hx-swap="outerHTML"
                      hx-confirm="Retirer {{ a.nom }} ?" aria-label="Retirer {{ a.nom }}"><span aria-hidden="true">🗑</span></button>
            </div>
            {% endif %}
          </td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
  </div>
  {% endif %}
</div>