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

{% form_theme form '@SyliusShop/Form/theme.html.twig' %}
{% import '@SyliusUi/Macro/messages.html.twig' as messages %}

{% block stylesheets %}
    {{ parent() }}
    {{ encore_entry_link_tags('process', null, 'dedi') }}
{% endblock %}

{% block content %}
    <div class="order-show-container container">
        {% include '@SyliusShop/Order/_summary.html.twig' %}

        {% if order.paymentState in ['awaiting_payment'] %}
            <div class="form-block checkout-block">
                {{ form_start(form, {'action': path('sylius_shop_order_show', {'tokenValue': order.tokenValue}), 'attr': {'class': 'ui loadable form', 'novalidate': 'novalidate'}}) }}
                <input type="hidden" name="_method" value="PUT" />

                <h2 class="h3">{{ 'app.ui.cart.payment_title'|trans }}</h2>
                {% include '@SyliusShop/Checkout/SelectPayment/_form.html.twig' %}

                <div class="form-btn-wrapper">
                    <button type="submit" class="btn btn-primary" id="sylius-pay-link" {{ sylius_test_html_attribute('pay-link') }}>
                        {{ 'sylius.ui.pay'|trans }}
                    </button>
                </div>

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

        {% else %}
            {{ messages.info('sylius.ui.you_can_no_longer_change_payment_method_of_this_order') }}
        {% endif %}
    </div>
{% endblock %}
