about summary refs log blame commit diff
path: root/app/views/players/index.html.erb
blob: 2c011d3b0ae622918dd94dba0d1742be66d17e7e (plain) (tree)
1
2
3
4
5
6

                                                                 


                
                      
























                                                                            
         
 

                                                       
                                              
<% if not notice.nil? %><p style="color: green"><%= notice %></p>
<% end %>

<h1>Players</h1>

<% if @players.any? %>
  <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 %>

<p><%= pluralize(@players.count, 'total player') %></p>

<%= link_to "Add a player", new_player_path %>