Cleaned up game delete view

This commit is contained in:
Pat Hartl 2023-01-07 18:55:06 -06:00
parent 6993983a01
commit c216b1e409

View file

@ -4,54 +4,62 @@
ViewData["Title"] = "Delete"; ViewData["Title"] = "Delete";
} }
<h1>Delete</h1> <div class="container container-tight py-4">
<div class="page-header">
<div class="row align-items-center">
<div class="col">
<h2 class="page-title">Delete @Model.Title?</h2>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<p class="text-muted">Are you sure you want to delete this game?
@if (Model.Archives != null && Model.Archives.Count > 0)
{
<span>It will also delete the following archives:</span>
}
</p>
</div>
<h3>Are you sure you want to delete this?</h3> @if (Model.Archives != null && Model.Archives.Count > 0)
<div> {
<h4>Game</h4> <div class="table-responsive">
<hr /> <table class="table table-vcenter table-mobile-md card-table">
<dl class="row"> <thead>
<dt class = "col-sm-2"> <tr>
@Html.DisplayNameFor(model => model.Title) <th>Version</th>
</dt> <th>Uploaded By</th>
<dd class = "col-sm-10"> <th>Uploaded On</th>
@Html.DisplayFor(model => model.Title) <th>Size</th>
</dd> </tr>
<dt class = "col-sm-2"> </thead>
@Html.DisplayNameFor(model => model.SortTitle)
</dt> <tbody>
<dd class = "col-sm-10"> @foreach (var archive in Model.Archives.OrderByDescending(a => a.CreatedOn))
@Html.DisplayFor(model => model.SortTitle) {
</dd> <tr>
<dt class = "col-sm-2"> <td>@Html.DisplayFor(m => archive.Version)</td>
@Html.DisplayNameFor(model => model.Description) <td>@Html.DisplayFor(m => archive.CreatedBy.UserName)</td>
</dt> <td>@Html.DisplayFor(m => archive.CreatedOn)</td>
<dd class = "col-sm-10"> <td>@ByteSizeLib.ByteSize.FromBytes(archive.CompressedSize)</td>
@Html.DisplayFor(model => model.Description) </tr>
</dd> }
<dt class = "col-sm-2"> </tbody>
@Html.DisplayNameFor(model => model.ReleasedOn) </table>
</dt> </div>
<dd class = "col-sm-10"> }
@Html.DisplayFor(model => model.ReleasedOn)
</dd> <div class="card-footer">
<dt class = "col-sm-2"> <div class="d-flex justify-content-between">
@Html.DisplayNameFor(model => model.CreatedOn) <a asp-action="Index" class="btn btn-link">Cancel</a>
</dt>
<dd class = "col-sm-10"> <form asp-action="Delete">
@Html.DisplayFor(model => model.CreatedOn) <input type="hidden" asp-for="Id" />
</dd> <button type="submit" class="btn btn-danger ms-auto">Delete</button>
<dt class = "col-sm-2"> </form>
@Html.DisplayNameFor(model => model.UpdatedOn) </div>
</dt> </div>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.UpdatedOn) </div>
</dd> </div>
</dl>
<form asp-action="Delete">
<input type="hidden" asp-for="Id" />
<input type="submit" value="Delete" class="btn btn-danger" /> |
<a asp-action="Index">Back to List</a>
</form>
</div>