Sort supported densities.

This commit is contained in:
2019-11-17 21:12:26 +00:00
parent 991ffb3f09
commit e63d7daaa0
2 changed files with 39 additions and 31 deletions

View File

@@ -1,3 +1,4 @@
using System.Linq;
using System.Threading.Tasks;
using DiscImageChef.CommonTypes.Metadata;
using DiscImageChef.Server.Models;
@@ -15,7 +16,14 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
public SupportedDensitiesController(DicServerContext context) => _context = context;
// GET: Admin/SupportedDensities
public async Task<IActionResult> Index() => View(await _context.SupportedDensity.ToListAsync());
public async Task<IActionResult> Index() => View(await _context.
SupportedDensity.OrderBy(d => d.Organization).
ThenBy(d => d.Name).ThenBy(d => d.Description).
ThenBy(d => d.Capacity).ThenBy(d => d.PrimaryCode).
ThenBy(d => d.SecondaryCode).ThenBy(d => d.BitsPerMm).
ThenBy(d => d.Width).ThenBy(d => d.Tracks).
ThenBy(d => d.DefaultDensity).ThenBy(d => d.Writable).
ThenBy(d => d.Duplicate).ToListAsync());
// GET: Admin/SupportedDensities/Delete/5
public async Task<IActionResult> Delete(int? id)

View File

@@ -36,21 +36,24 @@
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.Organization)
</th>
<th>
@Html.DisplayNameFor(model => model.Name)
</th>
<th>
@Html.DisplayNameFor(model => model.Description)
</th>
<th>
@Html.DisplayNameFor(model => model.Capacity)
</th>
<th>
@Html.DisplayNameFor(model => model.PrimaryCode)
</th>
<th>
@Html.DisplayNameFor(model => model.SecondaryCode)
</th>
<th>
@Html.DisplayNameFor(model => model.Writable)
</th>
<th>
@Html.DisplayNameFor(model => model.Duplicate)
</th>
<th>
@Html.DisplayNameFor(model => model.DefaultDensity)
</th>
<th>
@Html.DisplayNameFor(model => model.BitsPerMm)
</th>
@@ -61,16 +64,13 @@
@Html.DisplayNameFor(model => model.Tracks)
</th>
<th>
@Html.DisplayNameFor(model => model.Capacity)
@Html.DisplayNameFor(model => model.DefaultDensity)
</th>
<th>
@Html.DisplayNameFor(model => model.Organization)
@Html.DisplayNameFor(model => model.Writable)
</th>
<th>
@Html.DisplayNameFor(model => model.Name)
</th>
<th>
@Html.DisplayNameFor(model => model.Description)
@Html.DisplayNameFor(model => model.Duplicate)
</th>
<th></th>
</tr>
@@ -79,21 +79,24 @@
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Organization)
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Description)
</td>
<td>
@Html.DisplayFor(modelItem => item.Capacity)
</td>
<td>
@Html.DisplayFor(modelItem => item.PrimaryCode)
</td>
<td>
@Html.DisplayFor(modelItem => item.SecondaryCode)
</td>
<td>
@Html.DisplayFor(modelItem => item.Writable)
</td>
<td>
@Html.DisplayFor(modelItem => item.Duplicate)
</td>
<td>
@Html.DisplayFor(modelItem => item.DefaultDensity)
</td>
<td>
@Html.DisplayFor(modelItem => item.BitsPerMm)
</td>
@@ -104,16 +107,13 @@
@Html.DisplayFor(modelItem => item.Tracks)
</td>
<td>
@Html.DisplayFor(modelItem => item.Capacity)
@Html.DisplayFor(modelItem => item.DefaultDensity)
</td>
<td>
@Html.DisplayFor(modelItem => item.Organization)
@Html.DisplayFor(modelItem => item.Writable)
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Description)
@Html.DisplayFor(modelItem => item.Duplicate)
</td>
<td>
<a asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger">Delete</a>