From 9150b575075db8a2de75ab476c9c7801d2352242 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Tue, 1 Feb 2022 09:38:44 -0500 Subject: tidy up a bit --- app/views/layouts/application.html.erb | 35 +++++++++++----------- app/views/machines/index.html.erb | 8 +++-- app/views/machines/show.html.erb | 7 +++-- app/views/pages/index.html.erb | 3 +- app/views/players/_player.html.erb | 4 ++- app/views/players/index.html.erb | 53 +++++++++++++++++----------------- app/views/players/show.html.erb | 7 +++-- 7 files changed, 66 insertions(+), 51 deletions(-) (limited to 'app/views') diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7795f10..ae0092e 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,22 +1,23 @@ - - Knockout - - <%= csrf_meta_tags %> - <%= csp_meta_tag %> + + Knockout + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> - <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> - <%= javascript_importmap_tags %> - + <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> + <%= javascript_importmap_tags %> + <%= favicon_link_tag asset_path('favicon.png') %> + - - - <%= yield %> - + + +<%= yield %> + diff --git a/app/views/machines/index.html.erb b/app/views/machines/index.html.erb index a20a543..bde59c2 100644 --- a/app/views/machines/index.html.erb +++ b/app/views/machines/index.html.erb @@ -1,10 +1,14 @@ -<% if not notice.nil? %>

<%= notice %>

<% end %> +<% if not notice.nil? %>

<%= notice %>

+<% end %>

Pins

<% @machines.each do |machine| %> - <%= render machine %> +

+ <%= link_to machine.name, machine %> + <%= machine.edition %> +

<% end %>
diff --git a/app/views/machines/show.html.erb b/app/views/machines/show.html.erb index 4bba20c..584dac6 100644 --- a/app/views/machines/show.html.erb +++ b/app/views/machines/show.html.erb @@ -1,9 +1,12 @@ -<% if not notice.nil? %>

<%= notice %>

<% end %> +<% if not notice.nil? %>

<%= notice %>

+<% end %> + +

<%= @machine.name %>

<%= render "form", machine: @machine %>
<%= link_to "Delete #{@machine.name} ❌", @machine, data: { turbo_method: :delete, - turbo_confirm: "Are you sure you want to remove #{@machine.name}?"} %> + turbo_confirm: "Are you sure you want to remove #{@machine.name}?" } %>
diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb index e9456ca..32cfa7f 100644 --- a/app/views/pages/index.html.erb +++ b/app/views/pages/index.html.erb @@ -1,3 +1,4 @@

Knockout

-

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

+

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 <%= link_to 'here', "#{GIT_REPO}/src/commit/#{GIT_SHA}" %>.

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 @@

- <% if player.paid %>✓<% else %> <% end %> + <% if player.paid %>✓ + <% else %>  + <% end %> <%= link_to player.name, player %>

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? %>

<%= notice %>

<% end %> +<% if not notice.nil? %>

<%= notice %>

+<% end %>

Players

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

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

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? %>

<%= notice %>

<% end %> +<% if not notice.nil? %>

<%= notice %>

+<% end %> + +

<%= @player.name %>

<%= render "form", player: @player %>
<%= 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}?" } %>
-- cgit 1.4.1