8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-23 20:03:11 +00:00

Merge branch 'new_user_page' into 'master'

New user page

See merge request federez/re2o!95
This commit is contained in:
chirac 2018-03-18 00:57:26 +01:00
commit 1fe2601d78
2 changed files with 368 additions and 200 deletions

View file

@ -237,6 +237,7 @@ install_base=$(dialog --clear \
$HEIGHT $WIDTH \ $HEIGHT $WIDTH \
2>&1 >/dev/tty) 2>&1 >/dev/tty)
echo "Installation des paquets de base"
apt-get -y install python3-django python3-dateutil texlive-latex-base texlive-fonts-recommended python3-djangorestframework python3-django-reversion python3-pip libsasl2-dev libldap2-dev libssl-dev python3-crypto apt-get -y install python3-django python3-dateutil texlive-latex-base texlive-fonts-recommended python3-djangorestframework python3-django-reversion python3-pip libsasl2-dev libldap2-dev libssl-dev python3-crypto
pip3 install django-bootstrap3 pip3 install django-bootstrap3
pip3 install django-ldapdb pip3 install django-ldapdb

View file

@ -26,208 +26,375 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %} {% load bootstrap3 %}
{% load acl %} {% load acl %}
{% block title %}Profil{% endblock %} {% block title %}Profil{% endblock %}
{% block content %} {% block content %}
<h2>{{ users.class_name }} : {{ users.surname }} {{users.name}}</h2> <h2>{{ users.surname }} {{users.name}}</h2>
<div> <p>Vous êtes {% if users.end_adhesion != None %}<span class="label label-success">
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-info' users.id %}"> un {{ users.class_name | lower}}</span>{% else %}<span class="label label-danger">
<i class="fa fa-edit"></i> non adhérent</span>{% endif %} et votre connexion est {% if users.has_access %}
Editer <span class="label label-success">active</span>{% else %}<span class="label label-danger">désactivée</span>{% endif %}.</p>
</a> {% if user_solde %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:password' users.id %}"> <p>Votre solde est de <span class="badge">{{ user.solde }}€</span>.
<i class="fa fa-lock"></i> {% if allow_online_payment %}
Changer le mot de passe <a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:recharge' %}">
</a> <i class="fa fa-euro-sign"></i>
{% can_change User state %} Recharger
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:state' users.id %}"> </a>
<i class="fa fa-id-badge"></i> {% endif %}
Changer le statut </p>
</a> {% endif %}
{% acl_end %}
{% can_change User groups %} <div class="panel-group" id="accordion">
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:groups' users.id %}"> <div class="panel panel-default">
<i class="fa fa-check"></i> <div class="panel-heading clearfix" data-parent="#accordion" data-toggle="collapse" data-target="#collapse1">
Gérer les groupes <h3 class="panel-title pull-left" >
</a> <i class="fa fa-user"></i> Informations détaillées
{% acl_end %} </h3>
<a class="btn btn-info btn-sm" role="button" href="{% url 'users:history' 'user' users.id %}"> <div class="dropdown pull-right">
<i class="fa fa-history"></i> <a class="btn btn-default btn-sm" id="editionuser" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Historique <i class="fa fa-edit"></i> <span class="caret"></span>
</a>
</div>
<p>
<br />
</p>
<table class="table table-striped">
<tr>
{% if users.is_class_club %}
<th>Mailing</th>
{% if users.club.mailing %}
<td>{{ users.pseudo }}(-admin)</td>
{% else %}
<td>Mailing désactivée</td>
{% endif %}
{% else %}
<th>Prénom</th>
<td>{{ users.name }}</td>
{% endif %}
<th>Nom</th>
<td>{{ users.surname }}</td>
</tr>
<tr>
<th>Pseudo</th>
<td>{{ users.pseudo }}</td>
<th>E-mail</th>
<td>{{ users.email }}</td>
</tr>
<tr>
<th>Chambre</th>
<td>{{ users.room }}</td>
<th>Téléphone</th>
<td>{{ users.telephone }}</td>
</tr>
<tr>
<th>École</th>
<td>{{ users.school }}</td>
<th>Commentaire</th>
<td>{{ users.comment }}</td>
</tr>
<tr>
<th>Date d'inscription</th>
<td>{{ users.registered }}</td>
<th>Dernière connexion</th>
<td>{{ users.last_login }}</td>
</tr>
<tr>
<th>Fin d'adhésion</th>
{% if users.end_adhesion != None %}
<td><i class="text-success">{{ users.end_adhesion }}</i></td>
{% else %}
<td><i class="text-danger">Non adhérent</i></td>
{% endif %}
<th>Accès gracieux</th>
{% if users.end_whitelist != None %}
<td><i class="text-success">{{ users.end_whitelist }}</i></td>
{% else %}
<td><i class="text-warning">Aucun</i></td>
{% endif %}
<tr>
<th>Bannissement</th>
{% if users.end_ban != None %}
<td><i class="text-danger">{{ users.end_ban }}</i></td>
{% else %}
<td><i class="text-success">Non banni</i></td>
{% endif %}
<th>Statut</th>
{% if users.state == 0 %}
<td><i class="text-success">Actif</i></td>
{% elif users.state == 1 %}
<td><i class="text-danger">Désactivé</i></td>
{% else %}
<td><i class="text-warning">Archivé</i></td>
{% endif %}
</tr>
<tr>
<th>Accès internet</th>
{% if users.has_access == True %}
<td><i class="text-success">Actif (jusqu'au {{ users.end_access }})</i></td>
{% else %}
<td><i class="text-danger">Désactivé</i></td>
{% endif %}
<th>Groupes</th>
{% if users.groups.all %}
<td>{{ users.groups.all|join:", "}}</td>
{% else %}
<td>Aucun</td>
{% endif %}
</tr>
{% if allow_online_payment %}
<tr>
<th>Solde</th>
<td>{{ users.solde }} €
<a class="btn btn-primary btn-sm" style='float:right' role="button" href="{% url 'cotisations:recharge' %}">
<i class="fa fa-euro-sign"></i>
Recharger
</a> </a>
</td> <ul class="dropdown-menu" arialabelledby="editionuser">
{% endif %} <li>
{% if users.shell %} <a href="{% url 'users:edit-info' users.id %}">
<th>Shell</th> <i class="fa fa-edit"></i>
<td>{{ users.shell }}</td> Editer
{% endif %} </a>
</tr> </li>
</table> <li>
<a href="{% url 'users:password' users.id %}">
<i class="fa fa-lock"></i>
Changer le mot de passe
</a>
</li>
{% can_change User state %}
<li>
<a href="{% url 'users:state' users.id %}">
<i class="fa fa-id-badge"></i>
Changer le statut
</a>
</li>
{% acl_end %}
{% can_change User groups %}
<li>
<a href="{% url 'users:groups' users.id %}">
<i class="fa fa-check"></i>
Gérer les groupes
</a>
</li>
{% acl_end %}
<li>
<a href="{% url 'users:history' 'user' users.id %}">
<i class="fa fa-history"></i>
Historique
</a>
</li>
</ul>
</div>
</div>
<div class="panel-collapse collapse in" id="collapse1">
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped">
<tr>
<th>Prénom</th>
<td>{{ users.name }}</td>
<th>Nom</th>
<td>{{ users.surname }}</td>
</tr>
<tr>
<th>Pseudo</th>
<td>{{ users.pseudo }}</td>
<th>E-mail</th>
<td>{{ users.email }}</td>
</tr>
<tr>
<th>Chambre</th>
<td>{{ users.room }}</td>
<th>Téléphone</th>
<td>{{ users.telephone }}</td>
</tr>
<tr>
<th>École</th>
<td>{{ users.school }}</td>
<th>Commentaire</th>
<td>{{ users.comment }}</td>
</tr>
<tr>
<th>Date d'inscription</th>
<td>{{ users.registered }}</td>
<th>Dernière connexion</th>
<td>{{ users.last_login }}</td>
</tr>
<tr>
<th>Fin d'adhésion</th>
{% if users.end_adhesion != None %}
<td><i class="text-success">{{ users.end_adhesion }}</i></td>
{% else %}
<td><i class="text-danger">Non adhérent</i></td>
{% endif %}
<th>Accès gracieux</th>
{% if users.end_whitelist != None %}
<td><i class="text-success">{{ users.end_whitelist }}</i></td>
{% else %}
<td><i class="text-warning">Aucun</i></td>
{% endif %}
<tr>
<th>Bannissement</th>
{% if users.end_ban != None %}
<td><i class="text-danger">{{ users.end_ban }}</i></td>
{% else %}
<td><i class="text-success">Non banni</i></td>
{% endif %}
<th>Statut</th>
{% if users.state == 0 %}
<td><i class="text-success">Actif</i></td>
{% elif users.state == 1 %}
<td><i class="text-danger">Désactivé</i></td>
{% else %}
<td><i class="text-warning">Archivé</i></td>
{% endif %}
</tr>
<tr>
<th>Accès internet</th>
{% if users.has_access == True %}
<td><i class="text-success">Actif (jusqu'au {{ users.end_access }})</i></td>
{% else %}
<td><i class="text-danger">Désactivé</i></td>
{% endif %}
<th>Groupes</th>
{% if users.groups.all %}
<td>{{ users.groups.all|join:", "}}</td>
{% else %}
<td>Aucun</td>
{% endif %}
</tr>
{% if allow_online_payment %}
<tr>
<th>Solde</th>
<td>{{ users.solde }} €
<a class="btn btn-primary btn-sm" style='float:right' role="button" href="{% url 'cotisations:recharge' %}">
<i class="fa fa-euro-sign"></i>
Recharger
</a>
</td>
{% endif %}
{% if users.shell %}
<th>Shell</th>
<td>{{ users.shell }}</td>
{% endif %}
</tr>
</table>
</div>
</div>
</div>
</div>
{% if users.is_class_club %} {% if users.is_class_club %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-club-admin-members' users.club.id %}"> <div class="panel panel-default">
<i class="fa fa-lock"></i> <div class="panel-heading clearfix" data-parent="#accordion" data-toggle="collapse" data-target="#collapse2">
Gérer admin et membres <h3 class="panel-title pull-left">
</a> <i class="fa fa-users"></i> Gérer le club
<h3>Administrateurs du club</h3> </h3>
<table class="table table-striped"> <div class="dropdown pull-right">
<thead> <a class="btn btn-default btn-sm" id="editionclub" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<tr> <i class="fa fa-edit"></i> <span class="caret"></span>
<th>Nom</th> </a>
<th>Prenom</th> <ul class="dropdown-menu" arialabelledby="editionclub">
<th>Pseudo</th> <li>
</tr> <a href="{% url 'users:edit-club-admin-members' users.club.id %}">
</thead> <i class="fa fa-lock"></i>
{% for admin in users.club.administrators.all %} Gérer admin et membres
<tr> </a>
<td>{{ admin.surname }}</td> </li>
<td>{{ admin.name }}</td> </ul>
<td>{{ admin.pseudo }}</td> </div>
</tr> </div>
{% endfor %} <div class="panel-collapse collapse" id="collapse2">
</table> <div class="panel-body">
<h3>Membres</h3> <h4>Administrateurs du club</h4>
<table class="table table-striped"> <div class="table-responsive">
<thead> <table class="table table-striped">
<tr> <thead>
<th>Nom</th> <tr>
<th>Prenom</th> <th>Nom</th>
<th>Pseudo</th> <th>Prenom</th>
</tr> <th>Pseudo</th>
</thead> </tr>
{% for admin in users.club.members.all %} </thead>
<tr> {% for admin in users.club.administrators.all %}
<td>{{ admin.surname }}</td> <tr>
<td>{{ admin.name }}</td> <td>{{ admin.surname }}</td>
<td>{{ admin.pseudo }}</td> <td>{{ admin.name }}</td>
</tr> <td>{{ admin.pseudo }}</td>
{% endfor %} </tr>
</table> {% endfor %}
</table>
</div>
<h4>Membres</h4>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Nom</th>
<th>Prenom</th>
<th>Pseudo</th>
</tr>
</thead>
{% for admin in users.club.members.all %}
<tr>
<td>{{ admin.surname }}</td>
<td>{{ admin.name }}</td>
<td>{{ admin.pseudo }}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
</div>
{% endif %} {% endif %}
<h2>Machines</h2> <div class="panel panel-default">
{% can_create Machine users.id %} <div class="panel-heading clearfix" data-parent="#accordion" data-toggle="collapse" data-target="#collapse3">
<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}"><i class="fa fa-desktop"></i> Ajouter une machine</a></h4> <h3 class="panel-title pull-left">
{% acl_end %} <i class="fa fa-desktop"></i>
{% if machines_list %} Machines
{% include "machines/aff_machines.html" with machines_list=machines_list %} <span class="badge">{{machines_list.count}}</span>
{% else %} </h3>
<p>Aucune machine</p> <div class="dropdown pull-right">
{% endif %} <a class="btn btn-default btn-sm" id="editionmachines" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<h2>Cotisations</h2> <i class="fa fa-edit"></i> <span class="caret"></span>
<h4>{% can_create Facture %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:new-facture' users.id %}"><i class="fa fa-euro-sign"></i> Ajouter une cotisation</a> {% if user_solde %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:credit-solde' users.id %}"><i class="fa fa-euro-sign"></i> Modifier le solde</a>{% endif%}{% acl_else %}{% if user_solde %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:new_facture_solde' user.id %}"><i class="fa fa-euro-sign"></i> Ajouter une cotisation par solde</a>{% endif %}{% acl_end %}</h4> </a>
{% if facture_list %} <ul class="dropdown-menu" arialabelledby="editionmachines">
{% include "cotisations/aff_cotisations.html" with facture_list=facture_list %} <li>
{% else %} <a href="{% url 'machines:new-machine' users.id %}">
<p>Aucune facture</p> <i class="fa fa-desktop"></i>
{% endif %} Ajouter une machine
<h2>Bannissements</h2> </a>
{% can_create Ban %}<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-ban' users.id %}"><i class="fa fa-ban"></i> Ajouter un bannissement</a></h4>{% acl_end %} </li>
{% if ban_list %} </ul>
{% include "users/aff_bans.html" with ban_list=ban_list %} </div>
{% else %} </div>
<p>Aucun bannissement</p> <div id="collapse3" class="panel-collapse collapse">
{% endif %} <div class="panel-body">
<h2>Accès à titre gracieux :</h2> {% if machines_list %}
{% can_create Whitelist %}<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-whitelist' users.id %}"><i class="fa fa-check-circle"></i> Accorder un accès à titre gracieux</a></h4>{% acl_end %} {% include "machines/aff_machines.html" with machines_list=machines_list %}
{% if white_list %} {% else %}
{% include "users/aff_whitelists.html" with white_list=white_list %} <p>Aucune machine</p>
{% else %} {% endif %}
<p>Aucun accès gracieux</p> </div>
{% endif %} </div>
<br /> </div>
<br /> <div class="panel panel-default">
<br /> <div class="panel-heading clearfix" data-parent="#accordion" data-toggle="collapse" data-target="#collapse4">
<h3 class="panel-title pull-left">
<i class="fa fa-euro-sign"></i>
Cotisations
</h3>
<div class="dropdown pull-right">
<a class="btn btn-default btn-sm" id="editionfacture" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-edit"></i> <span class="caret"></span>
</a>
<ul class="dropdown-menu" arialabelledby="editionfacture">
{% can_create Facture %}
<li>
<a href="{% url 'cotisations:new-facture' users.id %}">
<i class="fa fa-euro-sign"></i>
Ajouter une cotisation
</a>
</li>
{% if user_solde %}
<li>
<a href="{% url 'cotisations:credit-solde' users.id %}">
<i class="fa fa-euro-sign"></i>
Modifier le solde
</a>
</li>
{% endif%}{% acl_else %}
{% if user_solde %}
<li>
<a href="{% url 'cotisations:new_facture_solde' user.id %}">
<i class="fa fa-euro-sign"></i>
Ajouter une cotisation par solde</a>{% endif %}{% acl_end %}
</a>
</li>
</ul>
</div>
</div>
<div id="collapse4" class="panel-collapse collapse">
<div class="panel-body">
{% if facture_list %}
{% include "cotisations/aff_cotisations.html" with facture_list=facture_list %}
{% else %}
<p>Aucune facture</p>
{% endif %}
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading clearfix" data-parent="#accordion" data-toggle="collapse" data-target="#collapse5">
<h3 class="panel-title pull-left">
<i class="fa fa-ban"></i>
Bannissements
</h3>
<div class="dropdown pull-right">
<a class="btn btn-default btn-sm" id="editionban" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-edit"></i> <span class="caret"></span>
</a>
<ul class="dropdown-menu" arialabelledby="editionban">
{% can_create Ban %}
<li>
<a href="{% url 'users:add-ban' users.id %}">
<i class="fa fa-ban"></i>
Ajouter un bannissement
</a>
</li>
{% acl_end %}
</ul>
</div>
</div>
<div id="collapse5" class="panel-collapse collapse">
<div class="panel-body">
{% if ban_list %}
{% include "users/aff_bans.html" with ban_list=ban_list %}
{% else %}
<p>Aucun bannissement</p>
{% endif %}
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading clearfix" data-parent="#accordion" data-toggle="collapse" data-target="#collapse6">
<h3 class="panel-title pull-left">
<i class="fa fa-check-circle"></i>
Accès à titre gracieux
</h3>
<div class="dropdown pull-right">
<a class="btn btn-default btn-sm" id="editionwhitelist" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-edit"></i> <span class="caret"></span>
</a>
<ul class="dropdown-menu" arialabelledby="editionwhitelist">
{% can_create Whitelist %}
<li>
<a href="{% url 'users:add-whitelist' users.id %}">
<i class="fa fa-check-circle"></i>
Accorder un accès à titre gracieux
</a>
</li>
{% acl_end %}
</ul>
</div>
</div>
<div id="collapse6" class="panel-collapse collapse">
<div class="panel-body">
{% if white_list %}
{% include "users/aff_whitelists.html" with white_list=white_list %}
{% else %}
<p>Aucun accès gracieux</p>
{% endif %}
</div>
</div>
</div>
</div>
<br />
<br />
<br />
{% endblock %} {% endblock %}