{include file="_partials/head.tpl"}
<link rel="stylesheet" href="/public/assets/account/account.css">

<div class="acc-container">
  <nav class="acc-breadcrumbs" aria-label="Навигация"><a href="/">Главная</a> <span>/</span> <a href="/account">Кабинет</a> <span>/</span> <span>Заказы</span></nav>

  <div class="acc-layout">
    {include file="account/_nav.tpl"}

    <main class="acc-main">
      {include file="account/_flash.tpl"}

      <header class="acc-head">
        <h1 class="acc-head__title">Мои заказы</h1>
        <p class="acc-head__sub">История ваших покупок.</p>
      </header>

      [if {orders_empty}="1"]
        <div class="acc-empty">
          <p>У вас пока нет заказов.</p>
          <a class="acc-btn acc-btn--primary" href="/shop">Перейти в каталог</a>
        </div>
      [else]
        <div class="acc-orders">
          [foreach var="orders" as="o"]
            <a href="/account/orders/{o.number}" class="acc-order">
              <span class="acc-order__main">
                <span class="acc-order__num">№ {o.number}</span>
                <span class="acc-order__date">{o.date_fmt}</span>
              </span>
              <span class="acc-status acc-status--{o.status}">{o.status_label}</span>
              <span class="acc-order__total">{price amount="{o.total}"}</span>
              <span class="acc-order__arrow">{icon name="arrow_right" size="16"}</span>
            </a>
          [/foreach]
        </div>
      [/if]
    </main>
  </div>
</div>

{include file="_partials/foot.tpl"}
