mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Implement list admin page for resolutions by screen.
This commit is contained in:
@@ -42,5 +42,8 @@ namespace Cicm.Database.Models
|
||||
public virtual ICollection<ScreensByMachine> ScreensByMachines { get; set; }
|
||||
[Required]
|
||||
public int NativeResolutionId { get; set; }
|
||||
|
||||
public override string ToString() =>
|
||||
NativeResolution != null ? $"{Diagonal}\" {Type} at {NativeResolution}" : $"{Diagonal}\" {Type}";
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,8 @@ namespace cicm_web.Areas.Admin.Controllers
|
||||
{
|
||||
IIncludableQueryable<ResolutionsByScreen, Screen> cicmContext =
|
||||
_context.ResolutionsByScreen.Include(r => r.Resolution).Include(r => r.Screen);
|
||||
return View(await cicmContext.ToListAsync());
|
||||
return View(await cicmContext.OrderBy(r => r.Screen.ToString()).ThenBy(r => r.Resolution.ToString())
|
||||
.ToListAsync());
|
||||
}
|
||||
|
||||
// GET: ResolutionsByScreen/Details/5
|
||||
|
||||
@@ -5,10 +5,13 @@
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h1>Index</h1>
|
||||
<h1>Resolutions by screen</h1>
|
||||
|
||||
<p>
|
||||
<a asp-action="Create">Create New</a>
|
||||
<a asp-action="Create"
|
||||
class="btn btn-primary">
|
||||
Create New
|
||||
</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
@@ -33,16 +36,19 @@
|
||||
@Html.DisplayFor(modelItem => item.Resolution.Id)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Edit"
|
||||
asp-route-id="@item.Id">
|
||||
Edit
|
||||
</a> |
|
||||
<a asp-action="Details"
|
||||
asp-route-id="@item.Id">
|
||||
asp-route-id="@item.Id"
|
||||
class="btn btn-primary">
|
||||
Details
|
||||
</a> |
|
||||
</a>
|
||||
<a asp-action="Edit"
|
||||
asp-route-id="@item.Id"
|
||||
class="btn btn-secondary">
|
||||
Edit
|
||||
</a>
|
||||
<a asp-action="Delete"
|
||||
asp-route-id="@item.Id">
|
||||
asp-route-id="@item.Id"
|
||||
class="btn btn-danger">
|
||||
Delete
|
||||
</a>
|
||||
</td>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<Version>3.0.99.730</Version>
|
||||
<Version>3.0.99.732</Version>
|
||||
<Company>Canary Islands Computer Museum</Company>
|
||||
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
|
||||
<Product>Canary Islands Computer Museum Website</Product>
|
||||
|
||||
Reference in New Issue
Block a user