about summary refs log tree commit diff
path: root/app/views/players/index.html.erb
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2022-02-01 09:38:44 -0500
committerBen Harris <ben@tilde.team>2022-02-01 09:38:44 -0500
commit9150b575075db8a2de75ab476c9c7801d2352242 (patch)
treee336d6242e6f7f9a10f4b040947e0a16414cb73b /app/views/players/index.html.erb
parentc00902c956dd336fa1bdc74603312c1c95ac9d6b (diff)
tidy up a bit
Diffstat (limited to 'app/views/players/index.html.erb')
-rw-r--r--app/views/players/index.html.erb53
1 files changed, 27 insertions, 26 deletions
diff --git a/app/views/players/index.html.erb b/app/views/players/index.html.erb
index 772d19a..2c011d3 100644
--- a/app/views/players/index.html.erb
+++ b/app/views/players/index.html.erb
@@ -1,33 +1,34 @@
-<% if not notice.nil? %><p style="color: green"><%= notice %></p><% end %>
+<% 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>
-        <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>
+  <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>