From 2aa8138187f68f77348e38b248c98d9e9aa9f6fa Mon Sep 17 00:00:00 2001 From: Dalahro Date: Sun, 3 Jul 2016 19:48:46 +0200 Subject: [PATCH] Couleurs dans le profil et ajout d'informations --- users/__pycache__/models.cpython-34.pyc | Bin 8091 -> 8091 bytes users/__pycache__/urls.cpython-34.pyc | Bin 835 -> 835 bytes users/__pycache__/views.cpython-34.pyc | Bin 6501 -> 6640 bytes users/models.py | 1 + users/templates/users/aff_users.html | 9 +++++++ users/templates/users/profil.html | 31 +++++++++++++++++++++++- users/views.py | 7 ++++-- 7 files changed, 45 insertions(+), 3 deletions(-) diff --git a/users/__pycache__/models.cpython-34.pyc b/users/__pycache__/models.cpython-34.pyc index 3c8d3f8517d1c978fa1fbbc1b954d329e6bdbca7..68f71f73490f82552faae2daf30933116791f6e7 100644 GIT binary patch delta 125 zcmbPjKii)79S<+pf8WY*HX#Ov$CC@WMK>y$i7^&WHWamGjb>nADB3(*OqG$bV)8-p zEsV93&H0^KV}QctoA*h0Ffz6P)d^3QlB!{B+&o=Ml##J>@>=O-jJ=yfWE2@0Cr&Pt dO=j$vd`or%d z7RH*%=KRjAF+kz6&HE%g7#W*^>VzjtN!2hmY@RM9%E;I;d9Cy^#-7a~GK!3h6DF6* dCNs8Az9qYXaoXl?Id(=)RxwsFE-`j7egLRBB5wcy diff --git a/users/__pycache__/urls.cpython-34.pyc b/users/__pycache__/urls.cpython-34.pyc index 6ebcd7227b14c1744836d43deb2260815aeba68c..0722ae7636520b2faa861f4ed15c47c3f898ea06 100644 GIT binary patch delta 16 XcmX@ic9@O*9S<+pF}KQ%>^95*FdPLZ delta 16 XcmX@ic9@O*9S<+p`A-!a*=?8sG+qVU diff --git a/users/__pycache__/views.cpython-34.pyc b/users/__pycache__/views.cpython-34.pyc index 517008a2902affe0366223c53c913d3792d0b4f2..ddf075bdad891b9d0370a48a7f5e32dd33ea2b3a 100644 GIT binary patch delta 1851 zcmaJ?TW?!M5T1?ijvYI`Bu(oiPU1K@i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H=Av7 z+5K}YBez)gW3_Eo8r3)M0?&z8JS8?Jc0IT9V{(w|5^Q&~b;EFRnr*wyCh{B&DaebG zcbH9xviDwkf_l>u45sEDnl|Liu!30jy`OV@OaVQwwRmGvGRr3cn2+@`KEJE|o}QOY zxolCs9*r0FXW8k!S^pqoC&hjwA*Mqb8y1Z~p|n6BEE1FmP7$bBZWYV+UAIhL!$)I& z7no+}1q*(~o)q5%b8Jcc5gh4;uMShBGX!S|f&}LX+yrrg$E?klX%ZRfG>4kxz>3%p zWZ0zmCDy<9btui0j8PE{FDMalaVebN`F|0|Db|4qTi>di)uxFRnd7Q5fe*+Tw*T4< ztXS4|l@A^?o9%j|>zLu`7{5#bRhdF6nL zUXim8t?*7X&sN3V=wF>Y`&2%b#J9&@`e(^AG3_xv_mC|~g08e~wW*V!w&^|MqOEUM zo0VGAYFC?ErtOw3r!?A}Rz<9AiZ5d0Y)zH|72{{URE+z*gB^WWBV4WDErl>C`M09{ zPl-xhC&y*4R3Xp9GZf@m0>=>*x8eo1F7C%yrH()2#w0Cj`&%4kF>K!CbW=V&q|Y7w zb}i92^}OudViM@5$%l^lQ}VGsm+%(A>+)`8aMcC;fw+?xV)wHqk6etWOfuANgPe6A7Um>_iuu8B-uuecmszn^>QL^%K!1gaST6n!~ ip7qFNom Pseudo Inscrit le + Etat Profil @@ -14,6 +15,14 @@ {{ user.surname }} {{ user.pseudo }} {{ user.registered }} + {% if user.state == 0 %} + Actif + {% elif user.state == 1 %} + Désactivé + {% else %} + Archivé + {% endif %} +
{% csrf_token %} diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index 2ea0f583..e00b60c8 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -33,8 +33,37 @@ Chambre {{ user.room }} Date d'inscription - {{ user.registered}} + {{ user.registered }} + + Fin d'adhésion + {% if end_adhesion != None %} + {{ end_adhesion }} + {% else %} + Non adhérent + {% endif %} + Bannissement + {% if end_ban != None %} + {{ end_ban }} + {% else %} + Non banni + {% endif %} + + + Connexion + {% if actif == True %} + Active + {% else %} + Désactivée + {% endif %} + Statut + {% if user.state == 0 %} + Actif + {% elif user.state == 1 %} + Désactivé + {% else %} + Archivé + {% endif %}

Machines :

{% if machine_list %} diff --git a/users/views.py b/users/views.py index 8c1fa7b8..b66561ce 100644 --- a/users/views.py +++ b/users/views.py @@ -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/")