Initial Commit

This commit is contained in:
2026-03-01 15:14:42 -04:00
commit f60174625e
377 changed files with 98166 additions and 0 deletions

View File

@@ -0,0 +1,123 @@
@model TournamentDto
@{
ViewData["Title"] = Model.Name;
var eventLevels = ViewBag.EventLevels as IEnumerable<TournamentEventLevelDto>;
var events = ViewBag.Events as IEnumerable<EventDto>;
var levels = ViewBag.Levels as IEnumerable<EventLevelDto>;
}
<div class="d-flex justify-content-between align-items-center mb-3">
<div>
<h2>@Model.Name</h2>
<p class="text-muted mb-0">@Model.StartDate.ToString("MMMM d") - @Model.EndDate.ToString("MMMM d, yyyy")</p>
</div>
<div class="d-flex gap-2">
@if (Model.Status == TournamentStatus.Draft)
{
<form asp-action="UpdateStatus" method="post">
<input type="hidden" name="id" value="@Model.TournamentId" />
<input type="hidden" name="status" value="Registration" />
<button type="submit" class="btn btn-info">Open Registration</button>
</form>
}
@if (Model.Status == TournamentStatus.Registration)
{
<form asp-action="UpdateStatus" method="post">
<input type="hidden" name="id" value="@Model.TournamentId" />
<input type="hidden" name="status" value="InProgress" />
<button type="submit" class="btn btn-primary">Start Tournament</button>
</form>
}
@if (Model.Status == TournamentStatus.InProgress)
{
<form asp-action="UpdateStatus" method="post">
<input type="hidden" name="id" value="@Model.TournamentId" />
<input type="hidden" name="status" value="Completed" />
<button type="submit" class="btn btn-success">Complete</button>
</form>
}
<a asp-action="Edit" asp-route-id="@Model.TournamentId" class="btn btn-outline-primary">Edit</a>
</div>
</div>
<partial name="_Notification" />
<div class="row">
<div class="col-md-8">
<div class="card shadow-sm mb-4">
<div class="card-header d-flex justify-content-between align-items-center" style="background-color: #003366; color: white;">
<h5 class="mb-0">Event Levels</h5>
</div>
<div class="card-body p-0">
@if (eventLevels != null && eventLevels.Any())
{
<table class="table table-hover mb-0">
<thead>
<tr><th>Event</th><th>Level</th><th>Registrations</th><th>Waiver</th><th>Actions</th></tr>
</thead>
<tbody>
@foreach (var tel in eventLevels)
{
<tr>
<td>@tel.EventName</td>
<td>@tel.EventLevelName</td>
<td>
<a asp-controller="Registration" asp-action="Index" asp-route-tournamentEventLevelId="@tel.TournamentEventLevelId">
@tel.RegistrationCount registrations
</a>
</td>
<td>
<form asp-action="ToggleAgeWaiver" method="post" class="d-inline">
<input type="hidden" name="tournamentEventLevelId" value="@tel.TournamentEventLevelId" />
<input type="hidden" name="id" value="@Model.TournamentId" />
<button type="submit" class="btn btn-sm @(tel.AgeRestrictionWaived ? "btn-warning" : "btn-outline-secondary")">
@(tel.AgeRestrictionWaived ? "Waived" : "Normal")
</button>
</form>
</td>
<td>
<a asp-controller="TrackEvent" asp-action="Index" asp-route-tournamentEventLevelId="@tel.TournamentEventLevelId" class="btn btn-sm btn-outline-success">Scoring</a>
<form asp-action="RemoveEventLevel" method="post" class="d-inline">
<input type="hidden" name="tournamentEventLevelId" value="@tel.TournamentEventLevelId" />
<input type="hidden" name="id" value="@Model.TournamentId" />
<button type="submit" class="btn btn-sm btn-outline-danger" onclick="return confirm('Remove this event level?')">Remove</button>
</form>
</td>
</tr>
}
</tbody>
</table>
}
else
{
<p class="text-muted p-3">No event levels configured. Add event levels using the form.</p>
}
</div>
</div>
</div>
<div class="col-md-4">
<div class="card shadow-sm">
<div class="card-header bg-dark text-white">
<h6 class="mb-0">Add Event Level</h6>
</div>
<div class="card-body">
<form asp-action="AddEventLevel" method="post">
<input type="hidden" name="TournamentId" value="@Model.TournamentId" />
<div class="mb-3">
<label class="form-label">Event</label>
<select name="EventId" class="form-select form-select-sm">
@if (events != null) { @foreach (var e in events) { <option value="@e.EventId">@e.Name (@e.Category)</option> } }
</select>
</div>
<div class="mb-3">
<label class="form-label">Level</label>
<select name="EventLevelId" class="form-select form-select-sm">
@if (levels != null) { @foreach (var l in levels) { <option value="@l.EventLevelId">@l.Name</option> } }
</select>
</div>
<button type="submit" class="btn btn-primary btn-sm w-100">Add</button>
</form>
</div>
</div>
</div>
</div>