{% import '@SyliusUi/Macro/messages.html.twig' as messages %}
{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %}
{% import "@SyliusAdmin/Common/Macro/money.html.twig" as money %}

<h3 class="ui top attached header">{{ 'sylius.ui.new_orders'|trans }}</h3>
<div class="ui attached segment">
    {% if orders|length > 0 %}
        <table class="ui stackable very basic table" id="orders">
            <thead>
                <th style="color: #ababab;">{{ 'sylius.ui.order'|trans }}</th>
                <th style="color: #ababab;">{{ 'sylius.ui.items'|trans }}</th>
                <th style="color: #ababab;">{{ 'sylius.ui.total'|trans }}</th>
                <th></th>
            </thead>
            <tbody>
            {% for order in orders %}
                <tr>
                    <td>
                        <strong>{{ order.customer.fullName }}</strong><br>
                        <div style="color: #ababab;">{{ order.customer.email }}</div>
                    </td>
                    <td>
                        {{ order.totalQuantity }}
                    </td>
                    <td>
                        {{ money.format(order.total, order.currencyCode) }}
                    </td>
                    <td>
                        <div class="ui right floated buttons">
                            {{ buttons.show(path('sylius_admin_order_show', {'id': order.id})) }}
                        </div>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    {% else %}
        {{ messages.info('sylius.ui.no_results_to_display') }}
    {% endif %}
</div>
