Tweaked game list

This commit is contained in:
Pat Hartl 2023-01-03 18:11:45 -06:00
parent d904cc8882
commit c7ef2dcede
5 changed files with 118 additions and 79 deletions

View file

@ -8,9 +8,13 @@ namespace LANCommander.Data.Models
[Key] [Key]
public Guid Id { get; set; } public Guid Id { get; set; }
[Display(Name = "Created On")]
public DateTime CreatedOn { get; set; } public DateTime CreatedOn { get; set; }
[Display(Name = "Created By")]
public virtual User? CreatedBy { get; set; } public virtual User? CreatedBy { get; set; }
[Display(Name = "Updated On")]
public DateTime UpdatedOn { get; set; } public DateTime UpdatedOn { get; set; }
[Display(Name = "Updated By")]
public virtual User? UpdatedBy { get; set; } public virtual User? UpdatedBy { get; set; }
} }
} }

View file

@ -7,9 +7,12 @@ namespace LANCommander.Data.Models
public class Game : BaseModel public class Game : BaseModel
{ {
public string Title { get; set; } public string Title { get; set; }
[Display(Name = "Sort Title")]
public string? SortTitle { get; set; } public string? SortTitle { get; set; }
[Display(Name = "Directory Name")]
public string? DirectoryName { get; set; } public string? DirectoryName { get; set; }
public string Description { get; set; } public string Description { get; set; }
[Display(Name = "Released On")]
public DateTime ReleasedOn { get; set; } public DateTime ReleasedOn { get; set; }
public virtual ICollection<Tag>? Tags { get; set; } public virtual ICollection<Tag>? Tags { get; set; }

View file

@ -1,77 +1,108 @@
@model IEnumerable<LANCommander.Data.Models.Game> @model IEnumerable<LANCommander.Data.Models.Game>
@{ @{
ViewData["Title"] = "Index"; ViewData["Title"] = "Games";
} }
<div class="container-xl">
<div class="page-header d-print-none">
<div class="row align-items-center">
<div class="col">
<h2 class="page-title">
Games
</h2>
</div>
<h1>Index</h1> <div class="col-auto ms-auto">
<div class="btn-list">
<a asp-action="Create" class="btn btn-primary d-none d-sm-inline-block">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
Create
</a>
</div>
</div>
</div>
</div>
</div>
<p> <div class="page-body">
<a asp-action="Create">Create New</a> <div class="container-xl">
</p> <div class="row row-cards">
<table class="table"> <div class="col-12">
<thead> <div class="card">
<tr> <div class="table-responsive">
<th> <table class="table table-vcenter table-mobile-md card-table">
@Html.DisplayNameFor(model => model.Title) <thead>
</th> <tr>
<th> <th>
@Html.DisplayNameFor(model => model.SortTitle) @Html.DisplayNameFor(model => model.Title)
</th> </th>
<th> <th>
@Html.DisplayNameFor(model => model.Description) @Html.DisplayNameFor(model => model.SortTitle)
</th> </th>
<th> <th>
@Html.DisplayNameFor(model => model.ReleasedOn) @Html.DisplayNameFor(model => model.Description)
</th> </th>
<th> <th>
@Html.DisplayNameFor(model => model.CreatedOn) @Html.DisplayNameFor(model => model.ReleasedOn)
</th> </th>
<th> <th>
@Html.DisplayNameFor(model => model.CreatedBy) @Html.DisplayNameFor(model => model.CreatedOn)
</th> </th>
<th> <th>
@Html.DisplayNameFor(model => model.UpdatedOn) @Html.DisplayNameFor(model => model.CreatedBy)
</th> </th>
<th> <th>
@Html.DisplayNameFor(model => model.UpdatedBy) @Html.DisplayNameFor(model => model.UpdatedOn)
</th> </th>
<th></th> <th>
</tr> @Html.DisplayNameFor(model => model.UpdatedBy)
</thead> </th>
<tbody> <th></th>
@foreach (var item in Model) { </tr>
<tr> </thead>
<td>
@Html.DisplayFor(modelItem => item.Title) <tbody>
</td> @foreach (var item in Model)
<td> {
@Html.DisplayFor(modelItem => item.SortTitle) <tr>
</td> <td>
<td> @Html.DisplayFor(modelItem => item.Title)
@Html.DisplayFor(modelItem => item.Description) </td>
</td> <td>
<td> @Html.DisplayFor(modelItem => item.SortTitle)
@Html.DisplayFor(modelItem => item.ReleasedOn) </td>
</td> <td>
<td> @Html.DisplayFor(modelItem => item.Description)
@Html.DisplayFor(modelItem => item.CreatedOn) </td>
</td> <td>
<td> @Html.DisplayFor(modelItem => item.ReleasedOn)
@Html.DisplayFor(modelItem => item.CreatedBy.UserName) </td>
</td> <td>
<td> @Html.DisplayFor(modelItem => item.CreatedOn)
@Html.DisplayFor(modelItem => item.UpdatedOn) </td>
</td> <td>
<td> @Html.DisplayFor(modelItem => item.CreatedBy.UserName)
@Html.DisplayFor(modelItem => item.UpdatedBy.UserName) </td>
</td> <td>
<td> @Html.DisplayFor(modelItem => item.UpdatedOn)
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> | </td>
<a asp-action="Details" asp-route-id="@item.Id">Details</a> | <td>
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a> @Html.DisplayFor(modelItem => item.UpdatedBy.UserName)
</td> </td>
</tr> <td>
} <div class="btn-list flex-nowrap">
</tbody> <a asp-action="Edit" asp-route-id="@item.Id" class="btn">Edit</a>
</table> <a asp-action="Details" asp-route-id="@item.Id" class="btn">Details</a>
<a asp-action="Delete" asp-route-id="@item.Id" class="btn">Delete</a>
</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -4,14 +4,17 @@
ViewData["Title"] = "Home Page"; ViewData["Title"] = "Home Page";
} }
<div class="page-header"> <div class="container-xl">
<div class="row align-items-center"> <div class="page-header">
<div class="col"> <div class="row align-items-center">
<div class="page-pretitle">Overview</div> <div class="col">
<h2 class="page-title">Dashboard</h2> <div class="page-pretitle">Overview</div>
<h2 class="page-title">Dashboard</h2>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="page-body"> <div class="page-body">
<div class="container-xl"> <div class="container-xl">
<div class="row row-cards"> <div class="row row-cards">

View file

@ -51,9 +51,7 @@
</div> </div>
</div> </div>
<div class="page-wrapper"> <div class="page-wrapper">
<div class="container-xl"> @RenderBody()
@RenderBody()
</div>
</div> </div>
<footer class="border-top footer text-muted"> <footer class="border-top footer text-muted">