diff --git a/Cicm.Database/Models/Resolution.cs b/Cicm.Database/Models/Resolution.cs index daf9540c..9fb32b0e 100644 --- a/Cicm.Database/Models/Resolution.cs +++ b/Cicm.Database/Models/Resolution.cs @@ -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; } - public bool Chars { get; set; } + [DisplayName("Character based")] + public bool Chars { get; set; } public virtual ICollection ResolutionsByGpu { get; set; } + + public long? PaletteView => Palette ?? Colors; } } \ No newline at end of file diff --git a/cicm_web/Areas/Admin/Controllers/ResolutionsController.cs b/cicm_web/Areas/Admin/Controllers/ResolutionsController.cs index f2cdbeb3..b30d0f74 100644 --- a/cicm_web/Areas/Admin/Controllers/ResolutionsController.cs +++ b/cicm_web/Areas/Admin/Controllers/ResolutionsController.cs @@ -49,7 +49,9 @@ namespace cicm_web.Areas.Admin.Controllers } // GET: Admin/Resolutions - public async Task Index() => View(await _context.Resolutions.ToListAsync()); + public async Task 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 Details(int? id) diff --git a/cicm_web/Areas/Admin/Views/Resolutions/Create.cshtml b/cicm_web/Areas/Admin/Views/Resolutions/Create.cshtml index c1c9ee27..2860c837 100644 --- a/cicm_web/Areas/Admin/Views/Resolutions/Create.cshtml +++ b/cicm_web/Areas/Admin/Views/Resolutions/Create.cshtml @@ -45,6 +45,26 @@
+
+ + + + +
+
+ + + + +
+
+
+ +
+
- - - - +
+ +
item.Colors) - @Html.DisplayFor(modelItem => item.Palette) + @Html.DisplayFor(modelItem => item.PaletteView) @Html.DisplayFor(modelItem => item.Chars) diff --git a/cicm_web/cicm_web.csproj b/cicm_web/cicm_web.csproj index 08dac80e..3e34309f 100644 --- a/cicm_web/cicm_web.csproj +++ b/cicm_web/cicm_web.csproj @@ -2,7 +2,7 @@ netcoreapp2.2 - 3.0.99.449 + 3.0.99.450 Canary Islands Computer Museum Copyright © 2003-2018 Natalia Portillo Canary Islands Computer Museum Website