8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-05 09:26:27 +00:00

frontend sur l'affichage des options mail

This commit is contained in:
grisel-davy 2018-06-30 14:14:53 +02:00 committed by Maël Kervella
parent ec9471391d
commit 024d7a073c
3 changed files with 47 additions and 22 deletions

View file

@ -56,7 +56,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<th>Creations de clubs par tous</th> <th>Creations de clubs par tous</th>
<td>{{ useroptions.all_can_create_club|tick }}</td> <td>{{ useroptions.all_can_create_club|tick }}</td>
</tr> </tr>
<h5>{% if useroptions.mail_accounts %}<span class="label label-success">Comptes mails{% else %}<span class="label label-danger">Comptes mails{% endif%}</span></h5>
<table class="table table-striped">
<tr> <tr>
<th>Gestion des comptes mails</th>
<td>{{ useroptions.mail_accounts }}</td>
<th>Extension mail interne</th> <th>Extension mail interne</th>
<td>{{ useroptions.mail_extension }}</td> <td>{{ useroptions.mail_extension }}</td>
</tr> </tr>

View file

@ -410,7 +410,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel-heading clearfix" data-parent="#accordion" data-toggle="collapse" data-target="#collapse7"> <div class="panel-heading clearfix" data-parent="#accordion" data-toggle="collapse" data-target="#collapse7">
<h3 class="panel-title pull-left"> <h3 class="panel-title pull-left">
<i class="fa fa-envelope"></i> <i class="fa fa-envelope"></i>
Gestion des mails Paramètres mail
</h3> </h3>
</div> </div>
<div id="collapse7" class="panel-collapse collapse"> <div id="collapse7" class="panel-collapse collapse">
@ -421,6 +421,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
Modifier les options mail Modifier les options mail
</a> </a>
{% acl_end %} {% acl_end %}
{% if mail_accounts %}
<div class="table-responsive"> <div class="table-responsive">
<table class="table"> <table class="table">
<tr> <tr>
@ -429,11 +430,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<th>Adresse mail de contact</th> <th>Adresse mail de contact</th>
</tr> </tr>
<tr> <tr>
<td>{{ user.mail.external_mail }}</td> <td>{{ user.external_mail }}</td>
<td>{{ user.mail.internal_address|yesno:"Activé,Désactivé" }}</td> <td>{{ user.internal_address|yesno:"Activé,Désactivé" }}</td>
<td>{{ user.mail.external_mail }}</td> <td>{{ user.get_mail }}</td>
</table> </table>
<div class="alert alert-info" role="alert">
Vous pouvez bénéficier d'une adresse mail {{ asso_name }}.
Vous pouvez également la rediriger vers une adresse externe en modifiant les options mail.
</div> </div>
</div>
{% if user.internal_address %}
{% can_create MailAlias %} {% can_create MailAlias %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-mailalias' users.id %}"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-mailalias' users.id %}">
<i class="fa fa-plus-square"></i> <i class="fa fa-plus-square"></i>
@ -443,6 +450,19 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if alias_list %} {% if alias_list %}
{% include "users/aff_alias.html" with alias_list=alias_list %} {% include "users/aff_alias.html" with alias_list=alias_list %}
{% endif %} {% endif %}
{% endif %}
{% else %}
<div class="table-responsive">
<table class="table">
<tr>
<th>Adresse mail</th>
</tr>
<tr>
<td>{{ user.external_mail }}</td>
</tr>
</table>
</div>
{% endif %}
</div> </div>
</div> </div>
</div> </div>

View file

@ -570,13 +570,13 @@ def edit_mail(request, mail_instance, **_kwargs):
if mail.is_valid(): if mail.is_valid():
if mail.changed_data: if mail.changed_data:
mail.save() mail.save()
messages.success(request, "Compte mail modifiée") messages.success(request, "Option mail modifiée")
return redirect(reverse( return redirect(reverse(
'users:profil', 'users:profil',
kwargs={'userid': str(user_instance.id)} kwargs={'userid': str(user_instance.id)}
)) ))
return form( return form(
{'userform': mail, 'action_name': 'Editer un compte mail'}, {'userform': mail, 'action_name': 'Editer les options mail'},
'users/user.html', 'users/user.html',
request request
) )
@ -1006,7 +1006,8 @@ def profil(request, users, **_kwargs):
'asso_name': AssoOption.objects.first().name 'asso_name': AssoOption.objects.first().name
'allow_online_payment': allow_online_payment, 'allow_online_payment': allow_online_payment,
'asso_name': AssoOption.objects.first().name, '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
} }
) )