pinrails/app/views/players/index.html.erb

37 lines
892 B
Plaintext
Raw Normal View History

2022-02-01 14:38:44 +00:00
<% if not notice.nil? %><p style="color: green"><%= notice %></p>
<% end %>
2022-01-15 17:10:26 +00:00
<h1>Players</h1>
<% if @players.any? %>
2022-02-01 14:38:44 +00:00
<div id="players">
<table>
<thead>
<th>Name</th>
<th>Paid</th>
<th>Strikes</th>
<th>Delete</th>
</thead>
<tbody>
<% @players.each do |player| %>
<tr id="<%= dom_id player %>">
<td><%= link_to player.name, player %></td>
<td>
<% if player.paid %>✓
<% end %></td>
<td><%= player.strikes %></td>
<td><%= link_to "❌", player, data: {
turbo_method: :delete,
turbo_confirm: "Are you sure you want to remove #{player.name}?"
} %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %>
2022-01-15 17:10:26 +00:00
2022-01-31 19:00:13 +00:00
<p><%= pluralize(@players.count, 'total player') %></p>
2022-01-15 19:08:29 +00:00
<%= link_to "Add a player", new_player_path %>