jcbantuelle/dominion-meteor

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

Summary

Maintainability
Test Coverage
<template name="activeGames">
{{#with active_games}}
  <h2>Active Games</h2>
  <table class="table table-striped">
    <thead>
      <tr>
        <th>Date</th>
        <th>Players</th>
        <th>Cards</th>
        <th>View</th>
        <th>Actions</th>
      </tr>
    </thead>
    <tbody>
      {{#each games}}
        <tr>
          <td>{{created_at}}</td>
          <td>
            {{#each player in players}}
              <a href="/players/{{unstyled_username player}}">{{{player.username}}}</a>
            {{/each}}
          </td>
          <td>
            {{#each card_list}}
              <span class="lobby-card {{types}}">{{name}}</span>
            {{/each}}
            {{#each this.events}}
              <span class="lobby-card event">{{name}}</span>
            {{/each}}
          </td>
          <td><a href="/game/{{_id}}">View</a></td>
          <td><button class="btn btn-small btn-danger destroy-game" data-game-id="{{_id}}" type="submit" value="Destroy">Destroy</button></td>
        </tr>
      {{/each}}
    </tbody>
  </table>
{{/with}}
</template>