{{define "content"}}
<div class="card">
  <h2>Журнал заявок ({{len .Items}})</h2>
  {{if .Items}}
  <table>
    <thead><tr><th>Создана</th><th>ID</th><th>GUID M2M</th><th>Инвестор</th><th>ЦБ</th><th>Передающий</th><th>Принимающий</th><th>Статус</th><th></th></tr></thead>
    <tbody>
      {{range .Items}}
      <tr>
        <td>{{.CreatedAt.Format "02.01 15:04:05"}}</td>
        <td><code>{{slice .ID 0 8}}</code></td>
        <td><code>{{slice (printf "%s" .M2MGUID) 0 8}}</code></td>
        <td>{{.Investor.LastName}} {{slice .Investor.FirstName 0 1}}.</td>
        <td>{{len .Securities}}</td>
        <td><code>{{.TransferringDepositoryINN}}</code></td>
        <td><code>{{.ReceivingDepositoryINN}}</code></td>
        <td><span class="badge {{.Status}}">{{ruState .Status}}</span></td>
        <td><a href="/admin/claims/{{.ID}}">детали →</a></td>
      </tr>
      {{end}}
    </tbody>
  </table>
  {{else}}
  <p class="muted">Пусто.</p>
  {{end}}
</div>
{{end}}
