{% import '@SyliusUi/Macro/headers.html.twig' as headers %}

{% extends '@SyliusShop/Account/layout.html.twig' %}

{% form_theme form '@SyliusShop/Form/theme.html.twig' %}

{% block breadcrumb %}
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item">
                <a href="{{ path('sylius_shop_homepage') }}" class="section">{{ 'sylius.ui.home'|trans }}</a>
            </li>

            <li class="breadcrumb-item">
                <a href="{{ path('sylius_shop_account_dashboard') }}" class="section">{{ 'sylius.ui.my_account'|trans }}</a>
            </li>

            <li class="breadcrumb-item active">{{ 'sylius.ui.change_password'|trans }}</li>
        </ol>
    </nav>
{% endblock %}

{% block subcontent %}
    <div class="account-change-password">
        {{ form_start(form, {'action': path('sylius_shop_account_change_password'), 'attr': {'class': 'ui loadable form', 'novalidate': 'novalidate'}}) }}
            {{ headers.shop('sylius.ui.change_password'|trans, null, 'sylius.ui.set_a_new_password_for_your_account'|trans) }}

            <hr>

            {{ sylius_template_event('sylius.shop.account.change_password.after_content_header', {'form': form}) }}

            {{ form_row(form.currentPassword, sylius_test_form_attribute('current-password')) }}
            {{ form_row(form.newPassword.first, sylius_test_form_attribute('new-password')) }}
            {{ form_row(form.newPassword.second, sylius_test_form_attribute('confirmation-new-password')) }}

            {{ sylius_template_event('sylius.shop.account.change_password.form', {'form': form}) }}

            <button type="submit" {{ sylius_test_html_attribute('save-changes') }} class="btn btn-primary">{{ 'sylius.ui.save_changes'|trans }}</button>

        {{ form_row(form._token) }}
        {{ form_end(form, {'render_rest': false}) }}
    </div>
{% endblock %}
