{#
/*
 * Spring Signage Ltd - http://www.springsignage.com
 * Copyright (C) 2015 Spring Signage Ltd
 * (${FILE_NAME})
 */

#}

{% extends "form-base.twig" %}
{% import "forms.twig" as forms %}

{% block formTitle %}
    {% trans "Change Password" %}
{% endblock %}

{% block formButtons %}
    {% trans "Help" %}, XiboHelpRender("{{ help.changePassword }}")
    {% trans "Cancel" %}, XiboDialogClose()
    {% trans "Save" %}, $("#userChangePasswordForm").submit()
{% endblock %}

{% block formHtml %}
    <div class="row">
        <div class="col-md-12">
            <form id="userChangePasswordForm" class="XiboForm form-horizontal" method="put" action="{{ urlFor("user.change.password", {id: user.userId}) }}">
                {% set title %}{% trans "User Name" %}{% endset %}
                {{ forms.disabled("userName", title, currentUser.userName) }}

                {% set title %}{% trans "Password" %}{% endset %}
                {% set helpText %}{% trans "Please enter your current password" %}{% endset %}
                {{ forms.password("password", title, "", helpText, "", "required") }}

                {% set title %}{% trans "New Password" %}{% endset %}
                {% set helpText %}{% trans "Please enter your new password" %}{% endset %}
                {{ forms.password("newPassword", title, "", helpText, "", "required") }}

                {% set title %}{% trans "Retype New Password" %}{% endset %}
                {% set helpText %}{% trans "Please repeat the new Password." %}{% endset %}
                {{ forms.password("retypeNewPassword", title, "", helptext, "", "required") }}
            </form>
        </div>
    </div>
{% endblock %}