diff --git a/Marechai/Pages/Admin/People.razor b/Marechai/Pages/Admin/People.razor
new file mode 100644
index 00000000..7f673319
--- /dev/null
+++ b/Marechai/Pages/Admin/People.razor
@@ -0,0 +1,131 @@
+@{
+/******************************************************************************
+// MARECHAI: Master repository of computing history artifacts information
+// ----------------------------------------------------------------------------
+//
+// Filename : People.razor
+// Author(s) : Natalia Portillo
+//
+// --[ Description ] ----------------------------------------------------------
+//
+// List of people
+//
+// --[ 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/people"
+@inherits OwningComponentBase
+@inject IStringLocalizer L
+@attribute [Authorize(Roles = "UberAdmin, Admin")]
+@L["People"]
+@if (_people is null)
+{
+ @L["Loading..."]
+
+ return;
+}
+
+
+ @L["Create new"]
+
+
+
+
+
+ |
+ @L["Known name"]
+ |
+
+ @L["Country of birth"]
+ |
+
+ @L["Birth date"]
+ |
+
+ @L["Date of death"]
+ |
+
+ @L["Webpage"]
+ |
+
+ @L["Twitter"]
+ |
+
+ @L["Facebook"]
+ |
+ |
+
+
+
+ @foreach (var item in _people)
+ {
+
+ |
+ @item.FullName
+ |
+
+ @item.CountryOfBirth
+ |
+
+ @($"{item.BirthDate:d}")
+ |
+
+ @($"{item.DeathDate:d}")
+ |
+
+ @item.Webpage
+ |
+
+ @if (item.Twitter != null)
+ {
+ @item.Twitter
+ }
+ |
+
+ @if (item.Facebook != null)
+ {
+ @item.Facebook
+ }
+ |
+
+
+ @L["Details"]
+
+
+ @L["Edit"]
+
+
+ @L["Delete"]
+
+ |
+
+ }
+
+
+
+@code
+{
+ List _people;
+
+ protected override async Task OnInitializedAsync()
+ {
+ _people = await Service.GetAsync();
+ }
+}
\ No newline at end of file
diff --git a/Marechai/Resources/Services/AdminService.es.resx b/Marechai/Resources/Services/AdminService.es.resx
index 2fac4361..33194631 100644
--- a/Marechai/Resources/Services/AdminService.es.resx
+++ b/Marechai/Resources/Services/AdminService.es.resx
@@ -186,4 +186,8 @@
Máquinas
Machines.
+
+ Gente
+ People.
+
\ No newline at end of file
diff --git a/Marechai/Resources/Services/PeopleService.es.resx b/Marechai/Resources/Services/PeopleService.es.resx
new file mode 100644
index 00000000..35a7c312
--- /dev/null
+++ b/Marechai/Resources/Services/PeopleService.es.resx
@@ -0,0 +1,173 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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
+
+
+ Gente
+ People
+
+
+ Cargando...
+ Message that appears while data is being loaded from database
+
+
+ Nombre conocido
+ Known name
+
+
+ País de nacimiento
+ Country of birth
+
+
+ Fecha de nacimiento
+ Birth date
+
+
+ Fecha de fallecimiento
+ Date of death
+
+
+ Página web
+ Webpage
+
+
+ Twitter
+ Twitter
+
+
+ Facebook
+ Facebook
+
+
+ Crear nueva
+ Create new
+
+
+ Detalles
+ Details
+
+
+ Editar
+ Edit
+
+
+ Eliminar
+ Delete
+
+
\ No newline at end of file
diff --git a/Marechai/Services/PeopleService.cs b/Marechai/Services/PeopleService.cs
new file mode 100644
index 00000000..def993b2
--- /dev/null
+++ b/Marechai/Services/PeopleService.cs
@@ -0,0 +1,26 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Marechai.Database.Models;
+using Marechai.ViewModels;
+using Microsoft.EntityFrameworkCore;
+
+namespace Marechai.Services
+{
+ public class PeopleService
+ {
+ readonly MarechaiContext _context;
+
+ public PeopleService(MarechaiContext context) => _context = context;
+
+ public async Task> GetAsync() =>
+ await _context.People.OrderBy(p => p.DisplayName).ThenBy(p => p.Alias).ThenBy(p => p.Name).
+ ThenBy(p => p.Surname).Select(p => new PersonViewModel
+ {
+ Id = p.Id, Name = p.Name, Surname = p.Surname, CountryOfBirth = p.CountryOfBirth.Name,
+ BirthDate = p.BirthDate, DeathDate = p.DeathDate, Webpage = p.Webpage,
+ Twitter = p.Twitter, Facebook = p.Facebook, Photo = p.Photo, Alias = p.Alias,
+ DisplayName = p.DisplayName
+ }).ToListAsync();
+ }
+}
\ No newline at end of file
diff --git a/Marechai/Services/Register.cs b/Marechai/Services/Register.cs
index 9583ca82..a2492658 100644
--- a/Marechai/Services/Register.cs
+++ b/Marechai/Services/Register.cs
@@ -55,6 +55,7 @@ namespace Marechai.Services
services.AddScoped();
services.AddScoped();
services.AddScoped();
+ services.AddScoped();
}
}
}
\ No newline at end of file
diff --git a/Marechai/ViewModels/PersonViewModel.cs b/Marechai/ViewModels/PersonViewModel.cs
new file mode 100644
index 00000000..459baa64
--- /dev/null
+++ b/Marechai/ViewModels/PersonViewModel.cs
@@ -0,0 +1,21 @@
+using System;
+
+namespace Marechai.ViewModels
+{
+ public class PersonViewModel : BaseViewModel
+ {
+ public string Name { get; set; }
+ public string Surname { get; set; }
+ public string CountryOfBirth { get; set; }
+ public DateTime BirthDate { get; set; }
+ public DateTime? DeathDate { get; set; }
+ public string Webpage { get; set; }
+ public string Twitter { get; set; }
+ public string Facebook { get; set; }
+ public Guid Photo { get; set; }
+ public string Alias { get; set; }
+ public string DisplayName { get; set; }
+
+ public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}";
+ }
+}
\ No newline at end of file