chore(dgsi/templates): Split out some partials

This commit is contained in:
Tom Hubrecht 2025-02-02 11:07:06 +01:00
parent fe7bdf5a20
commit e43e42afed
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc
4 changed files with 46 additions and 40 deletions

View file

@ -0,0 +1,31 @@
{% load i18n %}
{% if user.kanidm %}
<h3 class="has-text-weight-bold mb-3">
<span>{% trans "Mot de passe WiFi :" %}</span>
{% if user.kanidm.radius_secret %}
{% trans "Êtes-vous sûr·e de vouloir réinitialiser votre mot de passe WiFi ?" as confirm_wifi_reset %}
<a href="{% url "dgsi:dgn-generate_wifi_password" %}"
class="button is-small is-danger is-pulled-right"
onclick="return confirm('{{ confirm_wifi_reset }}')">
<span class="icon"><i class="ti ti-refresh"></i></span>
<span class="has-text-weight-normal">{% trans "Réinitialiser le mot de passe WiFi" %}</span>
</a>
{% endif %}
</h3>
{% if user.kanidm.radius_secret %}
<div class="buttons has-addons is-flex">
<input id="radius-secret"
data-select
class="button is-primary is-size-4 is-flex-grow-2"
value="{{ user.kanidm.radius_secret }}"
type="password"
readonly />
<a id="secret-toggle" class="button is-size-4 is-warning is-light"><span class="icon"><i class="ti ti-eye"></i></span></a>
</div>
{% else %}
<a href="{% url "dgsi:dgn-generate_wifi_password" %}"
class="button is-fullwidth is-primary is-light is-size-4 block">{% trans "Générer un mot de passe WiFi" %}</a>
{% endif %}
{% endif %}

View file

@ -32,35 +32,7 @@
readonly />
<br>
{% if user.kanidm %}
<h3 class="has-text-weight-bold mb-3">
<span>{% trans "Mot de passe WiFi :" %}</span>
{% if user.kanidm.radius_secret %}
{% trans "Êtes-vous sûr·e de vouloir réinitialiser votre mot de passe WiFi ?" as confirm_wifi_reset %}
<a href="{% url "dgsi:dgn-generate_wifi_password" %}"
class="button is-small is-danger is-pulled-right"
onclick="return confirm('{{ confirm_wifi_reset }}')">
<span class="icon"><i class="ti ti-refresh"></i></span>
<span class="has-text-weight-normal">{% trans "Réinitialiser le mot de passe WiFi" %}</span>
</a>
{% endif %}
</h3>
{% if user.kanidm.radius_secret %}
<div class="buttons has-addons is-flex">
<input id="radius-secret"
data-select
class="button is-primary is-size-4 is-flex-grow-2"
value="{{ user.kanidm.radius_secret }}"
type="password"
readonly />
<a id="secret-toggle" class="button is-size-4 is-warning is-light"><span class="icon"><i class="ti ti-eye"></i></span></a>
</div>
{% else %}
<a href="{% url "dgsi:dgn-generate_wifi_password" %}"
class="button is-fullwidth is-primary is-light is-size-4 block">{% trans "Générer un mot de passe WiFi" %}</a>
{% endif %}
{% endif %}
{% include "dgsi/partials/profile-radius_secret.html" %}
<h3 class="has-text-weight-bold mb-3">{% trans "Nom d'usage :" %}</h3>
<input data-select
@ -77,12 +49,12 @@
<br>
{% if user.kanidm and user.kanidm.radius_secret %}
<div class="buttons">
<a href="{% url "dgsi:dgn-apple_profile" %}" class="button is-light">
<span class="icon"><i class="ti ti-brand-apple-filled"></i></span>
<span>{% trans "Télécharger le profil Wi-Fi DGNum pour iOS, iPadOS et macOS" %}</span>
</a>
</div>
<div class="buttons">
<a href="{% url "dgsi:dgn-apple_profile" %}" class="button is-light">
<span class="icon"><i class="ti ti-brand-apple-filled"></i></span>
<span>{% trans "Télécharger le profil Wi-Fi DGNum pour iOS, iPadOS et macOS" %}</span>
</a>
</div>
{% endif %}
{% if user.kanidm %}

View file

@ -5,6 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="keywords" content="dgnum,dgsi,ens" />
<meta name="description" content="Système d'information de la DGNum" />
<meta name="htmx-config"
content='{"defaultSwapStyle":"outerHTML","requestClass":"is-loading"}' />
<title>DGNum</title>
{% block extra_head %}
@ -13,16 +15,13 @@
{% include "_links.html" %}
</head>
<body>
<body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
{% include "_hero.html" %}
<section class="container is-max-widescreen py-6 px-4">
<div id="notifications">
{% for message in messages %}
<article class="notification is-light has-text-centered {{ message.tags }}">
<button class="delete"></button>
{{ message|safe }}
</article>
{% include "partials/notification.html" %}
{% endfor %}
</div>

View file

@ -0,0 +1,4 @@
<article class="notification is-light has-text-centered {{ message.tags }}">
<button class="delete"></button>
{{ message|safe }}
</article>