<h2>Users</h2>

<table class="usertable">
  <tr>
    <th>Name</th>
    <th>Can change</th>
    <th></th>
  </tr>
  <?for user $arg?>
    <tr>
      <td>
        <?if siteInfo.showStoreList?><?t user.name?><?else?><a href="#query/s/[?t user.name?]"><?t user.name?></a><?if.?>
      </td>
      <td>
        <?for role, label in userRoles?>
          <input type="checkbox" id="role-[?t role?]" <?if member(role, user.roles)?>checked<?if.?>
                 <?if user.name == window.user.name?>disabled<?if.?>>
          <?event click updateRole(user, role, $node.checked);?>
          <?event change updateRole(user, role, $node.checked);?>
          <label for="role-[?t role?]"><?t label?></label>
        <?for.?>
      </td>
      <td>
        <?if user.name != window.user.name?>
          <span class="linkish">delete</span>
          <?event click deleteUser(user.name);?>
        <?if.?>
      </td>
    </tr>
  <?for.?>
</table>

<p id="userlist-loading" style="visibility: hidden"><?throb?> Working...</p>
