{% extends "account/base.html.twig" %}

{% import "common/macro_flashes.html.twig" as macro_flashes %}

{% block title %}
    {{ "Change my email address" | trans }}
{% endblock %}

{% block head %}
    {% include "account/templates.html.twig" %}
{% endblock %}

{% set selected  = "" %}

{% block content_account %}
    <div class="row-fluid">
        <div class="span12">
            {{ macro_flashes.flashes() }}
            <form method="POST" action="{{ path("reset_email") }}" id="mainform" name="changeEmail" class="form-horizontal" style="background: #191919;border: 1px solid #333333;padding-top:20px">
                <div class="control-group">
                    <label class="control-label" for="form_login">{{ "admin::compte-utilisateur identifiant" | trans }}</label>
                    <div class="controls">
                        <p id="form_login" style="line-height: 30px;">{{ app["authentication"].getUser().getLogin() }}</p>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="form_password">{{ "admin::compte-utilisateur mot de passe" | trans }}</label>
                    <div class="controls">
                        <input type="password" id="form_password" name="form_password" autocomplete="off" />
                        <div class="error-view"></div>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="form_email">{{ "admin::compte-utilisateur nouvelle adresse email" | trans }}</label>
                    <div class="controls">
                        <input type="text" id="form_email" name="form_email" />
                        <div class="error-view"></div>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="form_email_confirm">{{ "admin::compte-utilisateur confirmer la nouvelle adresse email" | trans }}</label>
                    <div class="controls">
                        <input type="text" id="form_email_confirm" name="form_email_confirm" autocomplete="off" />
                        <div class="error-view"></div>
                    </div>
                </div>
                <div style="max-width: 400px;margin-left: 220px">
                    <input type="submit" class="btn btn-success btn-medium" value="{{ "boutton::valider" | trans }}" style="margin: 20px auto;" />
                    <input type="button" class="btn" value="{{ "boutton::annuler" | trans }}" onclick="self.location.replace('/account/');" />
                </div>
            </form>
            <div class="well well-small alert-info">
                <i class="icon fa fa-info-circle" aria-hidden="true"></i> &nbsp;
                <b>{{ "admin::compte-utilisateur: Pourquoi me demande-t-on mon mot de passe pour changer mon adresse email ?" | trans }}</b>
                <br />
                {{ "admin::compte-utilisateur: Votre adresse e-mail sera utilisee lors de la perte de votre mot de passe afin de pouvoir le reinitialiser, il est important que vous soyez la seule personne a pouvoir la changer." | trans }}
            </div>
        </div>
    </div>
{% endblock %}


{% block scripts %}
    {{ parent() }}
    <script type="text/javascript" src="/assets/production/authenticate{% if not app.debug %}.min{% endif %}.js"></script>
    <script>
        authenticateApp.bootstrap({
            state: 'renewEmail'
        })
    </script>
{% endblock %}
