{#
 # For the full copyright and license information, please view the
 # docs/licenses/LICENSE.txt file that was distributed with this source code.
 #}

<div class="card" data-role="order-information">
  <h3 class="card-header">{{ 'Cart information'|trans({}, 'Admin.Orderscustomers.Feature') }}</h3>
  <div class="card-body">
    <p class="mb-0">
      {{ 'Created:'|trans({}, 'Admin.Orderscustomers.Feature') }}
      {{ cartView.cartSummary.date_add }}
    </p>
    <p class="mb-0">
      {{ 'Last updated:'|trans({}, 'Admin.Orderscustomers.Feature') }}
      {{ cartView.cartSummary.date_upd }}
    </p>
    <hr class="mt-2 mb-2">
    {% if cartView.orderInformation.id is not empty %}

      <p>{{ 'Order %orderid% was created from this cart on %orderdate%.'|trans({}, 'Admin.Orderscustomers.Feature')|replace({
        '%orderid%': '<a href="' ~ path('admin_orders_view', {orderId: cartView.orderInformation.id}) ~ '">#' ~ cartView.orderInformation.id|format('"%06d') ~ '</a>',
        '%orderdate%': cartView.orderInformation.placed_date,
      })|raw_purified }}</p>

      <a href="{{ path('admin_orders_view', {orderId: cartView.orderInformation.id}) }}" class="btn btn-primary">
        <i class="material-icons">remove_red_eye</i>
        {{ 'View order'|trans({}, 'Admin.Orderscustomers.Feature') }}
      </a>
    {% else %}
      <p class="mb-0">{{ 'The customer has not proceeded to checkout yet.'|trans({}, 'Admin.Orderscustomers.Feature') }}</p>

      {% if cartView.customerInformation.id %}
        <a href="{{ createOrderFromCartLink }}" class="btn btn-primary mt-3" id="create-order-from-cart">
          <i class="material-icons">add_circle_outline</i>
          {{ 'Create an order from this cart'|trans({}, 'Admin.Orderscustomers.Feature') }}
        </a>
      {% endif %}
    {% endif %}
  </div>
</div>
