From c7ef2dcede9fb006d982f7ebc82bd7f05d408146 Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Tue, 3 Jan 2023 18:11:45 -0600 Subject: [PATCH] Tweaked game list --- Data/Models/BaseModel.cs | 4 + Data/Models/Game.cs | 3 + Views/Games/Index.cshtml | 173 +++++++++++++++++++++--------------- Views/Home/Index.cshtml | 13 +-- Views/Shared/_Layout.cshtml | 4 +- 5 files changed, 118 insertions(+), 79 deletions(-) diff --git a/Data/Models/BaseModel.cs b/Data/Models/BaseModel.cs index 8383c3f..4082ec4 100644 --- a/Data/Models/BaseModel.cs +++ b/Data/Models/BaseModel.cs @@ -8,9 +8,13 @@ namespace LANCommander.Data.Models [Key] public Guid Id { get; set; } + [Display(Name = "Created On")] public DateTime CreatedOn { get; set; } + [Display(Name = "Created By")] public virtual User? CreatedBy { get; set; } + [Display(Name = "Updated On")] public DateTime UpdatedOn { get; set; } + [Display(Name = "Updated By")] public virtual User? UpdatedBy { get; set; } } } diff --git a/Data/Models/Game.cs b/Data/Models/Game.cs index c10e9f2..e26ae6b 100644 --- a/Data/Models/Game.cs +++ b/Data/Models/Game.cs @@ -7,9 +7,12 @@ namespace LANCommander.Data.Models public class Game : BaseModel { public string Title { get; set; } + [Display(Name = "Sort Title")] public string? SortTitle { get; set; } + [Display(Name = "Directory Name")] public string? DirectoryName { get; set; } public string Description { get; set; } + [Display(Name = "Released On")] public DateTime ReleasedOn { get; set; } public virtual ICollection? Tags { get; set; } diff --git a/Views/Games/Index.cshtml b/Views/Games/Index.cshtml index 3cd9f87..289288c 100644 --- a/Views/Games/Index.cshtml +++ b/Views/Games/Index.cshtml @@ -1,77 +1,108 @@ @model IEnumerable @{ - ViewData["Title"] = "Index"; + ViewData["Title"] = "Games"; } +
+ +
-

- Create New -

- - - - - - - - - - - - - - - -@foreach (var item in Model) { - - - - - - - - - - - -} - -
- @Html.DisplayNameFor(model => model.Title) - - @Html.DisplayNameFor(model => model.SortTitle) - - @Html.DisplayNameFor(model => model.Description) - - @Html.DisplayNameFor(model => model.ReleasedOn) - - @Html.DisplayNameFor(model => model.CreatedOn) - - @Html.DisplayNameFor(model => model.CreatedBy) - - @Html.DisplayNameFor(model => model.UpdatedOn) - - @Html.DisplayNameFor(model => model.UpdatedBy) -
- @Html.DisplayFor(modelItem => item.Title) - - @Html.DisplayFor(modelItem => item.SortTitle) - - @Html.DisplayFor(modelItem => item.Description) - - @Html.DisplayFor(modelItem => item.ReleasedOn) - - @Html.DisplayFor(modelItem => item.CreatedOn) - - @Html.DisplayFor(modelItem => item.CreatedBy.UserName) - - @Html.DisplayFor(modelItem => item.UpdatedOn) - - @Html.DisplayFor(modelItem => item.UpdatedBy.UserName) - - Edit | - Details | - Delete -
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + @foreach (var item in Model) + { + + + + + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.Title) + + @Html.DisplayNameFor(model => model.SortTitle) + + @Html.DisplayNameFor(model => model.Description) + + @Html.DisplayNameFor(model => model.ReleasedOn) + + @Html.DisplayNameFor(model => model.CreatedOn) + + @Html.DisplayNameFor(model => model.CreatedBy) + + @Html.DisplayNameFor(model => model.UpdatedOn) + + @Html.DisplayNameFor(model => model.UpdatedBy) +
+ @Html.DisplayFor(modelItem => item.Title) + + @Html.DisplayFor(modelItem => item.SortTitle) + + @Html.DisplayFor(modelItem => item.Description) + + @Html.DisplayFor(modelItem => item.ReleasedOn) + + @Html.DisplayFor(modelItem => item.CreatedOn) + + @Html.DisplayFor(modelItem => item.CreatedBy.UserName) + + @Html.DisplayFor(modelItem => item.UpdatedOn) + + @Html.DisplayFor(modelItem => item.UpdatedBy.UserName) + +
+ Edit + Details + Delete +
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/Views/Home/Index.cshtml b/Views/Home/Index.cshtml index 04074a1..622cec2 100644 --- a/Views/Home/Index.cshtml +++ b/Views/Home/Index.cshtml @@ -4,14 +4,17 @@ ViewData["Title"] = "Home Page"; } -