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

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

{% block content %}
    <div class="order-thank-you-container container">
        {% set lastPayment = order.payments.last() %}

        <div class="order-thank-intro">
            <h1 class="h1">
                <span class="icon-pattern-wrapper">
                    <i class="fa fa-check-circle"></i>
                </span><br>
                {{ 'sylius.ui.thank_you'|trans }}
            </h1>

            <p id="sylius-thank-you" class="lead" {{ sylius_test_html_attribute('thank-you') }}>
                {{ 'sylius.ui.placed_an_order'|trans }}
            </p>
        </div>

        {% include '@SyliusShop/Common/Order/_summary.html.twig' %}

        {{ sylius_template_event('sylius.shop.order.thank_you.after_message', {'order': order}) }}

        {% if lastPayment != false %}
            {%  if lastPayment.method.instructions is not null %}
                <div id="sylius-payment-method-instructions" {{ sylius_test_html_attribute('payment-method-instructions') }}>
                    {{ lastPayment.method.instructions }}
                </div>
            {% endif %}
        {% endif %}

        {% if order.customer.user is not null %}
            <div class="form-btn-wrapper">
                <a href="{{ path('sylius_shop_account_order_show', {'number': order.number}) }}" id="sylius-show-order-in-account" class="btn btn-primary" {{ sylius_test_html_attribute('show-order-in-account') }}>{{ 'sylius.ui.view_order'|trans }}</a>
            </div>
        {% else %}
            <div class="row">
                <div class="col-md form-btn-wrapper">
                    <a href="{{ path('sylius_shop_order_show', {'tokenValue': order.tokenValue}) }}" id="payment-method-page" class="btn btn-outline-primary btn-block" {{ sylius_test_html_attribute('payment-method-page') }}>{{ 'sylius.ui.change_payment_method'|trans }}</a>
                </div>
                <div class="col-md form-btn-wrapper">
                    <a href="{{ path('sylius_shop_register_after_checkout', {'tokenValue': order.tokenValue}) }}" class="btn btn-primary btn-block" {{ sylius_test_html_attribute('create-an-account') }}>
                        {{ 'sylius.ui.create_an_account'|trans }}
                    </a>
                </div>
            </div>
        {% endif %}
    </div>
{% endblock %}
