diff --git a/preferences/templates/preferences/display_preferences.html b/preferences/templates/preferences/display_preferences.html index c232f13c..fcc889c3 100755 --- a/preferences/templates/preferences/display_preferences.html +++ b/preferences/templates/preferences/display_preferences.html @@ -56,9 +56,13 @@ with this program; if not, write to the Free Software Foundation, Inc., Creations de clubs par tous {{ useroptions.all_can_create_club|tick }} +
{% if useroptions.mail_accounts %}Comptes mails{% else %}Comptes mails{% endif%}
+ - - + + + +
Extension mail interne{{ useroptions.mail_extension }}Gestion des comptes mails{{ useroptions.mail_accounts }}Extension mail interne{{ useroptions.mail_extension }}
diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index acc2c1c9..d1f25c29 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -408,10 +408,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
-

+

- Gestion des mails -

+ Paramètres mail +
@@ -421,19 +421,26 @@ with this program; if not, write to the Free Software Foundation, Inc., Modifier les options mail {% acl_end %} -
- - - - - - - - - - -
Adresse mail externeCompte mail {{ asso_name }}Adresse mail de contact
{{ user.mail.external_mail }}{{ user.mail.internal_address|yesno:"Activé,Désactivé" }}{{ user.mail.external_mail }}
-
+ {% if mail_accounts %} +
+ + + + + + + + + + +
Adresse mail externeCompte mail {{ asso_name }}Adresse mail de contact
{{ user.external_mail }}{{ user.internal_address|yesno:"Activé,Désactivé" }}{{ user.get_mail }}
+ +
+ {% if user.internal_address %} + {% can_create MailAlias %} @@ -443,7 +450,20 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if alias_list %} {% include "users/aff_alias.html" with alias_list=alias_list %} {% endif %} -
+ {% endif %} + {% else %} +
+ + + + + + + +
Adresse mail
{{ user.external_mail }}
+
+ {% endif %} +
diff --git a/users/views.py b/users/views.py index 4ee03458..ab428853 100644 --- a/users/views.py +++ b/users/views.py @@ -570,13 +570,13 @@ def edit_mail(request, mail_instance, **_kwargs): if mail.is_valid(): if mail.changed_data: mail.save() - messages.success(request, "Compte mail modifiée") + messages.success(request, "Option mail modifiée") return redirect(reverse( 'users:profil', kwargs={'userid': str(user_instance.id)} )) return form( - {'userform': mail, 'action_name': 'Editer un compte mail'}, + {'userform': mail, 'action_name': 'Editer les options mail'}, 'users/user.html', request ) @@ -1006,7 +1006,8 @@ def profil(request, users, **_kwargs): 'asso_name': AssoOption.objects.first().name 'allow_online_payment': allow_online_payment, 'asso_name': AssoOption.objects.first().name, - 'alias_list': users.mail.mailalias_set.all() + 'alias_list': users.mailalias_set.all(), + 'mail_accounts': OptionalUser.objects.first().mail_accounts } )