Commits

Chris Beelby  committed cdca9c5

Added display of games you are currently in

  • Participants
  • Parent commits 2c3c547

Comments (0)

Files changed (1)

File upfront/templates/users/games.mako

 % endif
 <h2>Games In Progress</h2>
 % if games:
-...
+<table>
+<tr>
+    <th>Playing As</th>
+    <th>Opponent Playing As</th>
+    <th>Opponent</th>
+    <th>&nbsp;</th>
+</tr>
+<% i = 'a' %>
+% for id, game in games.iteritems():
+<tr class="row-${i}">
+    % if game.player1 == request.user:
+    <td>${game.player1nation.capitalize()}</td>
+    <td>${game.player2nation.capitalize()}</td>
+    <td>${game.player2.name}</td>
+    <td><a href="/games/${id}">View</a></td>
+    % else:
+    <td>${game.player2nation.capitalize()}</td>
+    <td>${game.player1nation.capitalize()}</td>
+    <td>${game.player1.name}</td>
+    <td><a href="/games/${id}">View</a></td>
+    % endif
+</tr>
+<%
+if i == 'a':
+    i = 'b'
+else:
+    i = 'a'
+%>
+% endfor
+</table>
 % else:
 <i>You are not currently in any active games</i>
 % endif