From 64373b600cb023dc4d0a6db163ac4bcc4baf2d82 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 3 Jul 2016 18:09:58 +0200 Subject: [PATCH] Ajout du profil et de jolis boutons --- .../cotisations/aff_cotisations.html | 25 +++++++ cotisations/templates/cotisations/index.html | 28 +------ search/__pycache__/models.cpython-34.pyc | Bin 574 -> 574 bytes search/models.py | 1 + search/templates/search/index.html | 69 ++---------------- search/templates/search/search.html | 4 +- users/__pycache__/admin.cpython-34.pyc | Bin 1463 -> 1475 bytes users/__pycache__/models.cpython-34.pyc | Bin 6724 -> 8091 bytes users/__pycache__/urls.cpython-34.pyc | Bin 788 -> 835 bytes users/__pycache__/views.cpython-34.pyc | Bin 5081 -> 6501 bytes users/templates/users/aff_bans.html | 21 ++++++ users/templates/users/aff_users.html | 26 +++++++ users/templates/users/index.html | 24 +----- users/templates/users/profil.html | 63 ++++++++++++++++ users/urls.py | 1 + users/views.py | 21 +++++- 16 files changed, 171 insertions(+), 112 deletions(-) create mode 100644 cotisations/templates/cotisations/aff_cotisations.html create mode 100644 users/templates/users/aff_bans.html create mode 100644 users/templates/users/aff_users.html create mode 100644 users/templates/users/profil.html diff --git a/cotisations/templates/cotisations/aff_cotisations.html b/cotisations/templates/cotisations/aff_cotisations.html new file mode 100644 index 00000000..cfb7f25c --- /dev/null +++ b/cotisations/templates/cotisations/aff_cotisations.html @@ -0,0 +1,25 @@ + + + + + + + + + + + + + {% for facture in facture_list %} + + + + + + + + + + {% endfor %} +
UtilisateurDesignationNombrePrix unitaireMoyen de paiementDate
{{ facture.user }}{{ facture.name }}{{ facture.number }}{{ facture.prix }}{{ facture.paiement }}{{ facture.date }} Editer
+ diff --git a/cotisations/templates/cotisations/index.html b/cotisations/templates/cotisations/index.html index 0248920c..d715972a 100644 --- a/cotisations/templates/cotisations/index.html +++ b/cotisations/templates/cotisations/index.html @@ -4,29 +4,9 @@ {% block title %}Facture{% endblock %} {% block content %} - - - - - - - - - - - - - {% for facture in facture_list %} - - - - - - - - - - {% endfor %} -
UtilisateurDesignationNombrePrix unitaireMoyen de paiementDate
{{ facture.user }}{{ facture.name }}{{ facture.number }}{{ facture.prix }}{{ facture.paiement }}{{ facture.date }}Editer
+ {% include "cotisations/aff_cotisations.html" with facture_list=facture_list %} +
+
+
{% endblock %} diff --git a/search/__pycache__/models.cpython-34.pyc b/search/__pycache__/models.cpython-34.pyc index a3d7cea6936f91d4aaca7109c7d5daabff2c59fd..103fb5a69f3a7caba657700a7a9082a8f6a1ffb2 100644 GIT binary patch delta 18 ZcmdnTvX6!H9S<+poc|T!LK`_vnE*ae1`GfI delta 18 ZcmdnTvX6!H9S<*;nOa4-;6_eUCIB<-1k3;c diff --git a/search/models.py b/search/models.py index fee5f7ef..8de5d9ba 100644 --- a/search/models.py +++ b/search/models.py @@ -8,3 +8,4 @@ from users.models import User class SearchForm(Form): search_field = forms.CharField(label = 'Search', max_length = 100) + diff --git a/search/templates/search/index.html b/search/templates/search/index.html index d0568fc9..30b9f8e6 100644 --- a/search/templates/search/index.html +++ b/search/templates/search/index.html @@ -1,29 +1,12 @@ -{% extends "search/sidebar.html" %} +{% extends "users/sidebar.html" %} {% load bootstrap3 %} -{% block title %}Utilisateurs{% endblock %} +{% block title %}Résultats de la recherche{% endblock %} {% block content %} {% if users_list %}

Résultats dans les utilisateurs

- - - - - - - - - - {% for user in users_list %} - - - - - - - {% endfor %} -
PrénomNomPseudoModifier
{{ user.name }}{{ user.surname }}{{ user.pseudo }}Editer
+ {% include "users/aff_users.html" with users_list=users_list %} {% endif%} {% if machine_list %}

Résultats dans les machines :

@@ -42,53 +25,11 @@ {% endif %} {% if facture_list %}

Résultats dans les factures :

- - - - - - - - - - - - - {% for facture in facture_list %} - - - - - - - - - - {% endfor %} -
UtilisateurDesignationNombrePrix unitaireMoyen de paiementDate
{{ facture.user }}{{ facture.name }}{{ facture.number }}{{ facture.prix }}{{ facture.paiement }}{{ facture.date }}Editer
+ {% include "cotisations/aff_cotisations.html" with facture_list=facture_list %} {% endif %} {% if ban_list %}

Résultats dans les banissements :

- - - - - - - - - - - {% for ban in ban_list %} - - - - - - - - {% endfor %} -
UtilisateurRaisonDate de débutDate de fin
{{ ban.user }}{{ ban.raison }}{{ ban.date_start }}{{ ban.date_end }}Editer
+ {% include "users/aff_bans.html" with ban_list=ban_list %} {% endif %} {% if not ban_list and not machine_list and not users_list and not facture_list%}

Aucun résultat

diff --git a/search/templates/search/search.html b/search/templates/search/search.html index 063ee55d..9be85b89 100644 --- a/search/templates/search/search.html +++ b/search/templates/search/search.html @@ -1,7 +1,7 @@ -{% extends "search/sidebar.html" %} +{% extends "users/sidebar.html" %} {% load bootstrap3 %} -{% block title %}Création et modification d'utilisateur{% endblock %} +{% block title %}Recherche{% endblock %} {% block content %} {% bootstrap_form_errors searchform %} diff --git a/users/__pycache__/admin.cpython-34.pyc b/users/__pycache__/admin.cpython-34.pyc index ad9c167d7de1130c2dd0f9f03e5a1af7733dbbbe..3053cd1e35e5117eaa40fe0bcdf15742bb23451a 100644 GIT binary patch delta 335 zcmdnaeVCi`9S<*;8B1mOrH!0*jEwA)6`3WuIT@mu8B#bHf;G7&uVGYXWhu(f&z*dZ zQ9_QriX|^GH?@krxU>k&U@It2EltUIysQ3ZL$E1h$Msy76TDt zAVM5Sa7>=ZEHhbwIS`~u6`Lvvpek-4E@lD}Jd8yWlUFe(;#4gKRK$m*T57Tjivy$d zIISX$WG>D^)msvt_Wm#5y;FUkfK{G#hE3kw>XMY(=&@pQj3bv-8;FP GRR;i%i$44S delta 391 zcmX@iy`7u$9S<*8pG-yg>5ZIqjEroP7cxn5b1+0PGo-LH1Z#3mUc;y?!J3+zn3;2n ztvER&KR@RdYjH_pNvfYF+vK;55|g=^eAq-77#NB~CdV?hSqgxdf*?W&LNQWihwH?)Pl*4>R1sT=Oszz3|bE=U`rCAl^RlA@Xg*2a2 zK~c3!s!>Ywc@>mZyP_HuzlJd*UAl8oBtE#Wi_aq7`%Ab&eiIIXS z6jYTzDFu@w1=A>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WP*^*IV zb(fs@+L*st_4yj~Q%oi#5iNt-vSMFLDN?5d!kt!7BCdN_;Ls6V zYh_m1758bE%=Wz%rra+gMCbs`%tX zsuEVRuX9H-Jn>@rEbcF@w>Q^=&GqMN>ksd(@7-IkO(`NZe2ZJSkS%|2!IIU7m~Sji zyUK4x-Og*o^K0@Rh^K%>j|DR~Q(5nl_j|(+D5JZ-WcMei>iGb{0-@GdvCf*d?7SvU ze1vx>%uOS}%0}DvO;|~oT=1z~F7MKLTtg{UG zObbTQuGcHny$Z$4Yk4S;J@a+)nHtzn{z# zfWVV)OaV^+SK&(xPLqH``{*kr0dH)3T%9&#-|3_Y(34?7*-j6rC}q-BcS zC!&jqGiJREXIm%(yLOWRS9Z=a8E1Opni<%>e$t|hBPYX@y6b& zuOzN#%y0sIBKCwFxE^D$G&lNDs)p#&@1+bCJx&!7j0c%crt@#m`1S%$OS4Zj3 zc>C%o(dfP;hXG3LzbQ)jB>8+(m=?xt5}b(c44jycUceIn%3WSrn;zlqzmUTKC-z^# z3A8tI=sIW4GzK{86d!6Si%AsdVXvMjm|Ub$x)EPxZn zU8@Oby0|UF5i&Z9%P{pklCcTF{dpteXw7fLJ=|4l_p}w@q(8N~%S&Qu@{@^?UPu@^ zBcCla5fL)xLz@Lu6wxEYn_C0%iQ#t3nO!8*O~6Yv24VVP9Zha zH@A*t7Sq(RXjd=K0-Br9MiO!EEpW{!&XQA3LK!?CRJm6y_$_jc+*ISHr`(xta-M5Uotor zhs;K%J;SO$;>u0(Rb}hEky3Pg1ey7>p2oB6uQ@uFo zAM)B?Q5&?Ikd#qW$0%xYG&gQ(9#a%WYEGTzjF6g*@U h_3o!cJL1upN3BJBb!9cb>f)EXS-{URzx>V2e*wbsRs8?} diff --git a/users/__pycache__/urls.cpython-34.pyc b/users/__pycache__/urls.cpython-34.pyc index 8eea11c077ba5f3d4c3f49630ce274af3a193a51..6ebcd7227b14c1744836d43deb2260815aeba68c 100644 GIT binary patch delta 160 zcmbQjc9>219S<+p`A-$$7nm3r9y1^TJ|Noxh>QPBRDPhC%E*u+&XCH?kj2Z8!pe{$ z!O+aan9juz#mA5$$q=k5wV9vMfKh=nuAnGCEi*@7voJB+3W?>>(&Z delta 119 zcmX@iHib?39S<*8no33Z93}>a#|%h-7sz%1;^OBMl^^h=b23EnGNgzz1ZzrcR$(+? xH2|2mrqk76AYN diff --git a/users/__pycache__/views.cpython-34.pyc b/users/__pycache__/views.cpython-34.pyc index 4bef23230c97a724b63d92dbae4d2fc485921808..517008a2902affe0366223c53c913d3792d0b4f2 100644 GIT binary patch literal 6501 zcmds5OLH5?5$?qsAi$SIN|b1MZR=r3GHENa>?Dq3$)-|vB-#<_IN3@SYK2{r3+-Z& znT05+q?3|Akb}?3!Bx@0Ip-YZS8R@{N>wiT0jWw=zV2BpK!~z@NOA~B47z7#XJ`8H zbx;4J*=h`q-~Zxw$B6z)6Q2U;5AfB0vxq$WTNDyS7C9D01#${xac@C-i{un3Dv?t% zy+sPk6jjKn7`{Ydm7*FsHHzxw)G2C^(=cOY3TG&4lG8MNg~Ap^v*gSgzDnU7Mf2p$ z8@@*20!54DEK+oYoFfz+CFdwbOXMt3v`o%2MaRfFM$vI{j#IQk&I&~*$T>mLNpen7 zv`WsZS*uRrOB9_V=ak_a6uwN6O^$8&846#a=v8uFHGGr8*C;wo&S}H9C_F>aS#r)A zewM;>6unN)>lC%gX`^?Jym|T+k#nBB1@ab!zChj)@{S69k-R1HmW6(Uykq1Y7kZ7n z74l99y-waq@>Yd@lf0M6J0wz0K_|d`CX)O+|b^#8+QJlMwYR>J{iQh$4H} zLjrB}N|cn@tsYza?-gm~5ymWNr}W^8ear9PjRW5fUE9OKY|poMfX^H#N8b8s2Vx88A>U1Iqy`tu@qqJ%isnenxhG_+IN$^zN-Q89G zE*@1gnAI+*m+|A6#qjhKQfJWd&(-z2u3F#U-(Oe$rFfm+sMqfX{=Qxt+)t}`Z3kOi z!c<*CLxnXO8N{jt?KRa7m#AfACra8;w73dlZoB*x)0V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--- /dev/null +++ b/users/templates/users/aff_bans.html @@ -0,0 +1,21 @@ + + + + + + + + + + + {% for ban in ban_list %} + + + + + + + + {% endfor %} +
UtilisateurRaisonDate de débutDate de fin
{{ ban.user }}{{ ban.raison }}{{ ban.date_start }}{{ ban.date_end }} Editer
+ diff --git a/users/templates/users/aff_users.html b/users/templates/users/aff_users.html new file mode 100644 index 00000000..106fc3e8 --- /dev/null +++ b/users/templates/users/aff_users.html @@ -0,0 +1,26 @@ + + + + + + + + + + + {% for user in users_list %} + + + + + + + + {% endfor %} +
PrénomNomPseudoInscrit leProfil
{{ user.name }}{{ user.surname }}{{ user.pseudo }}{{ user.registered }}
+ {% csrf_token %} + + +
+
+ diff --git a/users/templates/users/index.html b/users/templates/users/index.html index 651ca085..34a4f3d7 100644 --- a/users/templates/users/index.html +++ b/users/templates/users/index.html @@ -4,25 +4,9 @@ {% block title %}Utilisateurs{% endblock %} {% block content %} - - - - - - - - - - - {% for user in users_list %} - - - - - - - - {% endfor %} -
PrénomNomPseudoInscrit leModifier
{{ user.name }}{{ user.surname }}{{ user.pseudo }}{{ user.registered }}Editer
+ {% include "users/aff_users.html" with users_list=users_list %} +
+
+
{% endblock %} diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html new file mode 100644 index 00000000..2ea0f583 --- /dev/null +++ b/users/templates/users/profil.html @@ -0,0 +1,63 @@ +{% extends "users/sidebar.html" %} +{% load bootstrap3 %} + +{% block title %}Profil{% endblock %} + +{% block content %} +

Adhérent

+ Editer + Changer le mot de passe + Changer le statut +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Prénom{{ user.name }}Nom{{ user.surname }}
Pseudo{{ user.pseudo }}E-mail{{ user.email }}
Ecole{{ user.school }}Promo{{ user.promo }}
Chambre{{ user.room }}Date d'inscription{{ user.registered}}
+

Machines :

+ {% if machine_list %} + + {% else %} +

Aucune machine

+ {% endif %} +

Cotisations :

+

Ajouter une cotisation

+ {% if facture_list %} + {% include "cotisations/aff_cotisations.html" with facture_list=facture_list %} + {% else %} +

Aucune facture

+ {% endif %} +

Bannissements :

+

Ajouter un bannissement

+ {% if ban_list %} + {% include "users/aff_bans.html" with ban_list=ban_list %} + {% else %} +

Aucun bannissement

+ {% endif %} +
+
+
+{% endblock %} + diff --git a/users/urls.py b/users/urls.py index 9e435547..4006d639 100644 --- a/users/urls.py +++ b/users/urls.py @@ -11,6 +11,7 @@ urlpatterns = [ url(r'^edit_ban/(?P[0-9]+)$', views.edit_ban, name='edit-ban'), url(r'^add_right/$', views.add_right, name='add-right'), url(r'^del_right/$', views.del_right, name='del-right'), + url(r'^profil/$', views.profil, name='profil'), url(r'^$', views.index, name='index'), ] diff --git a/users/views.py b/users/views.py index 7b63fae3..8c1fa7b8 100644 --- a/users/views.py +++ b/users/views.py @@ -9,8 +9,11 @@ from django.contrib import messages from django.db.models import Max from django.utils import timezone -from users.models import User, Right, Ban, DelRightForm, UserForm, InfoForm, PasswordForm, StateForm, RightForm, BanForm +from users.models import User, Right, Ban, DelRightForm, UserForm, InfoForm, PasswordForm, StateForm, RightForm, BanForm, ProfilForm +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 re2o.login import makeSecret, hashNT @@ -32,7 +35,7 @@ def is_ban(user): def has_access(user): """ Renvoie si un utilisateur a accès à internet""" - if user.state == 0 and not is_ban(user) and is_adherent(user): + if user.state == User.STATE_ACTIVE and not is_ban(user) and is_adherent(user): return True else: return False @@ -143,3 +146,17 @@ def edit_ban(request, banid): def index(request): users_list = User.objects.order_by('pk') return render(request, 'users/index.html', {'users_list': users_list}) + +def profil(request): + if request.method == 'POST': + profil = ProfilForm(request.POST or None) + if profil.is_valid(): + profils = profil.cleaned_data['user'] + users = User.objects.get(pseudo = profils) + 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}) + return redirect("/users/") + return redirect("/users/") +