2020-08-08 03:37:41 +01:00
|
|
|
@{
|
2020-12-20 21:34:13 +00:00
|
|
|
/******************************************************************************
|
2020-08-08 03:37:41 +01:00
|
|
|
// 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/dumps/details/{Id:long}"
|
|
|
|
|
@page "/admin/dumps/edit/{Id:long}"
|
|
|
|
|
@page "/admin/dumps/create"
|
|
|
|
|
@using Marechai.Database.Models
|
|
|
|
|
@inherits OwningComponentBase<DumpsService>
|
|
|
|
|
@inject IStringLocalizer<DumpsService> L
|
|
|
|
|
@inject MediaService MediaService
|
|
|
|
|
@inject NavigationManager NavigationManager
|
|
|
|
|
@inject IWebHostEnvironment Host
|
|
|
|
|
@inject IJSRuntime JSRuntime
|
2020-12-20 21:34:13 +00:00
|
|
|
@inject UserManager<ApplicationUser> UserManager
|
2020-08-08 03:37:41 +01:00
|
|
|
@inject AuthenticationStateProvider AuthenticationStateProvider
|
|
|
|
|
@attribute [Authorize(Roles = "UberAdmin, Admin")]
|
|
|
|
|
<h3>@L["Dump details"]</h3>
|
|
|
|
|
<hr />
|
2020-12-20 21:34:13 +00:00
|
|
|
@if(!_loaded)
|
2020-08-08 03:37:41 +01:00
|
|
|
{
|
|
|
|
|
<p align="center">@L["Loading..."]</p>
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
<div>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel>@L["Dumper"]</FieldLabel>
|
|
|
|
|
<Validation Validator="@ValidateDumper">
|
2020-12-20 21:34:13 +00:00
|
|
|
<TextEdit @bind-Text="@_model.Dumper" ReadOnly="!_editing">
|
2020-08-08 03:37:41 +01:00
|
|
|
<Feedback>
|
|
|
|
|
<ValidationError>@L["Please enter a valid dumper."]</ValidationError>
|
|
|
|
|
</Feedback>
|
|
|
|
|
</TextEdit>
|
|
|
|
|
</Validation>
|
|
|
|
|
</Field>
|
2020-12-20 21:34:13 +00:00
|
|
|
@if(_editing || _model.UserId != null)
|
2020-08-08 03:37:41 +01:00
|
|
|
{
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel>@L["Dumper's user"]</FieldLabel>
|
2020-12-20 21:34:13 +00:00
|
|
|
@if(_editing)
|
2020-08-08 03:37:41 +01:00
|
|
|
{
|
2020-12-20 21:34:13 +00:00
|
|
|
<Check @bind-Checked="@_unknownUser" @TValue="bool">@L["Unknown (user)"]</Check>
|
|
|
|
|
}
|
|
|
|
|
@if(!_editing ||
|
|
|
|
|
!_unknownUser)
|
2020-08-08 03:37:41 +01:00
|
|
|
{
|
2020-12-20 21:34:13 +00:00
|
|
|
<Select @bind-SelectedValue="@_model.UserId" Disabled="!_editing" @TValue="string">
|
|
|
|
|
@foreach(var user in _users)
|
2020-08-08 03:37:41 +01:00
|
|
|
{
|
2020-12-20 21:34:13 +00:00
|
|
|
<SelectItem @TValue="string" Value="@user.Id">@user.UserName</SelectItem>
|
|
|
|
|
}
|
2020-08-08 03:37:41 +01:00
|
|
|
</Select>
|
2020-12-20 21:34:13 +00:00
|
|
|
}
|
2020-08-08 03:37:41 +01:00
|
|
|
</Field>
|
2020-12-20 21:34:13 +00:00
|
|
|
}
|
|
|
|
|
@if(_editing || _model.DumpingGroup != null)
|
2020-08-08 03:37:41 +01:00
|
|
|
{
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel>@L["Dumping group, or group whose guidelines where followed to make the dump"]</FieldLabel>
|
2020-12-20 21:34:13 +00:00
|
|
|
@if(_editing)
|
2020-08-08 03:37:41 +01:00
|
|
|
{
|
2020-12-20 21:34:13 +00:00
|
|
|
<Check @bind-Checked="@_unknownDumpingGroup" @TValue="bool">@L["Unknown (dumping group)"]</Check>
|
|
|
|
|
}
|
|
|
|
|
@if(!_editing ||
|
|
|
|
|
!_unknownDumpingGroup)
|
2020-08-08 03:37:41 +01:00
|
|
|
{
|
|
|
|
|
<Validation Validator="@ValidateDumpingGroup">
|
2020-12-20 21:34:13 +00:00
|
|
|
<TextEdit @bind-Text="@_model.DumpingGroup" Disabled="!_editing">
|
2020-08-08 03:37:41 +01:00
|
|
|
<Feedback>
|
|
|
|
|
<ValidationError>@L["Please enter a valid dumping group."]</ValidationError>
|
|
|
|
|
</Feedback>
|
|
|
|
|
</TextEdit>
|
|
|
|
|
</Validation>
|
2020-12-20 21:34:13 +00:00
|
|
|
}
|
2020-08-08 03:37:41 +01:00
|
|
|
</Field>
|
2020-12-20 21:34:13 +00:00
|
|
|
}
|
|
|
|
|
@if(_editing || _model.DumpDate != null)
|
2020-08-08 03:37:41 +01:00
|
|
|
{
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel>@L["Dump date"]</FieldLabel>
|
2020-12-20 21:34:13 +00:00
|
|
|
@if(_editing)
|
2020-08-08 03:37:41 +01:00
|
|
|
{
|
2020-12-20 21:34:13 +00:00
|
|
|
<Check @bind-Checked="@_unknownDumpDate" @TValue="bool">@L["Unknown (dump date)"]</Check>
|
|
|
|
|
}
|
|
|
|
|
@if(!_editing ||
|
|
|
|
|
!_unknownDumpDate)
|
2020-08-08 03:37:41 +01:00
|
|
|
{
|
|
|
|
|
<Validation Validator="@ValidateDumpDate">
|
2020-12-20 21:34:13 +00:00
|
|
|
<DateEdit @bind-Date="@_model.DumpDate" ReadOnly="!_editing" @TValue="DateTime?">
|
2020-08-08 03:37:41 +01:00
|
|
|
<Feedback>
|
|
|
|
|
<ValidationError>@L["Please enter a valid dump date."]</ValidationError>
|
|
|
|
|
</Feedback>
|
|
|
|
|
</DateEdit>
|
|
|
|
|
</Validation>
|
2020-12-20 21:34:13 +00:00
|
|
|
}
|
2020-08-08 03:37:41 +01:00
|
|
|
</Field>
|
2020-12-20 21:34:13 +00:00
|
|
|
}
|
2020-08-08 03:37:41 +01:00
|
|
|
<Field>
|
|
|
|
|
<FieldLabel>@L["Media"]</FieldLabel>
|
2020-12-20 21:34:13 +00:00
|
|
|
<Select @bind-SelectedValue="@_model.MediaId" Disabled="!_editing" @TValue="ulong">
|
|
|
|
|
@foreach(var media in _medias)
|
2020-08-08 03:37:41 +01:00
|
|
|
{
|
2020-12-20 21:34:13 +00:00
|
|
|
<SelectItem @TValue="ulong" Value="@media.Id">@media.Title</SelectItem>
|
|
|
|
|
}
|
2020-08-08 03:37:41 +01:00
|
|
|
</Select>
|
|
|
|
|
</Field>
|
2020-12-20 21:34:13 +00:00
|
|
|
@{
|
|
|
|
|
// TODO: Dump hardware
|
|
|
|
|
}
|
2020-08-08 03:37:41 +01:00
|
|
|
</div>
|
|
|
|
|
<div>
|
2020-12-20 21:34:13 +00:00
|
|
|
@if(!_editing)
|
2020-08-08 03:37:41 +01:00
|
|
|
{
|
2020-12-20 21:34:13 +00:00
|
|
|
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
|
|
|
|
|
}
|
2020-08-08 03:37:41 +01:00
|
|
|
else
|
|
|
|
|
{
|
2020-12-20 21:34:13 +00:00
|
|
|
<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/dumps">@L["Back to list"]</a>
|
|
|
|
|
</div>
|