1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2025-06-30 23:21:17 +02:00

Simplify user profile

This commit is contained in:
Alexandre Iooss
2019-08-08 16:18:15 +02:00
parent ef0bd78af5
commit 8a1af4c2b3
15 changed files with 102 additions and 412 deletions

View File

@ -1,20 +0,0 @@
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
<table class="table table-striped">
<thead>
<tr>
<th>Clef</th>
<th>Propriétaire</th>
<th>Commentaire</th>
</tr>
</thead>
{% for clef in clef_list %}
<tr>
<td>{{ clef.nom }}</td>
<td>{{ clef.proprio }}</td>
<td>{{ clef.commentaire }}</td>
</tr>
{% endfor %}
</table>

View File

@ -1,44 +1,23 @@
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% if users_list.paginator %}
{% include "pagination.html" with list=users_list %}
{% include "pagination.html" with list=users_list %}
{% endif %}
<table class="table table-striped">
<thead>
<tr>
<th>Prénom</th>
<th>Nom</th>
<th>Pseudo</th>
<th>Mail</th>
<th>Max emprunts</th>
<th>Adhérent</th>
<th>Profil</th>
</tr>
</thead>
{% for user in users_list %}
<table class="table table-striped">
<thead>
<tr>
<th>Prénom</th>
<th>Nom</th>
<th>Pseudo</th>
<th>Mail</th>
<th>Max emprunts</th>
<th>Adhérent</th>
</tr>
</thead>
{% for user in users_list %}
<tr>
<td>{{ user.first_name }}</td>
<td>{{ user.last_name }}</td>
@ -46,13 +25,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ user.email }}</td>
<td>{{ user.maxemprunt }}</td>
{% if user.is_adherent %}
<td><font color="green">Oui</font></td>
<td><span style="color:green">Oui</span></td>
{% else %}
<td><font color="red">Non</font></td>
<td><span style="color:red">Non</span></td>
{% endif %}
<td><a href="{% url "users:profil" user.id%}" class="btn btn-primary btn-sm" role="button"><i class="glyphicon glyphicon-user"></i></a>
</td>
</tr>
{% endfor %}
</table>
{% endfor %}
</table>

View File

@ -1,37 +0,0 @@
{% extends "users/sidebar.html" %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}
{% load bootstrap3 %}
{% block title %}Utilisateurs{% endblock %}
{% block content %}
<h2>Users</h2>
{% include "users/aff_users.html" with users_list=users_list %}
<br />
<br />
<br />
{% endblock %}

View File

@ -1,11 +0,0 @@
{% extends "users/sidebar.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% block title %}Clef{% endblock %}
{% block content %}
<h2>Liste des clef</h2>
{% include "users/aff_clef.html" with clef_list=clef_list %}
{% endblock %}

View File

@ -1,26 +1,6 @@
{% extends "users/sidebar.html" %}
{% extends "base.html" %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load bootstrap3 %}
@ -30,21 +10,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block content %}
<h2>Compte</h2>
<div>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-info' user.id %}">
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-info' %}">
<i class="glyphicon glyphicon-edit"></i>
Editer
</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:password' user.id %}">
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:password' %}">
<i class="glyphicon glyphicon-lock"></i>
Changer le mot de passe
</a>
<a class="btn btn-info btn-sm" role="button" href="{% url 'users:history' 'user' user.id %}">
<i class="glyphicon glyphicon-time"></i>
Historique
</a>
</div>
<p>
<br />
<br/>
</p>
<table class="table table-striped">
<tr>
@ -76,17 +52,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ user.maxemprunt }}</td>
<th>Droits</th>
{% if list_droits %}
<td>{% for droit in list_droits %}{{ droit.right }}{% if list_droits|length != forloop.counter %} - {% endif %} {% endfor %}</td>
<td>{% for droit in list_droits %}{{ droit.right }}{% if list_droits|length != forloop.counter %} -
{% endif %} {% endfor %}</td>
{% else %}
<td>Aucun</td>
<td>Aucun</td>
{% endif %}
</tr>
<tr>
<th>Statut</th>
<tr>
<th>Statut</th>
{% if user.is_active %}
<td><font color="green">Actif</font></td>
<td><font color="green">Actif</font></td>
{% else %}
<td><font color="red">Désactivé</font></td>
<td><font color="red">Désactivé</font></td>
{% endif %}
<th>Dernière connexion</th>
<td>{{ user.last_login }}</td>
@ -94,27 +71,26 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<th>Adherent pour l'année en cours</th>
{% if user.is_adherent %}
<td><font color="green">Oui</font></td>
<td><font color="green">Oui</font></td>
{% else %}
<td><font color="red">Non</font></td>
<td><font color="red">Non</font></td>
{% endif %}
{% if not user.is_adherent and is_bureau %}
<th></th>
<td><a class="btn btn-primary btn-sm" role="button" href="{% url 'users:adherer' user.id %}"><i class="glyphicon glyphicon-flag"></i> Adhérer</a></td>
<th></th>
<td><a class="btn btn-primary btn-sm" role="button" href="{% url 'users:adherer' user.id %}"><i
class="glyphicon glyphicon-flag"></i> Adhérer</a></td>
{% endif %}
</tr>
</tr>
</table>
<h2>Emprunts</h2>
{% if is_perm or is_bureau %}
<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'media:add-emprunt' user.id %}"><i class="glyphicon glyphicon-flag"></i> Ajouter</a></h4>
<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'media:add-emprunt' user.id %}"><i
class="glyphicon glyphicon-flag"></i> Ajouter</a></h4>
{% endif %}
{% if emprunts_list %}
{% include "media/aff_emprunts.html" with emprunts_list=emprunts_list %}
{% include "media/aff_emprunts.html" with emprunts_list=emprunts_list %}
{% else %}
<p>Aucun emprunt</p>
<p>Aucun emprunt</p>
{% endif %}
<br />
<br />
<br />
{% endblock %}

View File

@ -1,48 +0,0 @@
{% extends "base.html" %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}
{% block sidebar %}
{% if is_bureau %}
<a class="list-group-item list-group-item-success" href="{% url "users:new-user" %}">
<i class="glyphicon glyphicon-plus"></i>
Créer un adhérent
</a>
{% endif %}
{% if is_perm %}
<a class="list-group-item list-group-item-info" href="{% url "users:index" %}">
<i class="glyphicon glyphicon-list"></i>
Utilisateurs dans la base
</a>
<a class="list-group-item list-group-item-info" href="{% url "users:index-ajour" %}">
<i class="glyphicon glyphicon-list"></i>
Adhérents
</a>
<a class="list-group-item list-group-item-info" href="{% url "users:index-clef" %}">
<i class="glyphicon glyphicon-list"></i>
Clef
</a>
{% endif %}
{% endblock %}

View File

@ -1,26 +1,6 @@
{% extends "users/sidebar.html" %}
{% extends "base.html" %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load bootstrap3 %}
@ -28,14 +8,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block title %}Création et modification d'utilisateur{% endblock %}
{% block content %}
{% bootstrap_form_errors userform %}
{% bootstrap_form_errors userform %}
<form class="form" method="post">
{% csrf_token %}
{% bootstrap_form userform %}
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
</form>
<br />
<br />
<br />
<form class="form" method="post">
{% csrf_token %}
{% bootstrap_form userform %}
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
</form>
{% endblock %}