From c95a61fc056f6a2d7fdb82f9288948a890a3bac5 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Mon, 31 Jan 2022 14:00:13 -0500 Subject: switch to table, add total counts --- app/views/layouts/application.html.erb | 9 ++++----- app/views/machines/index.html.erb | 4 +++- app/views/pages/index.html.erb | 1 + app/views/players/index.html.erb | 30 ++++++++++++++++++++++++++---- 4 files changed, 34 insertions(+), 10 deletions(-) (limited to 'app/views') diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index cc2f6c2..7795f10 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -12,12 +12,11 @@ - <%= yield %> diff --git a/app/views/machines/index.html.erb b/app/views/machines/index.html.erb index 8237518..3791f6c 100644 --- a/app/views/machines/index.html.erb +++ b/app/views/machines/index.html.erb @@ -1,4 +1,4 @@ -

<%= notice %>

+<% if not notice.nil? %>

<%= notice %>

<% end %>

Pins

@@ -8,5 +8,7 @@ <% end %> +

<%= pluralize(@machines.count, 'total pin') %>

+
<%= link_to "Add a pin", new_machine_path %> diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb index 809ea04..ddfa22f 100644 --- a/app/views/pages/index.html.erb +++ b/app/views/pages/index.html.erb @@ -1,2 +1,3 @@

Knockout

To start the tournament, add players and make sure that the pins are up to date. Then hit randomize to automatically pick teams!

+

The source code for this app can be found here.

\ No newline at end of file diff --git a/app/views/players/index.html.erb b/app/views/players/index.html.erb index c067483..eb209b0 100644 --- a/app/views/players/index.html.erb +++ b/app/views/players/index.html.erb @@ -1,12 +1,34 @@ -

<%= notice %>

+<% if not notice.nil? %>

<%= notice %>

<% end %>

Players

- <% @players.each do |player| %> - <%= render player %> - <% end %> + + + + + + + + + <% @players.each do |player| %> + + + + + + + <% end %> + +
NamePaidStrikesDelete
<%= link_to player.name, player %> + <% if player.paid %>✓ + <% end %><%= player.strikes %><%= link_to "X", player, data: { + turbo_method: :delete, + turbo_confirm: "Are you sure you want to remove #{player.name}?" + } %>
+

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

+
<%= link_to "Add a player", new_player_path %> -- cgit 1.4.1