mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Sort resolutions in admin page.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Cicm.Database.Models
|
||||
{
|
||||
@@ -44,8 +45,11 @@ namespace Cicm.Database.Models
|
||||
public int Height { get; set; }
|
||||
public long? Colors { get; set; }
|
||||
public long? Palette { get; set; }
|
||||
[DisplayName("Character based")]
|
||||
public bool Chars { get; set; }
|
||||
|
||||
public virtual ICollection<ResolutionsByGpu> ResolutionsByGpu { get; set; }
|
||||
|
||||
public long? PaletteView => Palette ?? Colors;
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,9 @@ namespace cicm_web.Areas.Admin.Controllers
|
||||
}
|
||||
|
||||
// GET: Admin/Resolutions
|
||||
public async Task<IActionResult> Index() => View(await _context.Resolutions.ToListAsync());
|
||||
public async Task<IActionResult> Index() =>
|
||||
View(await _context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width).ThenBy(r => r.Height)
|
||||
.ThenBy(r => r.Colors).ToListAsync());
|
||||
|
||||
// GET: Admin/Resolutions/Details/5
|
||||
public async Task<IActionResult> Details(int? id)
|
||||
|
||||
@@ -45,6 +45,26 @@
|
||||
<div asp-validation-summary="ModelOnly"
|
||||
class="text-danger">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Width"
|
||||
class="control-label">
|
||||
</label>
|
||||
<input asp-for="Width"
|
||||
class="form-control" />
|
||||
<span asp-validation-for="Width"
|
||||
class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Height"
|
||||
class="control-label">
|
||||
</label>
|
||||
<input asp-for="Height"
|
||||
class="form-control" />
|
||||
<span asp-validation-for="Height"
|
||||
class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Colors"
|
||||
class="control-label">
|
||||
@@ -65,6 +85,13 @@
|
||||
class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input asp-for="Chars" /> @Html.DisplayNameFor(model => model.Chars)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary"
|
||||
type="submit"
|
||||
|
||||
@@ -88,14 +88,11 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Chars"
|
||||
class="control-label">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input asp-for="Chars" /> @Html.DisplayNameFor(model => model.Chars)
|
||||
</label>
|
||||
<input asp-for="Chars"
|
||||
class="form-control" />
|
||||
<span asp-validation-for="Chars"
|
||||
class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary"
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
@Html.DisplayFor(modelItem => item.Colors)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Palette)
|
||||
@Html.DisplayFor(modelItem => item.PaletteView)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Chars)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<Version>3.0.99.449</Version>
|
||||
<Version>3.0.99.450</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