mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 11:04:25 +00:00
164 lines
5.8 KiB
Plaintext
164 lines
5.8 KiB
Plaintext
@{
|
|
/******************************************************************************
|
|
// MARECHAI: Master repository of computing history artifacts information
|
|
// ----------------------------------------------------------------------------
|
|
//
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
//
|
|
// --[ 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/details/{Id:int}"
|
|
@page "/admin/document_people/edit/{Id:int}"
|
|
@page "/admin/document_people/create"
|
|
@using Marechai.Database.Models
|
|
@inherits OwningComponentBase<DocumentPeopleService>
|
|
@inject IStringLocalizer<DocumentPeopleService> L
|
|
@inject PeopleService PeopleService
|
|
@inject NavigationManager NavigationManager
|
|
@inject UserManager<ApplicationUser> UserManager
|
|
@inject AuthenticationStateProvider AuthenticationStateProvider
|
|
@attribute [Authorize(Roles = "UberAdmin, Admin")]
|
|
<h3>@L["Document person details"]</h3>
|
|
<hr />
|
|
@if(!_loaded)
|
|
{
|
|
<p align="center">@L["Loading..."]</p>
|
|
|
|
return;
|
|
}
|
|
<div>
|
|
@if(_editing || _model.Name != null)
|
|
{
|
|
<Field>
|
|
<FieldLabel>@L["Name"]</FieldLabel>
|
|
@if(_editing)
|
|
{
|
|
<Check @bind-Checked="@_unknownName" @TValue="bool">@L["Unknown (name)"]</Check>
|
|
}
|
|
@if(!_editing ||
|
|
!_unknownName)
|
|
{
|
|
<Validation Validator="@ValidateName">
|
|
<TextEdit @bind-Text="@_model.Name" ReadOnly="!_editing">
|
|
<Feedback>
|
|
<ValidationError>@L["Please enter a valid name."]</ValidationError>
|
|
</Feedback>
|
|
</TextEdit>
|
|
</Validation>
|
|
}
|
|
</Field>
|
|
}
|
|
@if(_editing || _model.Surname != null)
|
|
{
|
|
<Field>
|
|
<FieldLabel>@L["Surname"]</FieldLabel>
|
|
@if(_editing)
|
|
{
|
|
<Check @bind-Checked="@_unknownSurname" @TValue="bool">@L["Unknown (surname)"]</Check>
|
|
}
|
|
@if(!_editing ||
|
|
!_unknownSurname)
|
|
{
|
|
<Validation Validator="@ValidateSurname">
|
|
<TextEdit @bind-Text="@_model.Surname" ReadOnly="!_editing">
|
|
<Feedback>
|
|
<ValidationError>@L["Please enter a valid surname."]</ValidationError>
|
|
</Feedback>
|
|
</TextEdit>
|
|
</Validation>
|
|
}
|
|
</Field>
|
|
}
|
|
@if(_editing || _model.Alias != null)
|
|
{
|
|
<Field>
|
|
<FieldLabel>@L["Alias"]</FieldLabel>
|
|
@if(_editing)
|
|
{
|
|
<Check @bind-Checked="@_unknownAlias" @TValue="bool">@L["Unknown (alias)"]</Check>
|
|
}
|
|
@if(!_editing ||
|
|
!_unknownAlias)
|
|
{
|
|
<Validation Validator="@ValidateAlias">
|
|
<TextEdit @bind-Text="@_model.Alias" ReadOnly="!_editing">
|
|
<Feedback>
|
|
<ValidationError>@L["Please enter a valid alias."]</ValidationError>
|
|
</Feedback>
|
|
</TextEdit>
|
|
</Validation>
|
|
}
|
|
</Field>
|
|
}
|
|
@if(_editing || _model.DisplayName != null)
|
|
{
|
|
<Field>
|
|
<FieldLabel>@L["Display name"]</FieldLabel>
|
|
@if(_editing)
|
|
{
|
|
<Check @bind-Checked="@_unknownDisplayName" @TValue="bool">@L["Unknown (display name)"]</Check>
|
|
}
|
|
@if(!_editing ||
|
|
!_unknownDisplayName)
|
|
{
|
|
<Validation Validator="@ValidateDisplayName">
|
|
<TextEdit @bind-Text="@_model.DisplayName" ReadOnly="!_editing">
|
|
<Feedback>
|
|
<ValidationError>@L["Please enter a valid display name."]</ValidationError>
|
|
</Feedback>
|
|
</TextEdit>
|
|
</Validation>
|
|
}
|
|
</Field>
|
|
}
|
|
@if(_editing || _model.PersonId != null)
|
|
{
|
|
<Field>
|
|
<FieldLabel>@L["Linked person"]</FieldLabel>
|
|
@if(_editing)
|
|
{
|
|
<Check @bind-Checked="@_noLinkedPerson" @TValue="bool">@L["None (linked person)"]</Check>
|
|
}
|
|
@if(!_editing ||
|
|
!_noLinkedPerson)
|
|
{
|
|
<Select @bind-SelectedValue="@_model.PersonId" Disabled="!_editing" @TValue="int?">
|
|
@foreach(var person in _people)
|
|
{
|
|
<SelectItem @TValue="int?" Value="@person.Id">@person.DisplayName</SelectItem>
|
|
}
|
|
</Select>
|
|
}
|
|
</Field>
|
|
}
|
|
</div>
|
|
<div>
|
|
@if(!_editing)
|
|
{
|
|
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
|
|
}
|
|
else
|
|
{
|
|
<Button Clicked="@OnSaveClicked" Color="Color.Success">@L["Save"]</Button>
|
|
<Button Clicked="@OnCancelClicked" Color="Color.Danger">@L["Cancel"]</Button>
|
|
}
|
|
<a class="btn btn-secondary" href="/admin/document_people">@L["Back to list"]</a>
|
|
</div> |