Add Elo rating system with match entry and CSV upload

- Implement EloCalculator service for 2v2 Euchre matches
- Create background job processing with GoodJob
- Add single match entry form
- Add CSV upload for batch match entry
- Create player rankings view
- Add database schema for matches and elo snapshots
This commit is contained in:
2026-03-26 16:28:24 -07:00
parent 1a9b3496e1
commit 1268889a78
31 changed files with 865 additions and 2 deletions
+66
View File
@@ -0,0 +1,66 @@
<h1>Enter New Match</h1>
<form action="/admin/matches" method="post">
<input type="hidden" name="_csrf_token" value="<%= csrf_token %>">
<div>
<label for="played_at">Date/Time:</label>
<input type="datetime-local" id="played_at" name="played_at" required value="<%= Time.now.strftime('%Y-%m-%dT%H:%M') %>">
</div>
<fieldset>
<legend>Team 1</legend>
<div>
<label for="team_1_p1_id">Player 1:</label>
<select id="team_1_p1_id" name="team_1_p1_id" required>
<option value="">Select player...</option>
<% players.each do |player| %>
<option value="<%= player.id %>"><%= player.name %></option>
<% end %>
</select>
</div>
<div>
<label for="team_1_p2_id">Player 2:</label>
<select id="team_1_p2_id" name="team_1_p2_id" required>
<option value="">Select player...</option>
<% players.each do |player| %>
<option value="<%= player.id %>"><%= player.name %></option>
<% end %>
</select>
</div>
<div>
<label for="team_1_score">Score:</label>
<input type="number" id="team_1_score" name="team_1_score" min="0" max="10" required value="10">
</div>
</fieldset>
<fieldset>
<legend>Team 2</legend>
<div>
<label for="team_2_p1_id">Player 1:</label>
<select id="team_2_p1_id" name="team_2_p1_id" required>
<option value="">Select player...</option>
<% players.each do |player| %>
<option value="<%= player.id %>"><%= player.name %></option>
<% end %>
</select>
</div>
<div>
<label for="team_2_p2_id">Player 2:</label>
<select id="team_2_p2_id" name="team_2_p2_id" required>
<option value="">Select player...</option>
<% players.each do |player| %>
<option value="<%= player.id %>"><%= player.name %></option>
<% end %>
</select>
</div>
<div>
<label for="team_2_score">Score:</label>
<input type="number" id="team_2_score" name="team_2_score" min="0" max="10" required value="7">
</div>
</fieldset>
<button type="submit">Save Match</button>
</form>
<p><a href="/admin/matches">Back to Matches</a></p>