Files
sports-division/src/SportsDivision.Web/Views/Registration/Index.cshtml
warringtond 810f721e48 Fix all 45 audited bugs from bug-fixes.md
Verified every finding against the code, then fixed correctness (redirects,
advancement reset, duplicate heats, high-jump attempt entry, placement
ranking with tie handling, delete-dependency 500s), security (secrets out of
config, config-driven admin seed, login lockout, role authorization with
school scoping, heat-time IDOR, forwarded headers, last-admin guards),
schema integrity (nullable+filtered ExistingStudentId, unique indexes for
rounds/heats/bar heights via SchemaIntegrityFixes migration), performance
(N+1 removal in high jump/reports/standings/dashboard, SQL-side student
paging), and hygiene (duplicate notifications, auto-dismiss scope, local
bootstrap-icons, orphaned files, test-data.sql tournament creation).

FluentValidation is now registered; AutoMapper bumped to 14.0.0 (advisory
fully patched only in licence-changed 15.1.1 — documented). 11 new tests;
63/63 passing. Credential rotation and deploy-time DB_CONNECTION_STRING are
required manual follow-ups, documented in bug-fixes.md.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 08:30:53 -04:00

64 lines
2.3 KiB
Plaintext

@model IEnumerable<EventRegistrationDto>
@{
ViewData["Title"] = "Registrations";
var telId = ViewBag.TournamentEventLevelId as int?;
var eventName = ViewBag.EventName as string;
var levelName = ViewBag.LevelName as string;
}
<div class="d-flex justify-content-between align-items-center mb-3">
<div>
<h2>Registrations</h2>
@if (eventName != null) { <p class="text-muted mb-0">@eventName - @levelName</p> }
</div>
@if (telId.HasValue)
{
<a asp-action="Register" asp-route-tournamentEventLevelId="@telId" class="btn btn-primary">Register Student</a>
}
</div>
<table class="table table-striped table-hover">
<thead class="table-dark">
<tr>
<th>Student</th>
<th>School</th>
<th>Event</th>
<th>Level</th>
<th>Registered</th>
<th>Score</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@foreach (var r in Model)
{
<tr>
<td>@(r.StudentName ?? r.RelayTeamName ?? "N/A")</td>
<td>@r.SchoolName</td>
<td>@r.EventName</td>
<td>@r.EventLevelName</td>
<td>@r.RegisteredAt.ToString("MMM d, yyyy HH:mm")</td>
<td>
@if (r.Score != null)
{
<span class="badge bg-success">@r.Score.RawPerformance</span>
@if (r.Score.Placement.HasValue) { <span class="badge bg-warning text-dark">#@r.Score.Placement</span> }
}
else
{
<span class="text-muted">-</span>
}
</td>
<td>
<form asp-action="Unregister" method="post" class="d-inline">
<input type="hidden" name="eventRegistrationId" value="@r.EventRegistrationId" />
@if (telId.HasValue) { <input type="hidden" name="tournamentEventLevelId" value="@telId" /> }
<button type="submit" class="btn btn-sm btn-outline-danger" onclick="return confirm('Unregister?')">Remove</button>
</form>
</td>
</tr>
}
</tbody>
</table>