From 9e7edd9902d8f04d4eea2598161b3e6f3b639c06 Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Sun, 10 Jun 2018 21:32:41 +0200 Subject: [PATCH 1/8] debut de refonte de la page profil --- static/css/base.css | 37 ++++++++++++++ users/templates/users/profil.html | 85 ++++++++++++++++++++++++------- 2 files changed, 105 insertions(+), 17 deletions(-) diff --git a/static/css/base.css b/static/css/base.css index b6a7ae26..814a5f72 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -91,3 +91,40 @@ footer a { } .row.content {height:auto;} } + +/* style for the user page */ + +.dashboard_container{ +margin-top: 30px; +margin-bottom: 20px; +} + + +.panel-heading.dashboard{ + text-align: center; +} + +.panel-body.dashboard{ + text-align: center; +} +#grad_red { + background: red; /* For browsers that do not support gradients */ + background: linear-gradient(#ff6363, #fefefe); /* Standard syntax (must be last) */ +} + +#grad_green { + background: green; /* For browsers that do not support gradients */ + background: linear-gradient(#C8DD58,#4FB64A); /* Standard syntax (must be last) */ +} + +#grad_grey { + background: gray; /* For browsers that do not support gradients */ + background: linear-gradient(#d4d4ff, #fefefe); /* Standard syntax (must be last) */ +} + +#grad_machines{ + background: green; + background: linear-gradient(#c266e0,#fefefe) +} + + diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index abba61a2..f1c9331b 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -27,21 +27,72 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% 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 {{ user.solde }}€. -{% if allow_online_payment %} - - - Recharger - -{% endif %} -

-{% endif %} +
+

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

+
+
+
+
+
+ {% if users.is_adherent %} +
+
Adhérent
+
Fin d'adhésion: {{user.end_adhesion}}
+ {% else %} +
+
Non adhérent
+ + {% endif %} +
+
+
+
+
+
+
+
{{user.solde}}
+ +
+
+
+
+
+
+ {% if nb_machines %} +
+
+ {{nb_machines}} + Machines + +
+ {% else %} +
+
Aucune machine
+
+ {% endif %} + +
+
+
+
+
+ +
@@ -50,7 +101,7 @@ non adhérent{% endif %} et votre connexion est {% if users.has_access %} Informations détaillées
-
+
{% if machines_list %} From 83aa267940982b16f1a3685e8fc49f94e6b766a9 Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Sun, 10 Jun 2018 21:36:36 +0200 Subject: [PATCH 2/8] rectification si aucune machine --- users/templates/users/profil.html | 1 - 1 file changed, 1 deletion(-) diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index f1c9331b..9b751842 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -78,7 +78,6 @@ with this program; if not, write to the Free Software Foundation, Inc., {% else %}
Aucune machine
-
{% endif %}
+ {% if solde_activated %} + {% endif %} + {% if solde_activated %}
+ {% else %} +
+ {% endif %}
{% if nb_machines %}
-
- {{nb_machines}} - Machines - +
+ {{nb_machines}} + Machines + +
+
{% else %}
-
Aucune machine
- {% endif %} - +
Aucune machine
+
+ {% endif %}
From a435f0d1ca261ceddcebc771617317bd714b9751 Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Fri, 15 Jun 2018 18:08:30 +0200 Subject: [PATCH 4/8] =?UTF-8?q?Frontend=20page=20preference=20si=20solde?= =?UTF-8?q?=20non=20activ=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../preferences/display_preferences.html | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/preferences/templates/preferences/display_preferences.html b/preferences/templates/preferences/display_preferences.html index 99e3e14f..1904c7e0 100644 --- a/preferences/templates/preferences/display_preferences.html +++ b/preferences/templates/preferences/display_preferences.html @@ -40,16 +40,14 @@ with this program; if not, write to the Free Software Foundation, Inc., Téléphone obligatoirement requis {{ useroptions.is_tel_mandatory }} - Activation du solde pour les utilisateurs - {{ useroptions.user_solde }} + Auto inscription + {{ useroptions.self_adhesion }} Champ gpg fingerprint {{ useroptions.gpg_fingerprint }} - {% if useroptions.user_solde %} - Solde négatif - {{ useroptions.solde_negatif }} - {% endif %} + Shell par défaut des utilisateurs + {{ useroptions.shell_default }} Creations d'adhérents par tous @@ -57,20 +55,23 @@ with this program; if not, write to the Free Software Foundation, Inc., Creations de clubs par tous {{ useroptions.all_can_create_club }} - {% if useroptions.user_solde %} + - Solde maximum - {{ useroptions.max_solde }} - Montant minimal de rechargement en ligne - {{ useroptions.min_online_payment }} + Activation du solde pour les utilisateurs + {{ useroptions.user_solde }} + {% if useroptions.user_solde %} + Solde négatif + {{ useroptions.solde_negatif }} + + + Solde maximum + {{ useroptions.max_solde }} + Montant minimal de rechargement en ligne + {{ useroptions.min_online_payment }} - {% endif %} - - Auto inscription - {{ useroptions.self_adhesion }} - Shell par défaut des utilisateurs - {{ useroptions.shell_default }} + {% else %} + {% endif%}

Préférences machines

From e18c538495178a7c2af4674f44b2d37775fddf7a Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Fri, 15 Jun 2018 18:12:43 +0200 Subject: [PATCH 5/8] Envoi le la variable d'activation du solde --- users/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/users/views.py b/users/views.py index 34a08313..1612aa93 100644 --- a/users/views.py +++ b/users/views.py @@ -111,8 +111,8 @@ 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(commit=False) + 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) @@ -860,6 +860,7 @@ def profil(request, users, **_kwargs): 'white_list': whitelists, 'user_solde': user_solde, 'allow_online_payment': allow_online_payment, + 'solde_activated': OptionalUser.objects.first().user_solde } ) From 75324a13d39765a74c587cc21f85420289bcba83 Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Fri, 15 Jun 2018 18:16:07 +0200 Subject: [PATCH 6/8] Envoi de la variable d'activation du solde --- users/templates/users/profil.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index a4fa73b6..5f325ce0 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -40,7 +40,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if users.is_adherent %}
-
Connécté
+
Connécté
Fin de connexion: {{user.end_adhesion|date:"d M Y"}}
{% else %} From 48b85f865832f06c2148ecc1426cef9eb6d3b168 Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Sat, 16 Jun 2018 09:57:21 +0200 Subject: [PATCH 7/8] =?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 --- static/css/base.css | 2 ++ users/templates/users/profil.html | 41 ++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/static/css/base.css b/static/css/base.css index 814a5f72..e4c8075c 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -106,6 +106,8 @@ margin-bottom: 20px; .panel-body.dashboard{ text-align: center; + height: 60px; + vertical-align:middle; } #grad_red { background: red; /* For browsers that do not support gradients */ diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index 5f325ce0..2eac1e17 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -38,20 +38,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
+
+ 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 %}
@@ -61,7 +69,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,