{% extends "base/base.html" %}

{% block title %}
<a href="{{ url_for('adm') }}">Panneau d'administration</a> » <h1>Suppression du compte de '{{ user.name }}'</h1>
{% endblock %}

{% block content %}
<section class="form">
	<h2>Confirmer la suppression du compte</h2>
	<p>Le compte '{{ user.name }}' que vous allez supprimer est lié à :</p>
	<ul>
		<li>{{ user.groups | length }} groupe{{ user.groups|length|pluralize }}</li>
		<li>{% set sp = user.special_privileges() | length %}
		    {{- sp }} privilège{{sp|pluralize}} spéci{{sp|pluralize("al","aux")}}</li>
	</ul>

	<form action="{{ url_for('adm_delete_account', user_id=user.id) }}" method=post>
		{{ del_form.hidden_tag() }}
		<div>
			{{ del_form.delete.label }}
			{{ del_form.delete(checked=False) }}
			<div style="font-size: 80%; color: gray">{{ del_form.delete.description }}</div>
			{% for error in del_form.delete.errors %}
			<span class=msgerror>{{ error }}</span>
			{% endfor %}
		</div>
		<div>{{ del_form.submit(class_="bg-red") }}</div>
	</form>
</section>
{% endblock %}
