diff --git a/Marechai/Areas/Admin/Controllers/BrowserTestsController.cs b/Marechai/Areas/Admin/Controllers/BrowserTestsController.cs deleted file mode 100644 index b26c869d..00000000 --- a/Marechai/Areas/Admin/Controllers/BrowserTestsController.cs +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** -// MARECHAI: Master repository of computing history artifacts information -// ---------------------------------------------------------------------------- -// -// Filename : BrowserTestsController.cs -// Author(s) : Natalia Portillo -// -// --[ Description ] ---------------------------------------------------------- -// -// Browser test admin controller -// -// --[ License ] -------------------------------------------------------------- -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// -// ---------------------------------------------------------------------------- -// Copyright © 2003-2020 Natalia Portillo -*******************************************************************************/ - -using System.Linq; -using System.Threading.Tasks; -using Marechai.Database.Models; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; - -namespace Marechai.Areas.Admin.Controllers -{ - [Area("Admin"), Authorize] - public class BrowserTestsController : Controller - { - readonly MarechaiContext _context; - - public BrowserTestsController(MarechaiContext context) => _context = context; - - // GET: Admin/BrowserTests - public async Task 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 Details(int? id) - { - if(id == null) - return NotFound(); - - BrowserTest browserTest = await _context.BrowserTests.FirstOrDefaultAsync(m => m.Id == id); - - if(browserTest == null) - return NotFound(); - - return View(browserTest); - } - - // GET: Admin/BrowserTests/Edit/5 - public async Task Edit(int? id) - { - if(id == null) - return NotFound(); - - BrowserTest browserTest = await _context.BrowserTests.FindAsync(id); - - if(browserTest == null) - return NotFound(); - - return View(browserTest); - } - - // POST: Admin/BrowserTests/Edit/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for - // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost, ValidateAntiForgeryToken] - public async Task Edit( - int id, - [Bind("Id,UserAgent,Browser,Version,Os,Platform,Gif87,Gif89,Jpeg,Png,Pngt,Agif,Table,Colors,Js,Frames,Flash")] - BrowserTest browserTest) - { - if(id != browserTest.Id) - return NotFound(); - - if(!ModelState.IsValid) - return View(browserTest); - - try - { - _context.Update(browserTest); - await _context.SaveChangesAsync(); - } - catch(DbUpdateConcurrencyException) - { - if(!BrowserTestExists(browserTest.Id)) - return NotFound(); - - throw; - } - - return RedirectToAction(nameof(Index)); - } - - // GET: Admin/BrowserTests/Delete/5 - public async Task Delete(int? id) - { - if(id == null) - return NotFound(); - - BrowserTest browserTest = await _context.BrowserTests.FirstOrDefaultAsync(m => m.Id == id); - - if(browserTest == null) - return NotFound(); - - return View(browserTest); - } - - // POST: Admin/BrowserTests/Delete/5 - [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] - public async Task DeleteConfirmed(int id) - { - BrowserTest browserTest = await _context.BrowserTests.FindAsync(id); - _context.BrowserTests.Remove(browserTest); - await _context.SaveChangesAsync(); - - return RedirectToAction(nameof(Index)); - } - - bool BrowserTestExists(int id) => _context.BrowserTests.Any(e => e.Id == id); - } -} \ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/BrowserTests/Delete.cshtml b/Marechai/Areas/Admin/Views/BrowserTests/Delete.cshtml deleted file mode 100644 index ce7a255a..00000000 --- a/Marechai/Areas/Admin/Views/BrowserTests/Delete.cshtml +++ /dev/null @@ -1,147 +0,0 @@ -@{ - /****************************************************************************** -// MARECHAI: Master repository of computing history artifacts information -// ---------------------------------------------------------------------------- -// -// Filename : Delete.cshtml -// Author(s) : Natalia Portillo -// -// --[ Description ] ---------------------------------------------------------- -// -// Admin view delete -// -// --[ License ] -------------------------------------------------------------- -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// -// ---------------------------------------------------------------------------- -// Copyright © 2003-2020 Natalia Portillo -*******************************************************************************/ -} -@model Marechai.Database.Models.BrowserTest - -@{ - ViewData["Title"] = "Delete"; -} -

Delete

-

Are you sure you want to delete this?

-
-

Browser test

-
-
-
- @Html.DisplayNameFor(model => model.UserAgent) -
-
- @Html.DisplayFor(model => model.UserAgent) -
-
- @Html.DisplayNameFor(model => model.Browser) -
-
- @Html.DisplayFor(model => model.Browser) -
-
- @Html.DisplayNameFor(model => model.Version) -
-
- @Html.DisplayFor(model => model.Version) -
-
- @Html.DisplayNameFor(model => model.Os) -
-
- @Html.DisplayFor(model => model.Os) -
-
- @Html.DisplayNameFor(model => model.Platform) -
-
- @Html.DisplayFor(model => model.Platform) -
-
- @Html.DisplayNameFor(model => model.Gif87) -
-
- @Html.DisplayFor(model => model.Gif87) -
-
- @Html.DisplayNameFor(model => model.Gif89) -
-
- @Html.DisplayFor(model => model.Gif89) -
-
- @Html.DisplayNameFor(model => model.Jpeg) -
-
- @Html.DisplayFor(model => model.Jpeg) -
-
- @Html.DisplayNameFor(model => model.Png) -
-
- @Html.DisplayFor(model => model.Png) -
-
- @Html.DisplayNameFor(model => model.Pngt) -
-
- @Html.DisplayFor(model => model.Pngt) -
-
- @Html.DisplayNameFor(model => model.Agif) -
-
- @Html.DisplayFor(model => model.Agif) -
-
- @Html.DisplayNameFor(model => model.Table) -
-
- @Html.DisplayFor(model => model.Table) -
-
- @Html.DisplayNameFor(model => model.Colors) -
-
- @Html.DisplayFor(model => model.Colors) -
-
- @Html.DisplayNameFor(model => model.Js) -
-
- @Html.DisplayFor(model => model.Js) -
-
- @Html.DisplayNameFor(model => model.Frames) -
-
- @Html.DisplayFor(model => model.Frames) -
-
- @Html.DisplayNameFor(model => model.Flash) -
-
- @Html.DisplayFor(model => model.Flash) -
-
-
- - - - Back to List - -
-
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/BrowserTests/Details.cshtml b/Marechai/Areas/Admin/Views/BrowserTests/Details.cshtml deleted file mode 100644 index ac9d93dd..00000000 --- a/Marechai/Areas/Admin/Views/BrowserTests/Details.cshtml +++ /dev/null @@ -1,143 +0,0 @@ -@{ - /****************************************************************************** -// MARECHAI: Master repository of computing history artifacts information -// ---------------------------------------------------------------------------- -// -// Filename : Details.cshtml -// Author(s) : Natalia Portillo -// -// --[ Description ] ---------------------------------------------------------- -// -// Admin view details -// -// --[ License ] -------------------------------------------------------------- -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// -// ---------------------------------------------------------------------------- -// Copyright © 2003-2020 Natalia Portillo -*******************************************************************************/ -} -@model Marechai.Database.Models.BrowserTest - -@{ - ViewData["Title"] = "Details"; -} -

Details

-
-

Browser test

-
-
-
- @Html.DisplayNameFor(model => model.UserAgent) -
-
- @Html.DisplayFor(model => model.UserAgent) -
-
- @Html.DisplayNameFor(model => model.Browser) -
-
- @Html.DisplayFor(model => model.Browser) -
-
- @Html.DisplayNameFor(model => model.Version) -
-
- @Html.DisplayFor(model => model.Version) -
-
- @Html.DisplayNameFor(model => model.Os) -
-
- @Html.DisplayFor(model => model.Os) -
-
- @Html.DisplayNameFor(model => model.Platform) -
-
- @Html.DisplayFor(model => model.Platform) -
-
- @Html.DisplayNameFor(model => model.Gif87) -
-
- @Html.DisplayFor(model => model.Gif87) -
-
- @Html.DisplayNameFor(model => model.Gif89) -
-
- @Html.DisplayFor(model => model.Gif89) -
-
- @Html.DisplayNameFor(model => model.Jpeg) -
-
- @Html.DisplayFor(model => model.Jpeg) -
-
- @Html.DisplayNameFor(model => model.Png) -
-
- @Html.DisplayFor(model => model.Png) -
-
- @Html.DisplayNameFor(model => model.Pngt) -
-
- @Html.DisplayFor(model => model.Pngt) -
-
- @Html.DisplayNameFor(model => model.Agif) -
-
- @Html.DisplayFor(model => model.Agif) -
-
- @Html.DisplayNameFor(model => model.Table) -
-
- @Html.DisplayFor(model => model.Table) -
-
- @Html.DisplayNameFor(model => model.Colors) -
-
- @Html.DisplayFor(model => model.Colors) -
-
- @Html.DisplayNameFor(model => model.Js) -
-
- @Html.DisplayFor(model => model.Js) -
-
- @Html.DisplayNameFor(model => model.Frames) -
-
- @Html.DisplayFor(model => model.Frames) -
-
- @Html.DisplayNameFor(model => model.Flash) -
-
- @Html.DisplayFor(model => model.Flash) -
-
-
- \ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/BrowserTests/Edit.cshtml b/Marechai/Areas/Admin/Views/BrowserTests/Edit.cshtml deleted file mode 100644 index 5a84ea62..00000000 --- a/Marechai/Areas/Admin/Views/BrowserTests/Edit.cshtml +++ /dev/null @@ -1,170 +0,0 @@ -@{ - /****************************************************************************** -// MARECHAI: Master repository of computing history artifacts information -// ---------------------------------------------------------------------------- -// -// Filename : Edit.cshtml -// Author(s) : Natalia Portillo -// -// --[ Description ] ---------------------------------------------------------- -// -// Admin view edit -// -// --[ License ] -------------------------------------------------------------- -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// -// ---------------------------------------------------------------------------- -// Copyright © 2003-2020 Natalia Portillo -*******************************************************************************/ -} -@model Marechai.Database.Models.BrowserTest - -@{ - ViewData["Title"] = "Edit"; -} -

Edit

-

Browser test

-
-
-
-
-
-
- -
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} \ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/BrowserTests/Index.cshtml b/Marechai/Areas/Admin/Views/BrowserTests/Index.cshtml deleted file mode 100644 index be5d1360..00000000 --- a/Marechai/Areas/Admin/Views/BrowserTests/Index.cshtml +++ /dev/null @@ -1,158 +0,0 @@ -@{ - /****************************************************************************** -// MARECHAI: Master repository of computing history artifacts information -// ---------------------------------------------------------------------------- -// -// Filename : Index.cshtml -// Author(s) : Natalia Portillo -// -// --[ Description ] ---------------------------------------------------------- -// -// Admin view index -// -// --[ License ] -------------------------------------------------------------- -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// -// ---------------------------------------------------------------------------- -// Copyright © 2003-2020 Natalia Portillo -*******************************************************************************/ -} -@model IEnumerable - -@{ - ViewData["Title"] = "Browser tests (Admin)"; -} -

Browser tests

- - - - - - - - - - - - - - - - - - - - - - - - @foreach (var item in Model) - { - - - - - - - - - - - - - - - - - - - - } - -
- @Html.DisplayNameFor(model => model.Browser) - - @Html.DisplayNameFor(model => model.Version) - - @Html.DisplayNameFor(model => model.Os) - - @Html.DisplayNameFor(model => model.Platform) - - @Html.DisplayNameFor(model => model.UserAgent) - - @Html.DisplayNameFor(model => model.Gif87) - - @Html.DisplayNameFor(model => model.Gif89) - - @Html.DisplayNameFor(model => model.Jpeg) - - @Html.DisplayNameFor(model => model.Png) - - @Html.DisplayNameFor(model => model.Pngt) - - @Html.DisplayNameFor(model => model.Agif) - - @Html.DisplayNameFor(model => model.Table) - - @Html.DisplayNameFor(model => model.Colors) - - @Html.DisplayNameFor(model => model.Js) - - @Html.DisplayNameFor(model => model.Frames) - - @Html.DisplayNameFor(model => model.Flash) -
- @Html.DisplayFor(modelItem => item.Browser) - - @Html.DisplayFor(modelItem => item.Version) - - @Html.DisplayFor(modelItem => item.Os) - - @Html.DisplayFor(modelItem => item.Platform) - - @Html.DisplayFor(modelItem => item.UserAgent) - - @Html.DisplayFor(modelItem => item.Gif87) - - @Html.DisplayFor(modelItem => item.Gif89) - - @Html.DisplayFor(modelItem => item.Jpeg) - - @Html.DisplayFor(modelItem => item.Png) - - @Html.DisplayFor(modelItem => item.Pngt) - - @Html.DisplayFor(modelItem => item.Agif) - - @Html.DisplayFor(modelItem => item.Table) - - @Html.DisplayFor(modelItem => item.Colors) - - @Html.DisplayFor(modelItem => item.Js) - - @Html.DisplayFor(modelItem => item.Frames) - - @Html.DisplayFor(modelItem => item.Flash) - - - Details - - - Edit - - - Delete - -
\ No newline at end of file diff --git a/Marechai/Marechai.csproj b/Marechai/Marechai.csproj index f942831d..139a430f 100644 --- a/Marechai/Marechai.csproj +++ b/Marechai/Marechai.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 3.0.99.1041 + 3.0.99.1045 Canary Islands Computer Museum Copyright © 2003-2020 Natalia Portillo Canary Islands Computer Museum Website @@ -44,4 +44,10 @@ true + + <_ContentIncludedByDefault Remove="Areas\Admin\Views\BrowserTests\Delete.cshtml" /> + <_ContentIncludedByDefault Remove="Areas\Admin\Views\BrowserTests\Details.cshtml" /> + <_ContentIncludedByDefault Remove="Areas\Admin\Views\BrowserTests\Edit.cshtml" /> + <_ContentIncludedByDefault Remove="Areas\Admin\Views\BrowserTests\Index.cshtml" /> + \ No newline at end of file diff --git a/Marechai/Pages/Admin/BrowserTests.razor b/Marechai/Pages/Admin/BrowserTests.razor new file mode 100644 index 00000000..1c5da8e9 --- /dev/null +++ b/Marechai/Pages/Admin/BrowserTests.razor @@ -0,0 +1,163 @@ +@{ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Filename : BrowserTests.razor +// Author(s) : Natalia Portillo +// +// --[ Description ] ---------------------------------------------------------- +// +// List of browser tests +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ +} + +@page "/admin/browser_tests" +@using Marechai.Database.Models +@inherits OwningComponentBase +@inject IStringLocalizer L +@attribute [Authorize(Roles = "UberAdmin")] +

@L["Browser tests"]

+@if (_tests is null) +{ +

@L["Loading..."]

+ + return; +} + + + + + + + + + + + + + + + + + + + + + + + @foreach (var item in _tests) + { + + + + + + + + + + + + + + + + + + + } + +
+ @L["Browser"] + + @L["Version"] + + @L["Operating system"] + + @L["Platform"] + + @L["User agent"] + + @L["GIF87"] + + @L["GIF89"] + + @L["JPEG"] + + @L["PNG"] + + @L["Transparent PNG"] + + @L["Animated GIF"] + + @L["Table"] + + @L["Colors"] + + @L["JavaScript"] + + @L["Frames"] + + @L["Flash"] +
+ @item.Browser + + @item.Version + + @item.Os + + @item.Platform + + @item.UserAgent + + @item.Gif87 + + @item.Gif89 + + @item.Jpeg + + @item.Png + + @item.Pngt + + @item.Agif + + @item.Table + + @item.Colors + + @item.Js + + @item.Frames + + @item.Flash +
+ +@code +{ + List _tests; + + protected override async Task OnInitializedAsync() + { + _tests = await Service.GetAsync(); + } +} \ No newline at end of file diff --git a/Marechai/Pages/Admin/Index.razor b/Marechai/Pages/Admin/Index.razor index 252313e4..e9641124 100644 --- a/Marechai/Pages/Admin/Index.razor +++ b/Marechai/Pages/Admin/Index.razor @@ -1,5 +1,5 @@ @{ -/****************************************************************************** + /****************************************************************************** // MARECHAI: Master repository of computing history artifacts information // ---------------------------------------------------------------------------- // @@ -34,7 +34,12 @@ @inherits OwningComponentBase @inject IStringLocalizer L @attribute [Authorize(Roles = "UberAdmin, Admin")] -

@L["Administration area"]

- -

@L["Welcome to the administration area. Act with care!"]

\ No newline at end of file +

@L["Welcome to the administration area. Act with care!"]

+ \ No newline at end of file diff --git a/Marechai/Resources/Services/AdminService.es.resx b/Marechai/Resources/Services/AdminService.es.resx index dae29b8e..1eee7994 100644 --- a/Marechai/Resources/Services/AdminService.es.resx +++ b/Marechai/Resources/Services/AdminService.es.resx @@ -130,4 +130,8 @@ Bienvenido/a al área de administración. ¡Actúa con cuidado! Welcome message. + + Pruebas de navegadores + Browser tests. + \ No newline at end of file diff --git a/Marechai/Resources/Services/BrowserTestsService.es.resx b/Marechai/Resources/Services/BrowserTestsService.es.resx new file mode 100644 index 00000000..efe065b2 --- /dev/null +++ b/Marechai/Resources/Services/BrowserTestsService.es.resx @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cargando... + Loading message + + + Pruebas de navegadores + Browser tests. + + + Navegador + Browser. + + + Versión + Version. + + + Sistema operativo + Operating system. + + + Plataforma + Platform. + + + Identificator + User agent. + + + GIF87 + GIF87. + + + GIF89 + GIF89. + + + JPEG + JPEG. + + + PNG + PNG. + + + PNG transparente + Transparent PNG. + + + GIF animado + Animated GIF. + + + Tabla + Table. + + + Colores + Colors. + + + JavaScript + JavaScript. + + + Marcos + Frames. + + + Flash + Flash. + + \ No newline at end of file diff --git a/Marechai/Services/BrowserTestsService.cs b/Marechai/Services/BrowserTestsService.cs new file mode 100644 index 00000000..184e9639 --- /dev/null +++ b/Marechai/Services/BrowserTestsService.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Marechai.Database.Models; +using Microsoft.EntityFrameworkCore; + +namespace Marechai.Services +{ + public class BrowserTestsService + { + readonly MarechaiContext _context; + + public BrowserTestsService(MarechaiContext context) => _context = context; + + public Task> GetAsync() => _context. + BrowserTests.OrderBy(b => b.Browser).ThenBy(b => b.Version). + ThenBy(b => b.Os).ThenBy(b => b.Platform).ThenBy(b => b.UserAgent). + ToListAsync(); + } +} \ No newline at end of file diff --git a/Marechai/Services/Register.cs b/Marechai/Services/Register.cs index 218921e3..cbe2e31c 100644 --- a/Marechai/Services/Register.cs +++ b/Marechai/Services/Register.cs @@ -47,6 +47,7 @@ namespace Marechai.Services services.AddScoped(); services.AddScoped(); services.AddScoped(); + services.AddScoped(); } } } \ No newline at end of file