composants.html
51 lignes · 3758 octets
{% import "components/actions.html" as a %} {# E-004 Composants #} <form id="form-composants" class="grid gap-xl lg:grid-cols-3" hx-post="{{ action }}" hx-target="this" hx-swap="outerHTML" hx-disabled-elt="find button[type=submit]" hx-disinherit="hx-disabled-elt hx-target hx-swap" novalidate> <div class="flex flex-col gap-xl lg:col-span-2" hx-post="/install/composants/resolution" hx-trigger="change" hx-target="#form-composants" hx-swap="outerHTML" hx-include="closest form"> {% if !erreurs.is_empty() %} <div class="border-l-4 border-l-error bg-error-bg p-md text-sm text-foreground" role="alert"> {% for e in erreurs %}<p>{{ e }}</p>{% endfor %} </div> {% endif %} {% for groupe in groupes %} <fieldset class="flex flex-col gap-sm"> <legend class="text-lg text-foreground">{{ groupe.libelle }}</legend> <div class="grid gap-md md:grid-cols-2"> {% for c in groupe.composants %} <label class="relative flex flex-col gap-xs rounded-sm border bg-background p-xl {% if c.jalon.is_some() %}cursor-not-allowed border-dashed border-dashed-border{% else if c.verrouille %}border-transparent p-[23px] ring-2 ring-primary{% else %}cursor-pointer border-card-border has-checked:border-transparent has-checked:p-[23px] has-checked:ring-2 has-checked:ring-primary{% endif %} has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ring"> <span class="flex items-start gap-sm"> <input type="checkbox" id="composant-{{ c.cle }}" name="composants" value="{{ c.cle }}"{% if c.jalon.is_some() || c.verrouille %} disabled{% endif %}{% if c.coche %} checked{% endif %} class="mt-xxs size-4 shrink-0 accent-primary" aria-describedby="desc-{{ c.cle }}"> {# Évolution : un composant installé est renvoyé tel quel, la case désactivée ne l'étant pas. #} {% if c.installe %}<input type="hidden" name="composants" value="{{ c.cle }}">{% endif %} <span class="text-md text-title-ink">{{ c.nom }}</span> </span> <span id="desc-{{ c.cle }}" class="pl-xl text-sm text-muted-foreground">{{ c.description }} {% if let Some(jalon) = c.jalon %}<span class="mt-xxs block text-xs text-warning">Jalon {{ jalon }} — pas encore disponible</span>{% endif %} {% if c.installe %}<span class="mt-xxs block text-xs text-muted-foreground">Déjà installé</span>{% else %} {% if c.ajoute %}<span class="mt-xxs block text-xs text-info">Ajouté par cette évolution</span>{% endif %} {% if !c.requis_par.is_empty() %}<span class="mt-xxs block text-xs text-ink-secondary">Requis par : {{ c.requis_par }}</span>{% endif %} {% for raison in c.raisons %}<span class="mt-xxs block text-xs text-ink-secondary">{{ raison }}</span>{% endfor %} {% if c.verrouille && c.requis_par.is_empty() %}<span class="mt-xxs block text-xs text-ink-secondary">Toujours installé</span>{% endif %} {% endif %} </span> </label> {% endfor %} </div> </fieldset> {% endfor %} </div> <aside class="lg:sticky lg:top-20 lg:self-start"> <div class="rounded-sm bg-muted p-md text-sm text-graphite" aria-live="polite"> <h2 class="text-md text-title-ink">Ressources estimées</h2> <dl class="mt-sm grid grid-cols-2 gap-xs"> <dt>Mémoire</dt><dd class="text-right tabular-nums text-foreground">{{ ram_mo }} Mo</dd> <dt>Disque</dt><dd class="text-right tabular-nums text-foreground">{{ disque_go }} Go</dd> </dl> </div> </aside> <div class="lg:col-span-3">{% call a::actions(precedent) %}{% endcall %}</div> </form>
GitRust