{{ moduleHeader('user', 'Change password'|trans, '', true) }}

{% if login %}
    <div class="alert alert-warning">
        <p>{% trans %}Before logging in, the site administrator has asked that you change the password for your account.{% endtrans %}</p>
        <p>{% trans %}If you leave this page without successfully changing your password, then you will not be logged in.{% endtrans %}</p>
    </div>
{% endif %}

<div class="alert alert-info">
    <p>{% trans %}To change your password, please enter your current password, and then enter a new password (you must enter the new password twice to ensure that you have typed it correctly).{% endtrans %}</p>
    {% if login %}<p>{% trans %}Once you have successfully changed your password, the log-in process will complete.{% endtrans %}</p>{% endif %}
</div>

{{ form_start(form) }}
{{ form_errors(form) }}
<fieldset>
    <legend>{% trans %}Password{% endtrans %}</legend>
    {{ form_row(form.oldpass) }}
    {{ include('@ZikulaZAuthModule/Authentication/PasswordGenerator.html.twig') }}
    {{ form_row(form.pass) }}
</fieldset>
<div class="form-group row">
    <div class="col-md-9 offset-md-3">
        {{ form_widget(form.submit) }}
        {{ form_widget(form.cancel) }}
    </div>
</div>
{{ form_end(form) }}
{% if getModVar('ZikulaZAuthModule', constant('Zikula\\ZAuthModule\\ZAuthConstant::MODVAR_PASSWORD_STRENGTH_METER_ENABLED')) %}
{{ pageAddAsset('javascript', zasset('@ZikulaZAuthModule:js/pwstrength-bootstrap.min.js')) }}
{{ pageAddAsset('javascript', zasset('@ZikulaZAuthModule:js/Zikula.ZAuth.PWStrength.Init.js')) }}
{% endif %}
