jcbantuelle/dominion-meteor

View on GitHub
app/admin/client/accounts.html

Summary

Maintainability
Test Coverage
<template name="accounts">
{{#with accounts}}
  {{#unless empty unapproved_players}}
    <h2>Unapproved Players</h2>
    <table class="table table-striped">
      <thead>
        <tr>
          <th>Username</th>
          <th>Email</th>
          <th>Approve</th>
          <th>Disable</th>
        </tr>
      </thead>
      <tbody>
        {{#each unapproved_players}}
          <tr>
            <td>{{username}}</td>
            <td>{{emails.[0].address}}</td>
            <td><button type="submit" data-player-id="{{_id}}" class="btn btn-success approve">Approve</button></td>
            <td><button type="submit" data-player-id="{{_id}}" class="btn btn-warning disable">Disable</button></td>
          </tr>
        {{/each}}
      </tbody>
    </table>
  {{/unless}}
  <h2>Approved Players</h2>
  <table class="table table-striped">
    <thead>
      <tr>
        <th>Username</th>
        <th>Email</th>
        <th>Unapprove</th>
        <th>Disable</th>
      </tr>
    </thead>
    <tbody>
      {{#each approved_players}}
        <tr>
          <td>{{username}}</td>
          <td>{{emails.[0].address}}</td>
          <td><button type="submit" data-player-id="{{_id}}" class="btn btn-danger unapprove">Unapprove</button></td>
          <td><button type="submit" data-player-id="{{_id}}" class="btn btn-warning disable">Disable</button></td>
        </tr>
      {{/each}}
    </tbody>
  </table>
  {{#unless empty disabled_players}}
    <h2>Disabled Players</h2>
    <table class="table table-striped">
      <thead>
        <tr>
          <th>Username</th>
          <th>Email</th>
          <th>Enable</th>
        </tr>
      </thead>
      <tbody>
        {{#each disabled_players}}
          <tr>
            <td>{{username}}</td>
            <td>{{emails.[0].address}}</td>
            <td><button type="submit" data-player-id="{{_id}}" class="btn btn-success enable">Enable</button></td>
          </tr>
        {{/each}}
      </tbody>
    </table>
  {{/unless}}
{{/with}}
</template>