{% extends "ldt/user/user_base.html" %}
{# form of email address's change #}
{% load i18n %}

{% block content_title %}{% trans "Modification de l'adresse émail" %}{% endblock %}
{% block js_declaration %}{{ block.super }}
    <script type="text/javascript">
        $(document).ready(function() {
            $("#change_email").validate();
        });
    </script>
{% endblock %}

{% block css_import %}
{{ block.super }}
    <style type="text/css">
        label.error { float: none; color: red; padding-left: .5em; vertical-align: middle; }
    </style>
{% endblock %}

{% block content %}
{{ block.super }}
{% if form %}
<p>{% trans "Please enter your new e-mail twice so we can verify you typed it in correctly." %}. {% trans "Your actual email address is" %} : <b>{{ user.email }}</b>.</p>
<form action="" method="POST" id="change_email">
{% csrf_token %}
    <table>
       <tr>
            <td>
                <label for="id_email1">{% trans "email" %}</label>
            </td>
            <td>
                <input id="id_email1" type="text" maxlength="75" name="email1" class="required email"/>
            </td>
            <td>{{form.email1.errors}}</td>
        <tr>
        </tr>
            <td>
                <label for="id_email2">{% trans "Confirmation de l'adresse émail" %}</label>
            </td>
            <td>
                 <input id="id_email2" type="text" maxlength="75" name="email2" class="required email"/>
            </td>
            <td>{{form.email1.errors}}</td>
        </tr>
        <tr><th></th><td><input type="submit" class="button" name="submit" value="{% trans 'change my e-mail' %}" /></td></tr>
    </table>
</form>
{% else %}
<p>{% trans "Your new email address has been saved." %}</p>
{% endif %}
{% endblock%}
