Commit 25c421ba authored by Gabriel Detraz's avatar Gabriel Detraz

Déplace l'affichage des alias dans la vue idoine

parent 50970738
......@@ -7,5 +7,5 @@ urlpatterns = patterns('',
url('^$', views.afficher, name='afficher'),
url('chgpass', views.chgpass, name='chgpass'),
url('redirection', views.redirection, name='redirection'),
url('newalias', views.newalias, name='newalias')
url('alias', views.alias, name='alias')
)
......@@ -189,7 +189,7 @@ def redirection(request):
return render(request, "compte/redirection.html", {'form': form})
@login_required
def newalias(request):
def alias(request):
luser = conn_pool.get_user(request.user, mode='w')
if request.method == "POST":
form = AliasForm(request.POST)
......@@ -208,4 +208,4 @@ def newalias(request):
elist.append(e)
else:
form = AliasForm()
return render(request, "compte/alias.html", {'form': form})
return render(request, "compte/alias.html", {'form': form, 'luser': luser})
......@@ -101,13 +101,7 @@
{{ luser.mail.0 }}
</div>
<div class="six columns">
<label>Aliases mail :</label>
<ul>
<li>{{ luser.canonicalAlias.0 }}</li>
{% for alias in luser.mailAlias %}
<li>{{ alias }}</li>
{% endfor %}
</ul>
<a class="button" href="{% url 'compte:alias' %}">Gérer mes alias mail</a>
</div>
</div>
......@@ -117,17 +111,11 @@
{{ form.contourneGreylist }}
{{ form.contourneGreylist.errors }}
</div>
<div class="six columns">
<a class="button" href="{% url 'compte:redirection' %}">Changer la redirection mail</a>
</div>
</div>
<div class="row">
<a class="button" href="{% url 'compte:redirection' %}">Changer la redirection mail</a>
</div>
<div class="row">
<a class="button" href="{% url 'compte:newalias' %}">Ajouter un alias mail</a>
</div>
<footer>
<div class="row">
<div class="six columns">
......
......@@ -8,6 +8,15 @@
{{ form.non_field_errors }}
</div>
<div class="row">
<div class="six columns">
<label>Aliases mail :</label>
<ul>
<li>{{ luser.canonicalAlias.0 }}</li>
{% for alias in luser.mailAlias %}
<li>{{ alias }}</li>
{% endfor %}
</ul>
</div>
<div class="six columns{% if form.mailAlias.errors %} error{% endif %}">
{{ form.mailAlias.label_tag}}
{{ form.mailAlias }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment