mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add grayscale resolutions.
This commit is contained in:
1892
Cicm.Database/Migrations/20190519144028_GrayscaleResolutions.Designer.cs
generated
Normal file
1892
Cicm.Database/Migrations/20190519144028_GrayscaleResolutions.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,17 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace Cicm.Database.Migrations
|
||||||
|
{
|
||||||
|
public partial class GrayscaleResolutions : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>("Grayscale", "resolutions", nullable: false, defaultValue: false);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn("Grayscale", "resolutions");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -770,6 +770,8 @@ namespace Cicm.Database.Migrations
|
|||||||
|
|
||||||
b.Property<long?>("Colors").HasColumnName("colors").HasColumnType("bigint(20)");
|
b.Property<long?>("Colors").HasColumnName("colors").HasColumnType("bigint(20)");
|
||||||
|
|
||||||
|
b.Property<bool>("Grayscale");
|
||||||
|
|
||||||
b.Property<int>("Height").ValueGeneratedOnAdd().HasColumnName("height").HasColumnType("int(11)")
|
b.Property<int>("Height").ValueGeneratedOnAdd().HasColumnName("height").HasColumnType("int(11)")
|
||||||
.HasDefaultValueSql("'0'");
|
.HasDefaultValueSql("'0'");
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ namespace Cicm.Database.Models
|
|||||||
public long? Palette { get; set; }
|
public long? Palette { get; set; }
|
||||||
[DisplayName("Character based")]
|
[DisplayName("Character based")]
|
||||||
public bool Chars { get; set; }
|
public bool Chars { get; set; }
|
||||||
|
[DisplayName("Grayscale")]
|
||||||
|
public bool Grayscale { get; set; }
|
||||||
|
|
||||||
public virtual ICollection<ResolutionsByGpu> ResolutionsByGpu { get; set; }
|
public virtual ICollection<ResolutionsByGpu> ResolutionsByGpu { get; set; }
|
||||||
|
|
||||||
@@ -59,17 +61,25 @@ namespace Cicm.Database.Models
|
|||||||
if(Colors == null) return $"{Width}x{Height} characters";
|
if(Colors == null) return $"{Width}x{Height} characters";
|
||||||
|
|
||||||
if(Palette != null && Colors != Palette)
|
if(Palette != null && Colors != Palette)
|
||||||
return $"{Width}x{Height} characters at {Colors} colors from a palette of {Palette}";
|
return Grayscale
|
||||||
|
? $"{Width}x{Height} characters at {Colors} grays from a palette of {Palette}"
|
||||||
|
: $"{Width}x{Height} characters at {Colors} colors from a palette of {Palette}";
|
||||||
|
|
||||||
return $"{Width}x{Height} characters at {Colors} colors";
|
return Colors == 2 && Grayscale
|
||||||
|
? $"{Width}x{Height} black and white characters"
|
||||||
|
: $"{Width}x{Height} characters at {Colors} colors";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Colors == null) return $"{Width}x{Height} pixels";
|
if(Colors == null) return $"{Width}x{Height} pixels";
|
||||||
|
|
||||||
if(Palette != null && Colors != Palette)
|
if(Palette != null && Colors != Palette)
|
||||||
return $"{Width}x{Height} pixels at {Colors} colors from a palette of {Palette}";
|
return Grayscale
|
||||||
|
? $"{Width}x{Height} pixels at {Colors} grays from a palette of {Palette}"
|
||||||
|
: $"{Width}x{Height} pixels at {Colors} colors from a palette of {Palette}";
|
||||||
|
|
||||||
return $"{Width}x{Height} pixels at {Colors} colors";
|
return Colors == 2 && Grayscale
|
||||||
|
? $"{Width}x{Height} black and white pixels"
|
||||||
|
: $"{Width}x{Height} pixels at {Colors} colors";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
// GET: Admin/Resolutions
|
// GET: Admin/Resolutions
|
||||||
public async Task<IActionResult> Index() =>
|
public async Task<IActionResult> Index() =>
|
||||||
View(await _context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width).ThenBy(r => r.Height)
|
View(await _context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width).ThenBy(r => r.Height)
|
||||||
.ThenBy(r => r.Colors).ToListAsync());
|
.ThenBy(r => r.Colors).ThenBy(r => r.Grayscale).ToListAsync());
|
||||||
|
|
||||||
// GET: Admin/Resolutions/Details/5
|
// GET: Admin/Resolutions/Details/5
|
||||||
public async Task<IActionResult> Details(int? id)
|
public async Task<IActionResult> Details(int? id)
|
||||||
@@ -72,7 +72,7 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[ValidateAntiForgeryToken]
|
[ValidateAntiForgeryToken]
|
||||||
public async Task<IActionResult> Create([Bind("Id,Width,Height,Colors,Palette,Chars")]
|
public async Task<IActionResult> Create([Bind("Id,Width,Height,Colors,Palette,Chars,Grayscale")]
|
||||||
Resolution resolution)
|
Resolution resolution)
|
||||||
{
|
{
|
||||||
if(ModelState.IsValid)
|
if(ModelState.IsValid)
|
||||||
@@ -101,7 +101,7 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[ValidateAntiForgeryToken]
|
[ValidateAntiForgeryToken]
|
||||||
public async Task<IActionResult> Edit(int id, [Bind("Id,Width,Height,Colors,Palette,Chars")]
|
public async Task<IActionResult> Edit(int id, [Bind("Id,Width,Height,Colors,Palette,Chars,Grayscale")]
|
||||||
Resolution resolution)
|
Resolution resolution)
|
||||||
{
|
{
|
||||||
if(id != resolution.Id) return NotFound();
|
if(id != resolution.Id) return NotFound();
|
||||||
|
|||||||
@@ -92,6 +92,13 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<input asp-for="Grayscale" /> @Html.DisplayNameFor(model => model.Grayscale)
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input class="btn btn-primary"
|
<input class="btn btn-primary"
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|||||||
@@ -72,6 +72,12 @@
|
|||||||
<dd>
|
<dd>
|
||||||
@Html.DisplayFor(model => model.Chars)
|
@Html.DisplayFor(model => model.Chars)
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt>
|
||||||
|
@Html.DisplayNameFor(model => model.Grayscale)
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
@Html.DisplayFor(model => model.Grayscale)
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<form asp-action="Delete">
|
<form asp-action="Delete">
|
||||||
|
|||||||
@@ -71,9 +71,22 @@
|
|||||||
<dd>
|
<dd>
|
||||||
@Html.DisplayFor(model => model.Chars)
|
@Html.DisplayFor(model => model.Chars)
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt>
|
||||||
|
@Html.DisplayNameFor(model => model.Grayscale)
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
@Html.DisplayFor(model => model.Grayscale)
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-primary">Edit</a>
|
<a asp-action="Edit"
|
||||||
<a asp-action="Index" class="btn btn-secondary">Back to List</a>
|
asp-route-id="@Model.Id"
|
||||||
|
class="btn btn-primary">
|
||||||
|
Edit
|
||||||
|
</a>
|
||||||
|
<a asp-action="Index"
|
||||||
|
class="btn btn-secondary">
|
||||||
|
Back to List
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -94,6 +94,13 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<input asp-for="Grayscale" /> @Html.DisplayNameFor(model => model.Grayscale)
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input class="btn btn-primary"
|
<input class="btn btn-primary"
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|||||||
@@ -48,19 +48,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
@Html.DisplayNameFor(model => model.Width)
|
Resolution
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
@Html.DisplayNameFor(model => model.Height)
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
@Html.DisplayNameFor(model => model.Colors)
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
@Html.DisplayNameFor(model => model.Palette)
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
@Html.DisplayNameFor(model => model.Chars)
|
|
||||||
</th>
|
</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -70,19 +58,7 @@
|
|||||||
{
|
{
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
@Html.DisplayFor(modelItem => item.Width)
|
@item.ToString()
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@Html.DisplayFor(modelItem => item.Height)
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@Html.DisplayFor(modelItem => item.Colors)
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@Html.DisplayFor(modelItem => item.PaletteView)
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@Html.DisplayFor(modelItem => item.Chars)
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a asp-action="Details"
|
<a asp-action="Details"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||||
<Version>3.0.99.477</Version>
|
<Version>3.0.99.479</Version>
|
||||||
<Company>Canary Islands Computer Museum</Company>
|
<Company>Canary Islands Computer Museum</Company>
|
||||||
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
|
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
|
||||||
<Product>Canary Islands Computer Museum Website</Product>
|
<Product>Canary Islands Computer Museum Website</Product>
|
||||||
|
|||||||
Reference in New Issue
Block a user