diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/layouts/application.html.erb | 35 | ||||
-rw-r--r-- | app/views/machines/index.html.erb | 8 | ||||
-rw-r--r-- | app/views/machines/show.html.erb | 7 | ||||
-rw-r--r-- | app/views/pages/index.html.erb | 3 | ||||
-rw-r--r-- | app/views/players/_player.html.erb | 4 | ||||
-rw-r--r-- | app/views/players/index.html.erb | 53 | ||||
-rw-r--r-- | app/views/players/show.html.erb | 7 |
7 files changed, 66 insertions, 51 deletions
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 @@ <!DOCTYPE html> <html lang="en"> - <head> - <title>Knockout</title> - <meta name="viewport" content="width=device-width,initial-scale=1"> - <%= csrf_meta_tags %> - <%= csp_meta_tag %> +<head> + <title>Knockout</title> + <meta name="viewport" content="width=device-width,initial-scale=1"> + <%= csrf_meta_tags %> + <%= csp_meta_tag %> - <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> - <%= javascript_importmap_tags %> - </head> + <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> + <%= javascript_importmap_tags %> + <%= favicon_link_tag asset_path('favicon.png') %> +</head> - <body> - <nav> - <%= link_to 'Home', root_path, class: "#{"current" if current_page?(root_path)}" %> - <%= link_to 'Pins', machines_path, class: "#{"current" if current_page?(machines_path)}" %> - <%= link_to 'Players', players_path, class: "#{"current" if current_page?(players_path)}" %> - <%= link_to 'Randomize', {controller: 'pages', action: 'randomize'}, class: "#{"current" if current_page?(controller: 'pages', action: 'randomize')}" %> - </nav> - <%= yield %> - </body> +<body> +<nav> + <%= link_to 'Home', root_path, class: "#{"current" if current_page?(root_path)}" %> + <%= link_to 'Pins', machines_path, class: "#{"current" if current_page?(machines_path)}" %> + <%= link_to 'Players', players_path, class: "#{"current" if current_page?(players_path)}" %> + <%= link_to 'Randomize', { controller: 'pages', action: 'randomize' }, class: "#{"current" if current_page?(controller: 'pages', action: 'randomize')}" %> +</nav> +<%= yield %> +</body> </html> 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? %><p style="color: green"><%= notice %></p><% end %> +<% if not notice.nil? %><p style="color: green"><%= notice %></p> +<% end %> <h1>Pins</h1> <div id="machines"> <% @machines.each do |machine| %> - <%= render machine %> + <p id="<%= dom_id machine %>"> + <%= link_to machine.name, machine %> + <small><%= machine.edition %></small> + </p> <% end %> </div> 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? %><p style="color: green"><%= notice %></p><% end %> +<% if not notice.nil? %><p style="color: green"><%= notice %></p> +<% end %> + +<h1><%= @machine.name %></h1> <%= render "form", machine: @machine %> <div> <%= 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}?" } %> </div> 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 @@ <h1>Knockout</h1> -<p>To start the tournament, add players and make sure that the pins are up to date. Then hit randomize to automatically pick teams!</p> +<p>To start the tournament, add players and make sure that the pins are up to date. Then hit randomize to automatically + pick teams!</p> <p>The source code for this app can be found <%= link_to 'here', "#{GIT_REPO}/src/commit/#{GIT_SHA}" %>.</p> 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 %> <% end %> + <% if player.paid %>✓ + <% else %> + <% 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> |