many bug fixes and features added
This commit is contained in:
@@ -6,12 +6,25 @@
|
||||
var levels = ViewBag.Levels as IEnumerable<EventLevelDto>;
|
||||
}
|
||||
|
||||
@{
|
||||
var statusClass = Model.Status switch {
|
||||
TournamentStatus.Draft => "bg-secondary",
|
||||
TournamentStatus.Registration => "bg-info",
|
||||
TournamentStatus.InProgress => "bg-primary",
|
||||
TournamentStatus.Completed => "bg-success",
|
||||
_ => "bg-dark"
|
||||
};
|
||||
}
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<div>
|
||||
<h2>@Model.Name</h2>
|
||||
<h2 class="mb-1">
|
||||
@Model.Name
|
||||
<span class="badge @statusClass align-middle">@Model.Status</span>
|
||||
@if (Model.IsArchived) { <span class="badge bg-dark align-middle">Archived</span> }
|
||||
</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">
|
||||
<div class="d-flex gap-2 flex-wrap justify-content-end">
|
||||
@if (Model.Status == TournamentStatus.Draft)
|
||||
{
|
||||
<form asp-action="UpdateStatus" method="post">
|
||||
@@ -27,16 +40,53 @@
|
||||
<input type="hidden" name="status" value="InProgress" />
|
||||
<button type="submit" class="btn btn-primary">Start Tournament</button>
|
||||
</form>
|
||||
<form asp-action="UpdateStatus" method="post">
|
||||
<input type="hidden" name="id" value="@Model.TournamentId" />
|
||||
<input type="hidden" name="status" value="Draft" />
|
||||
<button type="submit" class="btn btn-outline-secondary"
|
||||
onclick="return confirm('Revert this tournament back to Draft?')">Back to Draft</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>
|
||||
<button type="submit" class="btn btn-success"
|
||||
onclick="return confirm('Mark "@Model.Name" as Completed?\n\nYou can reopen it later if this was a mistake.')">Complete</button>
|
||||
</form>
|
||||
<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-outline-secondary"
|
||||
onclick="return confirm('Move this tournament back to Registration?')">Back to Registration</button>
|
||||
</form>
|
||||
}
|
||||
@if (Model.Status == TournamentStatus.Completed)
|
||||
{
|
||||
<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-warning"
|
||||
onclick="return confirm('Reopen this completed tournament and set it back to In Progress?')">Reopen Tournament</button>
|
||||
</form>
|
||||
}
|
||||
<a asp-action="Edit" asp-route-id="@Model.TournamentId" class="btn btn-outline-primary">Edit</a>
|
||||
@if (!Model.IsArchived)
|
||||
{
|
||||
<form asp-action="Archive" method="post">
|
||||
<input type="hidden" name="id" value="@Model.TournamentId" />
|
||||
<button type="submit" class="btn btn-outline-dark"
|
||||
onclick="return confirm('Archive this tournament? It will be hidden from the default list but not deleted, and can be restored later.')">Archive</button>
|
||||
</form>
|
||||
}
|
||||
else
|
||||
{
|
||||
<form asp-action="Unarchive" method="post">
|
||||
<input type="hidden" name="id" value="@Model.TournamentId" />
|
||||
<button type="submit" class="btn btn-outline-dark">Unarchive</button>
|
||||
</form>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -76,7 +126,15 @@
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<a asp-controller="TrackEvent" asp-action="Index" asp-route-tournamentEventLevelId="@tel.TournamentEventLevelId" class="btn btn-sm btn-outline-success">Scoring</a>
|
||||
@{
|
||||
var scoringController = tel.Category switch
|
||||
{
|
||||
EventCategory.Field => "FieldEvent",
|
||||
EventCategory.HighJump => "HighJump",
|
||||
_ => "TrackEvent"
|
||||
};
|
||||
}
|
||||
<a asp-controller="@scoringController" 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" />
|
||||
|
||||
Reference in New Issue
Block a user