{% extends 'pages/settings/settings.twig' %}
{% import 'macros/form.twig' as f %}
{% import 'macros/base.twig' as m %}

{% block title %}{{ __('settings.password') }}{% endblock %}

{% block row_content %}
    <form action="" enctype="multipart/form-data" method="post">
        {{ csrf() }}

        <div class="row">
            <div class="col-md-12">
                {{ m.info(__('settings.password.info')) }}

                {% if user.password %}
                    {{ f.input('password', __('settings.password.password'), {
                        'type': 'password',
                        'required': true,
                        'autocomplete': 'current-password',
                    }) }}
                {% endif %}
                {{ f.input('new_password', __('settings.password.new_password'), {
                    'type': 'password',
                    'min_length': min_length,
                    'required': true,
                    'autocomplete': 'new-password',
                    'info': __('password.minimal_length', [min_length]),
                }) }}
                {{ f.input('new_password2', __('settings.password.new_password2'), {
                    'type': 'password',
                    'min_length': min_length,
                    'required': true,
                    'autocomplete': 'new-password',
                }) }}
                {{ f.submit(__('form.save'), {'icon_left': 'save'}) }}
            </div>
        </div>
    </form>
{% endblock %}
