about summary refs log tree commit diff
path: root/app/views/players
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/players')
-rw-r--r--app/views/players/_player.html.erb4
-rw-r--r--app/views/players/index.html.erb53
-rw-r--r--app/views/players/show.html.erb7
3 files changed, 35 insertions, 29 deletions
diff --git a/app/views/players/_player.html.erb b/app/views/players/_player.html.erb
index 4d1abeb..4002ea5 100644
--- a/app/views/players/_player.html.erb
+++ b/app/views/players/_player.html.erb
@@ -1,6 +1,8 @@
 <div id="<%= dom_id player %>">
   <p>
-    <% if player.paid %>✓<% else %>&nbsp;<% end %>
+    <% if player.paid %>✓
+    <% else %>&nbsp;
+    <% end %>
     <%= link_to player.name, player %>
   </p>
 </div>
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>
diff --git a/app/views/players/show.html.erb b/app/views/players/show.html.erb
index 3d0bb78..bd72bd3 100644
--- a/app/views/players/show.html.erb
+++ b/app/views/players/show.html.erb
@@ -1,9 +1,12 @@
-<% if not notice.nil? %><p style="color: green"><%= notice %></p><% end %>
+<% if not notice.nil? %><p style="color: green"><%= notice %></p>
+<% end %>
+
+<h1><%= @player.name %></h1>
 
 <%= render "form", player: @player %>
 
 <div>
   <%= link_to "Delete #{@player.name} ❌", @player, data: {
     turbo_method: :delete,
-    turbo_confirm: "Are you sure you want to remove #{@player.name}?"} %>
+    turbo_confirm: "Are you sure you want to remove #{@player.name}?" } %>
 </div>