Files
marechai/Marechai/Pages/Admin/DocumentPeople.razor

97 lines
2.8 KiB
Plaintext
Raw Normal View History

@{
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Filename : DocumentPeople.razor
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ Description ] ----------------------------------------------------------
//
// List of document 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 <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2020 Natalia Portillo
*******************************************************************************/
}
@page "/admin/document_people"
@inherits OwningComponentBase<DocumentPeopleService>
@inject IStringLocalizer<DocumentPeopleService> L
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Document companies"]</h3>
@if (_people is null)
{
<p>@L["Loading..."]</p>
return;
}
<p>
<span class="btn btn-primary">
@L["Create New"]
</span>
</p>
<table class="table">
<thead>
<tr>
<th>
@L["Name"]
</th>
<th>
@L["Linked person"]
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in _people)
{
<tr>
<td>
@item.Name
</td>
<td>
<a href="/admin/people/details/@item.PersonId">
@item.Person
</a>
</td>
<td>
<span class="btn btn-primary">
@L["Details"]
</span>
<span class="btn btn-secondary">
@L["Edit"]
</span>
<span class="btn btn-danger">
@L["Delete"]
</span>
</td>
</tr>
}
</tbody>
</table>
@code
{
List<DocumentPersonViewModel> _people;
protected override async Task OnInitializedAsync()
{
_people = await Service.GetAsync();
}
}