{% extends "base.html" %}
{% block entete %}Gestion des admins{% endblock %}
{% block navbar %}
<ul>
	<li><a href="#first">Liste des admins</a></li>
</ul>
{% endblock %}
{% block content %}
<section id="first" class="main">
	<header class="major">
		<h2>Liste des admins</h2>
	</header>
	<a class="button" href="{% url 'users:addAdmin' %}"><i class="fa fa-user-plus"></i> Ajouter un admin</a><br><br>
	<div class="table-wrapper">
		<table>
			<thead>
				<tr>
					<th>Utilisateur</th>
					<th>Profil</th>
					<th>Administrer</th>
				</tr>
			</thead>
			<tbody>
				{% for user in admins %}
				<tr>
					<td><a href="{% url 'users:profile' user.pk %}">{{ user }}</a>{ {% if user.is_superuser %}(superuser){% endif %}</td>
					<td><a class="button small" href="{% url 'users:profile' user.pk %}"><i class="fa fa-user"></i> Profil</a></td>
					<td>{% if not user.is_superuser %}<a class="button small" href="{% url 'users:removeAdmin' user.pk %}"><i class="fa fa-minus-square"></i> Retirer des admins</a>{% endif %}</td>
				</tr>
				{% endfor %}
			</tbody>
		</table>
	</div>
</section>
{% endblock %}
