Commit 6c7d3c22 authored by Dalahro's avatar Dalahro
Browse files

Couleurs dans le profil et ajout d'informations

parent 64373b60
......@@ -110,6 +110,7 @@ class StateForm(ModelForm):
model = User
fields = ['state']
class SchoolForm(ModelForm):
class Meta:
model = School
......
......@@ -5,6 +5,7 @@
<th>Nom</th>
<th>Pseudo</th>
<th>Inscrit le</th>
<th>Etat</th>
<th>Profil</th>
</tr>
</thead>
......@@ -14,6 +15,14 @@
<td>{{ user.surname }}</td>
<td>{{ user.pseudo }}</td>
<td>{{ user.registered }}</td>
<td>{% if user.state == 0 %}
<font color="green">Actif</font>
{% elif user.state == 1 %}
<font color="red">Désactivé</font>
{% else %}
<font color="orange">Archivé</font>
{% endif %}
</td>
<td><form method="POST" action="{% url "users:profil"%}">
{% csrf_token %}
<input type="hidden" name="user" id="user" value="{{ user.pseudo }}"></input>
......
......@@ -33,8 +33,37 @@
<th>Chambre</th>
<td>{{ user.room }}</td>
<th>Date d'inscription</th>
<td>{{ user.registered}}</td>
<td>{{ user.registered }}</td>
</tr>
<tr>
<th>Fin d'adhésion</th>
{% if end_adhesion != None %}
<td><font color="green">{{ end_adhesion }}</font></td>
{% else %}
<td><font color="red">Non adhérent</font></td>
{% endif %}
<th>Bannissement</th>
{% if end_ban != None %}
<td><font color="red">{{ end_ban }}</font></td>
{% else %}
<td><font color="green">Non banni</font></td>
{% endif %}
</tr>
<tr>
<th>Connexion</th>
{% if actif == True %}
<td><font color="green">Active</font></td>
{% else %}
<td><font color="red">Désactivée</font></td>
{% endif %}
<th>Statut</th>
{% if user.state == 0 %}
<td><font color="green">Actif</font></td>
{% elif user.state == 1 %}
<td><font color="red">Désactivé</font></td>
{% else %}
<td><font color="orange">Archivé</font></td>
{% endif %}
</table>
<h2>Machines :</h2>
{% if machine_list %}
......
......@@ -14,7 +14,7 @@ from cotisations.models import Facture
from machines.models import Machine
from users.forms import PassForm
from search.models import SearchForm
from cotisations.views import is_adherent
from cotisations.views import is_adherent, end_adhesion
from re2o.login import makeSecret, hashNT
......@@ -156,7 +156,10 @@ def profil(request):
machines = None
factures = Facture.objects.filter(user__pseudo = users)
bans = Ban.objects.filter(user__pseudo = users)
return render(request, 'users/profil.html', {'user': users, 'machine_list' :machines, 'facture_list':factures, 'ban_list':bans})
end = None
if(is_ban(users)):
end=end_ban(users)
return render(request, 'users/profil.html', {'user': users, 'machine_list' :machines, 'facture_list':factures, 'ban_list':bans, 'end_ban':end, 'end_adhesion':end_adhesion(users), 'actif':has_access(users)})
return redirect("/users/")
return redirect("/users/")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment