From 754475760605f054a8348c2c25eb367659991b70 Mon Sep 17 00:00:00 2001 From: chirac Date: Fri, 29 Jun 2018 18:20:25 +0200 Subject: [PATCH] Boolean compte mail actif/inactif --- .../0036_optionaluser_mail_accounts.py | 20 +++++++++++++++++++ preferences/models.py | 6 +++++- .../preferences/display_preferences.html | 16 ++++++++++----- 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 preferences/migrations/0036_optionaluser_mail_accounts.py diff --git a/preferences/migrations/0036_optionaluser_mail_accounts.py b/preferences/migrations/0036_optionaluser_mail_accounts.py new file mode 100644 index 00000000..c3bf4fa8 --- /dev/null +++ b/preferences/migrations/0036_optionaluser_mail_accounts.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-06-29 16:01 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('preferences', '0035_optionaluser_mail_extension'), + ] + + operations = [ + migrations.AddField( + model_name='optionaluser', + name='mail_accounts', + field=models.BooleanField(default=False, help_text='Activation des comptes mails pour les utilisateurs'), + ), + ] diff --git a/preferences/models.py b/preferences/models.py index 59b44111..0f4d21ba 100644 --- a/preferences/models.py +++ b/preferences/models.py @@ -103,11 +103,15 @@ class OptionalUser(AclMixin, PreferencesModel): blank=True, null=True ) + mail_accounts = models.BooleanField( + default=False, + help_text="Activation des comptes mails pour les utilisateurs" + ) mail_extension = models.CharField( max_length = 32, default = "@example.org", help_text="Extension principale pour les mails internes", - ) + ) class Meta: permissions = ( diff --git a/preferences/templates/preferences/display_preferences.html b/preferences/templates/preferences/display_preferences.html index 2e289858..1489c930 100644 --- a/preferences/templates/preferences/display_preferences.html +++ b/preferences/templates/preferences/display_preferences.html @@ -36,6 +36,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

+
Généralités
@@ -55,11 +56,13 @@ with this program; if not, write to the Free Software Foundation, Inc., - +
Téléphone obligatoirement requisCreations de clubs par tous {{ useroptions.all_can_create_club }}
+
Gestion du solde {% if useroptions.user_solde %}Activé{% else %} Désactivé{% endif%}
+ - {% if useroptions.user_solde %} + @@ -69,14 +72,17 @@ with this program; if not, write to the Free Software Foundation, Inc., - {% else %} - - {% endif%} +
Activation du solde pour les utilisateurs {{ useroptions.user_solde }}Solde négatif {{ useroptions.solde_negatif }}
Montant minimal de rechargement en ligne {{ useroptions.min_online_payment }}
+
Comptes mails {% if useroptions.mail_accounts %}Activé{% else %} Désactivé{% endif%}
+ + +
Gestion des comptes mails{{ useroptions.mail_accounts }} Extension mail interne {{ useroptions.mail_extension }}
+

Préférences machines