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

<div class="page-head">
  <div>
    <h1>{lang key="admin.users_title"}</h1>
    <p class="muted">{lang key="admin.news_total"}: {pagination.total}</p>
  </div>
  <div class="actions">
    <a class="btn btn-primary" href="/admin/users/create">{lang key="admin.users_new"}</a>
  </div>
</div>

<table class="table">
  <thead>
    <tr>
      <th>#</th>
      <th>{lang key="admin.name"}</th>
      <th>{lang key="admin.email"}</th>
      <th>{lang key="admin.role"}</th>
      <th>{lang key="admin.status"}</th>
      <th class="actions">{lang key="admin.actions"}</th>
    </tr>
  </thead>
  <tbody>
    [foreach var="users" as="u"]
      <tr>
        <td>{u.id}</td>
        <td><a href="/admin/users/{u.id}/edit" class="row-link">{u.name}</a></td>
        <td>{u.email}</td>
        <td><span class="badge badge-{u.role}">{u.role}</span></td>
        <td>
          [if {u.is_active}]<span class="muted">{lang key="admin.published"}</span>[else]<span class="muted">{lang key="admin.draft"}</span>[/if]
        </td>
        <td class="actions">
          <form method="post" action="/admin/users/{u.id}/delete" style="display:inline" data-confirm="{lang key=&quot;admin.delete_confirm&quot;}">
            {csrf}
            <button type="submit" class="danger" title="{lang key="admin.delete"}">{icon name="trash" size="16"}</button>
          </form>
        </td>
      </tr>
    [/foreach]
  </tbody>
</table>

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