1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00
chess/lib/chess_web/templates/game/index.html.eex

24 lines
701 B
Elixir

<h2>Listing games</h2>
<table class="table">
<tbody>
<%= for game <- @games do %>
<tr>
<td>
<%= link "Game with #{opponent(@conn, game).name}", to: game_path(@conn, :show, game), class: "btn btn-default btn-xs" %>
</td>
<td>
Started on <%= Timex.format!(game.inserted_at, "%b %e at %I:%M %P", :strftime) %>
</td>
<td class="text-right">
<%= link "Delete", to: game_path(@conn, :delete, game), method: :delete, data: [confirm: "Are you sure?"], class: "btn btn-danger btn-xs" %>
</td>
</tr>
<% end %>
</tbody>
</table>
<p>
<%= link "New game", to: game_path(@conn, :new), class: "button" %>
</p>