mirror of
https://github.com/danbee/chess
synced 2025-03-04 08:39:06 +00:00
38 lines
1.1 KiB
Elixir
38 lines
1.1 KiB
Elixir
<h2><%= gettext "Listing games" %></h2>
|
|
|
|
<table class="games-list">
|
|
<tbody>
|
|
<%= for game <- @games do %>
|
|
<tr class="<%= turn_class(current_user(@conn), game) %>">
|
|
<td>
|
|
<span class="games-list__player-indicator">
|
|
<img src="images/pawn_<%= player_colour(current_user(@conn), game) %>.svg">
|
|
</span>
|
|
<%= link gettext(
|
|
"Game with %{name}",
|
|
name: opponent(game, current_user(@conn).id).name
|
|
),
|
|
to: game_path(@conn, :show, game),
|
|
class: "btn btn-default btn-xs" %>
|
|
</td>
|
|
<td>
|
|
<%= state(current_user(@conn), game) %>
|
|
</td>
|
|
<td>
|
|
<%= won_lost(current_user(@conn), game) %>
|
|
</td>
|
|
<td class="text-right">
|
|
<%= link gettext("Delete"),
|
|
to: game_path(@conn, :delete, game),
|
|
method: :delete,
|
|
data: [confirm: gettext("Are you sure?")] %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>
|
|
<%= link gettext("New game"), to: game_path(@conn, :new), class: "button" %>
|
|
</p>
|