Sort browser tests in admin page.

This commit is contained in:
2019-05-18 15:20:28 +01:00
parent 559931515e
commit 379bc4ec5a
4 changed files with 37 additions and 24 deletions

View File

@@ -49,7 +49,9 @@ namespace cicm_web.Areas.Admin.Controllers
}
// GET: Admin/BrowserTests
public async Task<IActionResult> Index() => View(await _context.BrowserTests.ToListAsync());
public async Task<IActionResult> Index() =>
View(await _context.BrowserTests.OrderBy(b => b.Browser).ThenBy(b => b.Version).ThenBy(b => b.Os)
.ThenBy(b => b.Platform).ThenBy(b => b.UserAgent).ToListAsync());
// GET: Admin/BrowserTests/Details/5
public async Task<IActionResult> Details(int? id)

View File

@@ -41,9 +41,6 @@
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.UserAgent)
</th>
<th>
@Html.DisplayNameFor(model => model.Browser)
</th>
@@ -56,6 +53,9 @@
<th>
@Html.DisplayNameFor(model => model.Platform)
</th>
<th>
@Html.DisplayNameFor(model => model.UserAgent)
</th>
<th>
@Html.DisplayNameFor(model => model.Gif87)
</th>
@@ -96,9 +96,6 @@
@foreach(BrowserTest item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.UserAgent)
</td>
<td>
@Html.DisplayFor(modelItem => item.Browser)
</td>
@@ -111,6 +108,9 @@
<td>
@Html.DisplayFor(modelItem => item.Platform)
</td>
<td>
@Html.DisplayFor(modelItem => item.UserAgent)
</td>
<td>
@Html.DisplayFor(modelItem => item.Gif87)
</td>