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

<div class="page-head">
  <div>
    <h1>Способы оплаты <span class="muted" style="font-weight:400">· {total}</span></h1>
    <p class="muted">{lang key="shop.payments_list.subtitle"}</p>
  </div>
  <div class="actions">
    <a class="btn btn-primary" href="/admin/shop/payments/create">+ {lang key="shop.shipping_list.new"}</a>
  </div>
</div>

[if {methods}]
<div class="prod-table-wrap">
<table class="table prod-table">
  <thead>
    <tr>
      <th>{lang key="shop.product.title"}</th>
      <th>{lang key="shop.attribute.type"}</th>
      <th>{lang key="shop.attributes_list.col.sort"}</th>
      <th>{lang key="shop.common.yes"}</th>
      <th class="actions"></th>
    </tr>
  </thead>
  <tbody>
    [foreach var="methods" as="m"]
      <tr>
        <td>
          <a href="/admin/shop/payments/{m.id}/edit" class="prod-title">{m.title}</a>
          <div class="prod-cell-sub">{m.description}</div>
        </td>
        <td><span class="prod-chip-cat">[if {m.kind}="cash"]{lang key="shop.payment_method.kind_cash_short"}[/if][if {m.kind}="card_offline"]{lang key="shop.payment_method.kind_card_short"}[/if][if {m.kind}="online_gateway"]{lang key="shop.payment_method.kind_gateway_short"}[/if][if {m.kind}="invoice"]{lang key="shop.payment_method.kind_invoice_short"}[/if]</span></td>
        <td>{m.sort_order}</td>
        <td>[if {m.is_active}]<span class="badge badge-published">{lang key="shop.common.yes"}</span>[else]<span class="badge badge-draft">{lang key="shop.common.no"}</span>[/if]</td>
        <td class="actions prod-row-actions">
          <a href="/admin/shop/payments/{m.id}/edit" class="btn btn-ghost btn-sm">{lang key="shop.common.edit_short"}</a>
          <form method="post" action="/admin/shop/payments/{m.id}/delete" style="display:inline" data-confirm="Удалить?" data-confirm-danger="1">
            {csrf}<button type="submit" class="row-icon-btn row-icon-danger" title="{lang key="shop.common.delete_title"}">{icon name="close" size="14"}</button>
          </form>
        </td>
      </tr>
    [/foreach]
  </tbody>
</table>
</div>
[else]
<div class="empty-state">
  <div class="icon">{icon name="credit_card" size="42"}</div>
  <p>{lang key="shop.payments_list.empty_title"}</p>
  <a href="/admin/shop/payments/create" class="btn btn-primary">{lang key="shop.common.add_first"}</a>
</div>
[/if]

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