tidy up, add git hash to src link

main
Ben Harris 6 months ago
parent c95a61fc05
commit b483ff56c6
  1. 2
      app/controllers/machines_controller.rb
  2. 2
      app/controllers/players_controller.rb
  3. 6
      app/views/machines/show.html.erb
  4. 2
      app/views/pages/index.html.erb
  5. 2
      app/views/players/index.html.erb
  6. 6
      app/views/players/show.html.erb
  7. 2
      config/initializers/constants.rb
  8. 2
      test/system/machines_test.rb
  9. 2
      test/system/players_test.rb

@ -52,7 +52,7 @@ class MachinesController < ApplicationController
@machine.destroy
respond_to do |format|
format.html { redirect_to machines_url, notice: 'Machine was successfully destroyed.' }
format.html { redirect_to machines_url, notice: 'Machine was successfully removed.' }
format.json { head :no_content }
end
end

@ -49,7 +49,7 @@ class PlayersController < ApplicationController
@player.destroy
respond_to do |format|
format.html { redirect_to players_url, notice: 'Player was successfully destroyed.' }
format.html { redirect_to players_url, notice: 'Player was successfully removed.' }
format.json { head :no_content }
end
end

@ -1,7 +1,9 @@
<p style="color: green"><%= notice %></p>
<% if not notice.nil? %><p style="color: green"><%= notice %></p><% end %>
<%= render "form", machine: @machine %>
<div>
<%= button_to "Delete #{@machine.name}", @machine, method: :delete %>
<%= link_to "Delete #{@machine.name} ❌", @machine, data: {
turbo_method: :delete,
turbo_confirm: "Are you sure you want to remove #{@machine.name}?"} %>
</div>

@ -1,3 +1,3 @@
<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>The source code for this app can be found <a href="https://tildegit.org/ben/pinrails">here</a>.</p>
<p>The source code for this app can be found <%= link_to 'here', "#{GIT_REPO}/src/commit/#{GIT_SHA}" %>.</p>

@ -18,7 +18,7 @@
<% if player.paid %>✓
<% end %></td>
<td><%= player.strikes %></td>
<td><%= link_to "X", player, data: {
<td><%= link_to "", player, data: {
turbo_method: :delete,
turbo_confirm: "Are you sure you want to remove #{player.name}?"
} %></td>

@ -1,7 +1,9 @@
<p style="color: green"><%= notice %></p>
<% if not notice.nil? %><p style="color: green"><%= notice %></p><% end %>
<%= render "form", player: @player %>
<div>
<%= button_to "Delete #{@player.name}", @player, method: :delete %>
<%= link_to "Delete #{@player.name} ❌", @player, data: {
turbo_method: :delete,
turbo_confirm: "Are you sure you want to remove #{@player.name}?"} %>
</div>

@ -0,0 +1,2 @@
GIT_SHA = `git rev-parse HEAD`.chomp
GIT_REPO = 'https://tildegit.org/ben/pinrails'

@ -37,6 +37,6 @@ class MachinesTest < ApplicationSystemTestCase
visit machine_url(@machine)
click_on "Delete #{@machine.name}", match: :first
assert_text 'Machine was successfully destroyed'
assert_text 'Machine was successfully removed'
end
end

@ -39,6 +39,6 @@ class PlayersTest < ApplicationSystemTestCase
visit player_url(@player)
click_on "Delete #{@player.name}", match: :first
assert_text 'Player was successfully destroyed'
assert_text 'Player was successfully removed'
end
end

Loading…
Cancel
Save