111 lines
3.0 KiB
Plaintext
111 lines
3.0 KiB
Plaintext
<h1>Upload Tournament Results (CSV)</h1>
|
|
|
|
<p>Upload a CSV file with Euchre tournament results. The format supports standard Euchre scoring with Odds/Evens teams.</p>
|
|
|
|
<form action="/admin/matches/process_upload" method="post" enctype="multipart/form-data">
|
|
<input type="hidden" name="_csrf_token" value="<%= csrf_token %>">
|
|
|
|
<div class="form-group">
|
|
<label for="event_id">Tournament:</label>
|
|
<select id="event_id" name="event_id" required>
|
|
<option value="">Select a tournament...</option>
|
|
<% if defined?(tournaments) && tournaments %>
|
|
<% tournaments.each do |tournament| %>
|
|
<option value="<%= tournament.id %>"><%= tournament.name %></option>
|
|
<% end %>
|
|
<% end %>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="csv_file">CSV File:</label>
|
|
<input type="file" id="csv_file" name="csv_file" accept=".csv" required>
|
|
</div>
|
|
|
|
<button type="submit" class="btn-primary">Upload Results</button>
|
|
</form>
|
|
|
|
<p><a href="/admin/matches">Back to Matches</a></p>
|
|
|
|
<h2>Euchre Tournament CSV Format</h2>
|
|
|
|
<p>The CSV should have the following columns:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Column</th>
|
|
<th>Description</th>
|
|
<th>Example</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>Event #</td>
|
|
<td>Tournament ID (can be omitted if selected above)</td>
|
|
<td>1</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Round</td>
|
|
<td>Round number</td>
|
|
<td>1</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Table</td>
|
|
<td>Table name (Clubs, Hearts, Diamonds, Spades, Stars)</td>
|
|
<td>Clubs</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Seat 1</td>
|
|
<td>Player name (Odds team, position 1)</td>
|
|
<td>Derrick</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Seat 3</td>
|
|
<td>Player name (Odds team, position 2)</td>
|
|
<td>Jesse C</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Odds Points</td>
|
|
<td>Score for Odds team</td>
|
|
<td>5</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Seat 2</td>
|
|
<td>Player name (Evens team, position 1)</td>
|
|
<td>Emma</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Seat 4</td>
|
|
<td>Player name (Evens team, position 2)</td>
|
|
<td>Alissa</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Evens Points</td>
|
|
<td>Score for Evens team</td>
|
|
<td>10</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Winner</td>
|
|
<td>"Odds" or "Evens" (optional, for validation)</td>
|
|
<td>Evens</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h2>Example CSV:</h2>
|
|
<pre style="background: #f5f5f5; padding: 1rem; border-radius: 4px; overflow-x: auto;">
|
|
Event #,Round,Table,Seat 1,Seat 3,Odds Points,Seat 2,Seat 4,Evens Points,Winner
|
|
1,1,Clubs,Derrick,Jesse C,5,Emma,Alissa,10,Evens
|
|
1,1,Hearts,Kevin,Andy,8,Ellie,Jesse,6,Odds
|
|
1,1,Diamonds,Sara M,Amelia,10,Mike G,AJ,4,Odds
|
|
</pre>
|
|
|
|
<h3>Notes:</h3>
|
|
<ul>
|
|
<li>Player names must match exactly (including middle initials if present)</li>
|
|
<li>Table names are mapped to numeric IDs (Clubs=1, Hearts=2, etc.)</li>
|
|
<li>New players will be created automatically if they don't exist</li>
|
|
<li>Teams are automatically created for each player pair</li>
|
|
<li>Elo ratings are calculated after import</li>
|
|
</ul>
|