{% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
{% import '@LcShop/backend/order/macros.html.twig' as orderMacros %}
{% trans_default_domain 'lcshop' %}
{{ macros.startCard(9, 'OrderShop.resume') }}

<div class="col-4">
    <h6><strong>{{ "field.OrderShop.mainInfo"|trans({}, 'lcshop') }} : </strong></h6>
    <p>
        <strong>{{ "field.OrderShop.status"|trans }} </strong><br />
        <span>${order.orderStatus}</span>
        <button type="button" class="btn btn-default" data-toggle="modal" data-target="#modal-order-status">
            {{ "action.edit"|trans }}
        </button>
    </p>
    <p>
        <strong>{{ "field.OrderShop.user"|trans }} </strong><br />
        <span>${order.user}</span>
    </p>
    <p>
        <strong>{{ "field.OrderShop.orderNumber"|trans }} </strong><br />
        <span>${order.id}</span>
    </p>
</div>
<div class="col-4" >

    <div v-if="order.deliveryType == 'at-home'">
        <h6><strong>{{ "field.default.deliveryAddress"|trans({}, 'lcshop') }} : </strong></h6>
        <address v-html="order.deliveryAddress">
        </address>
    </div>

    <div v-else-if="order.deliveryType == 'point-sale'">
        <h6><strong>{{ "field.default.deliveryPointSale"|trans({}, 'lcshop') }} : </strong></h6>
        <address v-html="order.deliveryPointSale">
        </address>
    </div>
    <div v-else>
        Aucun lieu de livraison défini.
    </div>

    <button type="button" class="btn btn-default" data-toggle="modal" data-target="#modal-order-delivery-address">
        {{ "action.edit"|trans }}
    </button>
</div>
<div class="col-4">
    <h6><strong>{{ "field.default.invoiceAddress"|trans({}, 'lcshop') }}</strong></h6>
    <address v-html="order.invoiceAddress">
    </address>
    <button type="button" class="btn btn-default" data-toggle="modal" data-target="#modal-order-invoice-address">
        {{ "action.edit"|trans }}
    </button>
</div>
<div class="col-12">
    <h6><strong>{{ "field.default.deliveryAvailabilty"|trans({}, 'lcshop') }} : </strong></h6>
    <div v-if="order.deliveryType == 'at-home'">
        <div v-html="order.deliveryAvailabilityZone">
        </div>
    </div>
    <div v-else-if="order.deliveryType == 'point-sale'">
        <div v-html="order.deliveryAvailabilityPointSale">
        </div>
    </div>
    <button type="button" class="btn btn-default" data-toggle="modal" data-target="#modal-order-delivery-availability">
        {{ "action.edit"|trans }}
    </button>
</div>
<div class="col-12">

    {{ form_start(form_order_products, {'attr': {'id' : 'orderProductsForm'}}) }}

    <script>
        window.templateTest = '{{ orderMacros.productsTemplate(form_order_products)|replace({"\n":' ', "\r":' ', "'" : "\\'"})|raw  }}';
    </script>
    {{ orderMacros.tableHead() }}
    {{ orderMacros.products(form_order_products) }}
    {{ orderMacros.tableTotal() }}

    {{ form_end(form_order_products) }}

    <div class="clearfix"></div>
    <script>
        window.orderObject = {{ order|json_encode|raw }};
    </script>

    <h6><strong>Réductions</strong></h6>
    ${order.orderReductionCart}
    <button type="button" class="btn btn-default" data-toggle="modal" data-target="#modal-reduction-cart">
        {{ "action.addReductionCart"|trans }}
    </button>
<br />
    ${order.orderReductionCredit}
    <button type="button" class="btn btn-default" data-toggle="modal" data-target="#modal-reduction-credit">
        {{ "action.addReductionCredit"|trans }}
    </button>
</div>


{{ macros.cardOverlay('isLoading') }}
{{ macros.endCard(9) }}
