diff --git a/Marechai/Areas/Admin/Views/Screens/Details.cshtml b/Marechai/Areas/Admin/Views/Screens/Details.cshtml
deleted file mode 100644
index e6c317eb..00000000
--- a/Marechai/Areas/Admin/Views/Screens/Details.cshtml
+++ /dev/null
@@ -1,50 +0,0 @@
-@model Marechai.Database.Models.Screen
-
-@{
- ViewData["Title"] = "Details";
-}
-
Details
-
-
Screen
-
-
- -
- @Html.DisplayNameFor(model => model.Diagonal)
-
- -
- @Html.DisplayFor(model => model.Diagonal)
-
- -
- @Html.DisplayNameFor(model => model.Size)
-
- -
- @Html.DisplayFor(model => model.Size)
-
- -
- @Html.DisplayNameFor(model => model.NativeResolution)
-
- -
- @Model.NativeResolution.ToString()
-
- -
- @Html.DisplayNameFor(model => model.EffectiveColors)
-
- -
- @Html.DisplayFor(model => model.EffectiveColors)
-
- -
- @Html.DisplayNameFor(model => model.Type)
-
- -
- @Html.DisplayFor(model => model.Type)
-
-
-
-
\ No newline at end of file
diff --git a/Marechai/Marechai.csproj b/Marechai/Marechai.csproj
index 3346c5bd..fb09bc0e 100644
--- a/Marechai/Marechai.csproj
+++ b/Marechai/Marechai.csproj
@@ -2,7 +2,7 @@
netcoreapp3.1
- 3.0.99.1193
+ 3.0.99.1195
Canary Islands Computer Museum
Copyright © 2003-2020 Natalia Portillo
Canary Islands Computer Museum Website
diff --git a/Marechai/Pages/Admin/Details/Screen.razor b/Marechai/Pages/Admin/Details/Screen.razor
new file mode 100644
index 00000000..64b10114
--- /dev/null
+++ b/Marechai/Pages/Admin/Details/Screen.razor
@@ -0,0 +1,94 @@
+@{
+/******************************************************************************
+// 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
+*******************************************************************************/
+}
+
+@page "/admin/screens/details/{Id:int}"
+@inherits OwningComponentBase
+@inject IStringLocalizer L
+@inject ResolutionsService ResolutionsService
+@attribute [Authorize(Roles = "UberAdmin, Admin")]
+@L["Screen details"]
+
+
+@if (!_loaded)
+{
+ @L["Loading..."]
+
+ return;
+}
+
+
+ @if (_editable || _model.Width.HasValue)
+ {
+
+ @L["Width (mm)"]
+
+
+ }
+ @if (_editable || _model.Height.HasValue)
+ {
+
+ @L["Height (mm)"]
+
+
+ }
+
+ @L["Diagonal (inches)"]
+
+
+ @if (_editable || _model.EffectiveColors.HasValue)
+ {
+
+ @L["Effective colors"]
+
+
+ }
+ @if (_editable || _model.Type != null)
+ {
+
+ @L["Type"]
+
+
+ }
+
+ @L["Native resolution"]
+
+
+
+
\ No newline at end of file
diff --git a/Marechai/Pages/Admin/Details/Screen.razor.cs b/Marechai/Pages/Admin/Details/Screen.razor.cs
new file mode 100644
index 00000000..55a87370
--- /dev/null
+++ b/Marechai/Pages/Admin/Details/Screen.razor.cs
@@ -0,0 +1,33 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Marechai.ViewModels;
+using Microsoft.AspNetCore.Components;
+
+namespace Marechai.Pages.Admin.Details
+{
+ public partial class Screen
+ {
+ bool _editable;
+ bool _loaded;
+ Database.Models.Screen _model;
+ List _resolutions;
+ [Parameter]
+ public int Id { get; set; }
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ if(_loaded)
+ return;
+
+ _loaded = true;
+
+ if(Id <= 0)
+ return;
+
+ _resolutions = await ResolutionsService.GetAsync();
+ _model = await Service.GetAsync(Id);
+
+ StateHasChanged();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Marechai/Pages/Admin/Screens.razor b/Marechai/Pages/Admin/Screens.razor
index 08519917..09c8b805 100644
--- a/Marechai/Pages/Admin/Screens.razor
+++ b/Marechai/Pages/Admin/Screens.razor
@@ -31,7 +31,6 @@
}
@page "/admin/screens"
-@using Marechai.Database.Models
@inherits OwningComponentBase
@inject IStringLocalizer L
@attribute [Authorize(Roles = "UberAdmin, Admin")]
@@ -82,9 +81,7 @@
@item.Type
-
- @L["Details"]
-
+ @L["Details"]
@L["Edit"]
diff --git a/Marechai/Resources/Services/ScreensService.es.resx b/Marechai/Resources/Services/ScreensService.es.resx
index c1ef71f2..499c8786 100644
--- a/Marechai/Resources/Services/ScreensService.es.resx
+++ b/Marechai/Resources/Services/ScreensService.es.resx
@@ -174,4 +174,24 @@
Cancelar
Cancel
+
+ Detalles de pantalla
+ Screen details
+
+
+ Volver a la lista
+ Back to list
+
+
+ Ancho (mm)
+ Width (mm)
+
+
+ Alto (mm)
+ Height (mm)
+
+
+ Diagonal (pulgadas)
+ Diagonal (inches)
+
\ No newline at end of file
diff --git a/Marechai/Services/ScreensService.cs b/Marechai/Services/ScreensService.cs
index 378703e0..0a739da2 100644
--- a/Marechai/Services/ScreensService.cs
+++ b/Marechai/Services/ScreensService.cs
@@ -15,6 +15,8 @@ namespace Marechai.Services
ThenBy(s => s.EffectiveColors).ThenBy(s => s.NativeResolution.ToString()).
ThenBy(s => s.Type).ThenBy(s => s.Size).ToList();
+ public async Task GetAsync(int id) => await _context.Screens.FindAsync(id);
+
public async Task DeleteAsync(int id)
{
Screen item = await _context.Screens.FindAsync(id);
|