From c5af76f9639b72235746fd654de9414c65d5c4de Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Fri, 15 Jun 2018 11:00:12 +0200 Subject: [PATCH 1/4] Changement des couleurs et prise en ompte de l'activation du solde --- users/templates/users/profil.html | 97 ++++++++++++++++++++++++++----- 1 file changed, 84 insertions(+), 13 deletions(-) diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index 2442f167..2029a526 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -28,19 +28,90 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load logs_extra %} {% block title %}Profil{% endblock %} {% block content %} -

{{ users.surname }} {{users.name}}

-

Vous êtes {% if users.end_adhesion != None %} - un {{ users.class_name | lower}}{% else %} - non adhérent{% endif %} et votre connexion est {% if users.has_access %} -active{% else %}désactivée{% endif %}.

-{% if user_solde %} -

Votre solde est de {{ users.solde }}€. - - - Recharger - -

-{% endif %} + +
+

Bienvenue {{users.name}} {{ users.surname }}

+
+
+
+ {% if solde_activated %} +
+ {% else %} +
+ {% endif %} +
+ {% if users.is_adherent %} +
+
Connécté
+
Fin de connexion: {{user.end_adhesion|date:"d M Y"}}
+
+ {% else %} +
+
Non connécté
+ +
+ {% endif %} +
+
+ {% if solde_activated %} +
+
+
+
+
{{user.solde}}
+ +
+
+
+
+ {% endif %} + {% if solde_activated %} +
+ {% else %} +
+ {% endif %} +
+ {% if nb_machines %} +
+
+ {{nb_machines}} + Machines + +
+ +
+ {% else %} +
+
Aucune machine
+ +
+ {% endif %} +
+
+
+
+ +
From 6b9896143fb13b4fdfdae06c20f92fc9b374b60b Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Sat, 16 Jun 2018 09:57:21 +0200 Subject: [PATCH 2/4] =?UTF-8?q?Prise=20en=20compte=20du=20bannissement=20e?= =?UTF-8?q?t=20d=C3=A9ployement=20des=20des=20infos=20si=20clique=20dans?= =?UTF-8?q?=20les=20titres?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/templates/users/profil.html | 37 ++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index 2029a526..9628097a 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -40,20 +40,28 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endif %}
- {% if users.is_adherent %} -
-
Connécté
-
Fin de connexion: {{user.end_adhesion|date:"d M Y"}}
-
- {% else %} + {% if users.is_ban%}
-
Non connécté
+
Votre compte est banni
- - - Adhérer - + Fin du ban : {{user.end_ban|date:"d M Y"}} +
+
+ {% elif not users.is_adherent%} +
+
Non Connécté
+ + {% else %} +
+
Connécté
+
+ Fin de connexion: {{user.end_adhesion|date:"d M Y"}} +
{% endif %}
@@ -63,7 +71,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
-
{{user.solde}}
+
+ + {{user.solde}} +
@@ -83,7 +94,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if nb_machines %}
-
+
{{nb_machines}} Machines From 9321e6b5ed6d9680cc4ec0b50bb01d9817e7d46e Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Fri, 15 Jun 2018 18:12:43 +0200 Subject: [PATCH 3/4] Envoi le la variable d'activation du solde --- users/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/users/views.py b/users/views.py index 0e37089d..d610f5a5 100644 --- a/users/views.py +++ b/users/views.py @@ -51,7 +51,7 @@ from reversion import revisions as reversion from cotisations.models import Facture, Paiement from machines.models import Machine -from preferences.models import GeneralOption +from preferences.models import GeneralOption, OptionalUser from re2o.views import form from re2o.utils import ( all_has_access, @@ -112,8 +112,7 @@ def new_user(request): GTU_sum_up = GeneralOption.get_cached_value('GTU_sum_up') GTU = GeneralOption.get_cached_value('GTU') if user.is_valid(): - user = user.save(commit=False) - user.save() + user = user.save() user.reset_passwd_mail(request) messages.success(request, "L'utilisateur %s a été crée, un mail\ pour l'initialisation du mot de passe a été envoyé" % user.pseudo) @@ -914,6 +913,8 @@ def profil(request, users, **_kwargs): 'ban_list': bans, 'white_list': whitelists, 'user_solde': user_solde, + 'allow_online_payment': allow_online_payment, + 'solde_activated': OptionalUser.objects.first().user_solde } ) From 7dcd32cb1e943a3ac3be47fb3f24592f69d60547 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Tue, 10 Jul 2018 23:36:01 +0200 Subject: [PATCH 4/4] Imports corrects --- users/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/users/views.py b/users/views.py index d610f5a5..a6444e33 100644 --- a/users/views.py +++ b/users/views.py @@ -51,7 +51,7 @@ from reversion import revisions as reversion from cotisations.models import Facture, Paiement from machines.models import Machine -from preferences.models import GeneralOption, OptionalUser +from preferences.models import OptionalUser, GeneralOption, AssoOption from re2o.views import form from re2o.utils import ( all_has_access, @@ -913,8 +913,8 @@ def profil(request, users, **_kwargs): 'ban_list': bans, 'white_list': whitelists, 'user_solde': user_solde, - 'allow_online_payment': allow_online_payment, - 'solde_activated': OptionalUser.objects.first().user_solde + 'solde_activated': Paiement.objects.filter(is_balance=True).exists(), + 'asso_name': AssoOption.objects.first().name } )