Files
marechai/Marechai/Pages/Admin/Details/Document.razor

1410 lines
56 KiB
Plaintext
Raw Normal View History

2020-08-07 22:30:34 +01:00
@{
2020-12-20 21:34:13 +00:00
/******************************************************************************
2020-08-07 22:30:34 +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/documents/details/{Id:long}"
@page "/admin/documents/edit/{Id:long}"
@page "/admin/documents/create"
@using Marechai.Database.Models
2020-12-20 21:34:13 +00:00
@using Marechai.Database
2020-08-07 22:30:34 +01:00
@inherits OwningComponentBase<DocumentsService>
@inject IStringLocalizer<DocumentsService> L
@inject Iso31661NumericService CountriesService
2020-08-09 17:04:22 +01:00
@inject DocumentCompaniesService CompaniesService
@inject DocumentRolesService DocumentRolesService
@inject CompaniesByDocumentService CompaniesByDocumentService
@inject MachineFamiliesService MachineFamiliesService
@inject DocumentsByMachineFamilyService DocumentsByMachineFamilyService
2020-08-10 01:22:35 +01:00
@inject MachinesService MachinesService
@inject DocumentsByMachineService DocumentsByMachineService
2020-08-10 03:17:24 +01:00
@inject DocumentPeopleService PeopleService
@inject PeopleByDocumentService PeopleByDocumentService
2020-08-14 01:56:22 +01:00
@inject IFileReaderService FileReaderService
@inject DocumentScansService DocumentScansService
2020-08-07 22:30:34 +01:00
@inject NavigationManager NavigationManager
@inject IWebHostEnvironment Host
@inject IJSRuntime JSRuntime
2020-12-20 21:34:13 +00:00
@inject UserManager<ApplicationUser> UserManager
2020-08-07 22:30:34 +01:00
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Document details"]</h3>
<hr />
2020-12-20 21:34:13 +00:00
@if(!_loaded)
2020-08-07 22:30:34 +01:00
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Title using latin script"]</FieldLabel>
<Validation Validator="@ValidateTitle">
2020-12-20 21:34:13 +00:00
<TextEdit @bind-Text="@_model.Title" ReadOnly="!_editing">
2020-08-07 22:30:34 +01:00
<Feedback>
<ValidationError>@L["Please enter a valid title."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
</Field>
2020-12-20 21:34:13 +00:00
@if(_editing || _model.NativeTitle != null)
2020-08-07 22:30:34 +01:00
{
<Field>
<FieldLabel>@L["Native title, that is, title using native script (cyrillic, chinese, etc)"]</FieldLabel>
2020-12-20 21:34:13 +00:00
@if(_editing)
2020-08-07 22:30:34 +01:00
{
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownNativeTitle" @TValue="bool">@L["Unknown (native title)"]</Check>
}
@if(!_editing ||
!_unknownNativeTitle)
2020-08-07 22:30:34 +01:00
{
<Validation Validator="@ValidateNativeTitle">
2020-12-20 21:34:13 +00:00
<TextEdit @bind-Text="@_model.NativeTitle" Disabled="!_editing">
2020-08-07 22:30:34 +01:00
<Feedback>
<ValidationError>@L["Please enter a valid native title."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
2020-08-07 22:30:34 +01:00
</Field>
2020-12-20 21:34:13 +00:00
}
@if(_editing || _model.Published != null)
2020-08-07 22:30:34 +01:00
{
<Field>
<FieldLabel>@L["Published"]</FieldLabel>
2020-12-20 21:34:13 +00:00
@if(_editing)
2020-08-07 22:30:34 +01:00
{
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownPublished" @TValue="bool">@L["Unknown (publication date)"]</Check>
}
@if(!_editing ||
!_unknownPublished)
2020-08-07 22:30:34 +01:00
{
<Validation Validator="@ValidatePublished">
2020-12-20 21:34:13 +00:00
<DateEdit @bind-Date="@_model.Published" ReadOnly="!_editing" @TValue="DateTime?">
2020-08-07 22:30:34 +01:00
<Feedback>
<ValidationError>@L["Please enter a valid publication date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
2020-08-07 22:30:34 +01:00
</Field>
2020-12-20 21:34:13 +00:00
}
@if(_editing || _model.CountryId != null)
2020-08-07 22:30:34 +01:00
{
<Field>
<FieldLabel>@L["Country of publication"]</FieldLabel>
2020-12-20 21:34:13 +00:00
@if(_editing)
2020-08-07 22:30:34 +01:00
{
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownCountry" @TValue="bool">@L["Unknown (country of publication)"]</Check>
}
@if(!_editing ||
!_unknownCountry)
2020-08-07 22:30:34 +01:00
{
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_model.CountryId" Disabled="!_editing" @TValue="short?">
@foreach(var country in _countries)
2020-08-07 22:30:34 +01:00
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="short?" Value="@country.Id">@country.Name</SelectItem>
}
2020-08-07 22:30:34 +01:00
</Select>
2020-12-20 21:34:13 +00:00
}
2020-08-07 22:30:34 +01:00
</Field>
2020-12-20 21:34:13 +00:00
}
2020-08-07 22:30:34 +01:00
</div>
<div>
2020-12-20 21:34:13 +00:00
@if(!_editing &&
!_editingScan &&
!_addingScan)
2020-08-07 22:30:34 +01:00
{
2020-12-20 21:34:13 +00:00
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
2020-08-07 22:30:34 +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/documents">@L["Back to list"]</a>
2020-08-07 22:30:34 +01:00
</div>
2020-12-20 21:34:13 +00:00
@if(!_editing &&
!_editingScan &&
!_addingScan)
2020-08-09 17:04:22 +01:00
{
<hr />
<h3>@L["Companies involved in this document"]</h3>
2020-12-20 21:34:13 +00:00
<Button Clicked="OnAddCompanyClick" Color="Color.Success" Disabled="_addingCompany">@L["Add new (company)"]</Button>
@if(_addingCompany)
2020-08-09 17:04:22 +01:00
{
<div>
<Field>
<FieldLabel>@L["Company"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_addingCompanyId" Disabled="_savingCompany" @TValue="int?">
@foreach(var company in _companies)
2020-08-09 17:04:22 +01:00
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
2020-08-09 17:04:22 +01:00
</Select>
</Field>
<Field>
<FieldLabel>@L["Role"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_addingCompanyRoleId" Disabled="!_editing" @TValue="string">
@foreach(var role in _roles)
2020-08-09 17:04:22 +01:00
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="string" Value="@role.Id">@role.Name</SelectItem>
}
2020-08-09 17:04:22 +01:00
</Select>
</Field>
2020-12-20 21:34:13 +00:00
<Button Clicked="@CancelAddCompany" Color="Color.Primary" Disabled="@_savingCompany">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddCompany" Color="Color.Success" Disabled="@_savingCompany">@L["Add"]</Button>
2020-08-09 17:04:22 +01:00
</div>
}
2020-12-20 21:34:13 +00:00
@if(_documentCompanies?.Count > 0)
2020-08-09 17:04:22 +01:00
{
<div>
<table class="table table-striped">
<thead>
<tr>
<th>
@L["Company"]
</th>
<th>
@L["Role"]
</th>
<th></th>
</tr>
</thead>
<tbody>
2020-12-20 21:34:13 +00:00
@foreach(var item in _documentCompanies)
2020-08-09 17:04:22 +01:00
{
<tr>
<td>
@item.Company
</td>
<td>
@item.Role
</td>
<td>
2020-12-20 21:34:13 +00:00
<Button Clicked="() => {ShowCompanyDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingCompany">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
</div>
}
2020-08-10 03:17:24 +01:00
<hr />
<h3>@L["People involved in this document"]</h3>
2020-12-20 21:34:13 +00:00
<Button Clicked="OnAddPersonClick" Color="Color.Success" Disabled="_addingPerson">@L["Add new (person)"]</Button>
@if(_addingPerson)
2020-08-10 03:17:24 +01:00
{
<div>
<Field>
<FieldLabel>@L["Person"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_addingPersonId" Disabled="_savingPerson" @TValue="int?">
@foreach(var person in _people)
2020-08-10 03:17:24 +01:00
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int?" Value="@person.Id">@person.FullName</SelectItem>
}
2020-08-10 03:17:24 +01:00
</Select>
</Field>
<Field>
<FieldLabel>@L["Role"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_addingPersonRoleId" Disabled="!_editing" @TValue="string">
@foreach(var role in _roles)
2020-08-10 03:17:24 +01:00
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="string" Value="@role.Id">@role.Name</SelectItem>
}
2020-08-10 03:17:24 +01:00
</Select>
</Field>
2020-12-20 21:34:13 +00:00
<Button Clicked="@CancelAddPerson" Color="Color.Primary" Disabled="@_savingPerson">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddPerson" Color="Color.Success" Disabled="@_savingPerson">@L["Add"]</Button>
2020-08-10 03:17:24 +01:00
</div>
}
2020-12-20 21:34:13 +00:00
@if(_documentPeople?.Count > 0)
2020-08-10 03:17:24 +01:00
{
<div>
<table class="table table-striped">
<thead>
<tr>
<th>
@L["Person"]
</th>
<th>
@L["Role"]
</th>
<th></th>
</tr>
</thead>
<tbody>
2020-12-20 21:34:13 +00:00
@foreach(var item in _documentPeople)
2020-08-10 03:17:24 +01:00
{
<tr>
<td>
@item.FullName
</td>
<td>
@item.Role
</td>
<td>
2020-12-20 21:34:13 +00:00
<Button Clicked="() => {ShowPersonDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingPerson">@L["Delete"]</Button>
2020-08-10 03:17:24 +01:00
</td>
</tr>
}
</tbody>
</table>
</div>
}
<hr />
<h3>@L["Machine families this document talks about"]</h3>
2020-12-20 21:34:13 +00:00
<Button Clicked="OnAddFamilyClick" Color="Color.Success" Disabled="_addingMachineFamily">@L["Add new (machine family)"]</Button>
@if(_addingMachineFamily)
{
<div>
<Field>
<FieldLabel>@L["Family"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_addingMachineFamilyId" Disabled="_savingMachineFamily" @TValue="int?">
@foreach(var family in _machineFamilies)
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int?" Value="@family.Id">@family.Name</SelectItem>
}
</Select>
</Field>
2020-12-20 21:34:13 +00:00
<Button Clicked="@CancelAddFamily" Color="Color.Primary" Disabled="@_savingMachineFamily">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddFamily" Color="Color.Success" Disabled="@_savingMachineFamily">@L["Add"]</Button>
</div>
}
2020-12-20 21:34:13 +00:00
@if(_documentMachineFamilies?.Count > 0)
{
<div>
<table class="table table-striped">
<thead>
<tr>
<th>
@L["Family"]
</th>
<th></th>
</tr>
</thead>
<tbody>
2020-12-20 21:34:13 +00:00
@foreach(var item in _documentMachineFamilies)
{
<tr>
<td>
@item.MachineFamily
</td>
<td>
2020-12-20 21:34:13 +00:00
<Button Clicked="() => {ShowMachineFamilyDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingMachineFamily">@L["Delete"]</Button>
2020-08-09 17:04:22 +01:00
</td>
</tr>
}
</tbody>
</table>
</div>
}
2020-08-10 01:22:35 +01:00
<hr />
<h3>@L["Machines this document talks about"]</h3>
2020-12-20 21:34:13 +00:00
<Button Clicked="OnAddMachineClick" Color="Color.Success" Disabled="_addingMachine">@L["Add new (machine)"]</Button>
@if(_addingMachine)
2020-08-10 01:22:35 +01:00
{
<div>
<Field>
<FieldLabel>@L[""]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_addingMachineId" Disabled="_savingMachine" @TValue="int?">
@foreach(var machine in _machines)
2020-08-10 01:22:35 +01:00
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="int?" Value="@machine.Id">@machine.Name</SelectItem>
}
2020-08-10 01:22:35 +01:00
</Select>
</Field>
2020-12-20 21:34:13 +00:00
<Button Clicked="@CancelAddMachine" Color="Color.Primary" Disabled="@_savingMachine">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddMachine" Color="Color.Success" Disabled="@_savingMachine">@L["Add"]</Button>
2020-08-10 01:22:35 +01:00
</div>
}
2020-12-20 21:34:13 +00:00
@if(_documentMachines?.Count > 0)
2020-08-10 01:22:35 +01:00
{
<div>
<table class="table table-striped">
<thead>
<tr>
<th>
@L["Machine"]
</th>
<th></th>
</tr>
</thead>
<tbody>
2020-12-20 21:34:13 +00:00
@foreach(var item in _documentMachines)
2020-08-10 01:22:35 +01:00
{
<tr>
<td>
@item.Machine
</td>
<td>
2020-12-20 21:34:13 +00:00
<Button Clicked="() => {ShowMachineDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingMachine">@L["Delete"]</Button>
2020-08-10 01:22:35 +01:00
</td>
</tr>
}
</tbody>
</table>
</div>
}
2020-08-14 01:56:22 +01:00
2020-12-20 21:34:13 +00:00
<Button Clicked="@AddScan" Color="Color.Primary">@L["Add new scan"]</Button>
2020-08-14 01:56:22 +01:00
@if(_scans.Count > 0)
{
2020-12-20 21:34:13 +00:00
foreach(var scan in _scans)
2020-08-14 01:56:22 +01:00
{
<div class="col-md-2">
<figure class="figure">
<picture>
2020-12-20 21:34:13 +00:00
<source srcset="/assets/scans/documents/thumbs/avif/hd/@(scan).avif, /assets/scans/documents/thumbs/avif/1440p/@(scan).avif 2x, /assets/scans/documents/thumbs/avif/4k/@(scan).avif 3x" type="image/avif">
<source srcset="/assets/scans/documents/thumbs/heif/hd/@(scan).heic, /assets/scans/documents/thumbs/heif/1440p/@(scan).heic 2x, /assets/scans/documents/thumbs/heif/4k/@(scan).heic 3x" type="image/heic">
<source srcset="/assets/scans/documents/thumbs/webp/hd/@(scan).webp, /assets/scans/documents/thumbs/webp/1440p/@(scan).webp 2x, /assets/scans/documents/thumbs/webp/4k/@(scan).webp 3x" type="image/webp">
<source srcset="/assets/scans/documents/thumbs/jp2k/hd/@(scan).jp2, /assets/scans/documents/thumbs/jp2k/1440p/@(scan).jp2 2x, /assets/scans/documents/thumbs/jp2k/4k/@(scan).jp2 3x" type="image/jp2">
<img alt="" class="figure-img img-fluid rounded" height="auto" src="/assets/scans/documents/thumbs/jpeg/hd/@(scan).jpg" srcset="/assets/scans/documents/thumbs/jpeg/hd/@(scan).jpg, /assets/scans/documents/thumbs/jpeg/1440p/@(scan).jpg 2x, /assets/scans/documents/thumbs/jpeg/4k/@(scan).jpg 3x" style="max-height: 256px; max-width: 256px" width="auto" />
2020-08-14 01:56:22 +01:00
</picture>
<figcaption class="figure-caption">
2020-12-20 21:34:13 +00:00
<Button Clicked="async () => {await EditScan(scan);}" Color="Color.Secondary">@L["Delete"]</Button>
<Button Clicked="() => {ShowScanDeleteModal(scan);}" Color="Color.Danger">@L["Delete"]</Button>
2020-08-14 01:56:22 +01:00
</figcaption>
</figure>
</div>
}
}
2020-12-20 21:34:13 +00:00
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
2020-08-09 17:04:22 +01:00
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@_deleteTitle</ModalTitle>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@_deleteText</Text>
</ModalBody>
<ModalFooter>
2020-12-20 21:34:13 +00:00
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
2020-08-09 17:04:22 +01:00
</ModalFooter>
</ModalContent>
2020-12-20 21:34:13 +00:00
</Modal>}
2020-08-14 01:56:22 +01:00
@if(_addingScan && !_editing)
{
@if(!_uploaded)
{
@if(!_uploading)
{
<FieldLabel>@L["Choose scan file"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<input ref=_inputUpload @type="file" />
<br />
2020-08-14 01:56:22 +01:00
<Field>
<FieldLabel>@L["Scan type"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@_uploadScanType" Disabled="!_editingScan" @TValue="uint">
@foreach(uint value in Enum.GetValues(typeof(DocumentScanType)))
2020-08-14 01:56:22 +01:00
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="uint" Value="@value">@(((DocumentScanType)value).ToString())</SelectItem>
}
2020-08-14 01:56:22 +01:00
</Select>
</Field>
<Field>
<FieldLabel>@L["Page"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownScanPage" @TValue="bool">@L["Unknown (scan page)"]</Check>
@if(!_unknownScanPage)
2020-08-14 01:56:22 +01:00
{
<Validation Validator="@ValidateUnsignedIntegerBiggerThanZero">
2020-12-20 21:34:13 +00:00
<NumericEdit @bind-Value="@_uploadScanPage" Disabled="!_editing" @TValue="uint?">
2020-08-14 01:56:22 +01:00
<Feedback>
<ValidationError>@L["Please enter a valid scanned page."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
2020-08-14 01:56:22 +01:00
</Field>
2020-12-20 21:34:13 +00:00
<Button Clicked="@UploadFile" Color="Color.Success" Disabled="@_uploading">@L["Upload"]</Button> <br />
2020-08-14 01:56:22 +01:00
}
else
{
@L["Uploading..."]
<div class="progress">
2020-12-20 21:34:13 +00:00
<div aria-valuemax="100" aria-valuemin="0" aria-valuenow="@_progressValue" class="progress-bar" role="progressbar" style="width: @(_progressValue)%;">@($"{_progressValue:F2}")%</div>
2020-08-14 01:56:22 +01:00
</div>
}
@if(_uploadError)
{
<span class="text-danger">@_uploadErrorMessage</span>
}
}
else
{
<h5>@string.Format(L["Image format recognized as {0}"], _imageFormat)</h5>
2020-12-20 21:34:13 +00:00
@if(_allFinished)
2020-08-14 01:56:22 +01:00
{
<span class="text-success">@L["All finished!"]</span>
}
<table>
2020-12-20 21:34:13 +00:00
<tr>
<td>
@L["Extracting Exif information..."]
</td>
<td>
@if(_extractExif == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_extractExif == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
</tr>
<tr>
<td>
@L["Moving file to proper place..."]
</td>
<td>
@if(_moveFile == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_moveFile == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_moveFile == true)
{
<a href="/assets/scans/documents/originals/@($"{_selectedScan.Id}{_selectedScan.OriginalExtension}")" target="_blank">
<img alt="" height="auto" src="/assets/scans/documents/originals/@($"{_selectedScan.Id}{_selectedScan.OriginalExtension}")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to JPEG with an HD resolution (thumbnail)..."]
</td>
<td>
@if(_convertJpegHdTh == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertJpegHdTh == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertJpegHdTh == true)
{
<a href="@($"/assets/scans/documents/thumbs/jpeg/hd/{_selectedScan.Id}.jpg")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/jpeg/hd/{_selectedScan.Id}.jpg")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to JPEG with a 1440p resolution (thumbnail)..."]
</td>
<td>
@if(_convertJpeg1440Th == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertJpeg1440Th == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertJpeg1440Th == true)
{
<a href="@($"/assets/scans/documents/thumbs/jpeg/1440p/{_selectedScan.Id}.jpg")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/jpeg/1440p/{_selectedScan.Id}.jpg")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to JPEG with a 4K resolution (thumbnail)..."]
</td>
<td>
@if(_convertJpeg4kTh == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertJpeg4kTh == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertJpeg4kTh == true)
{
<a href="@($"/assets/scans/documents/thumbs/jpeg/4k/{_selectedScan.Id}.jpg")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/jpeg/4k/{_selectedScan.Id}.jpg")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to JPEG with an HD resolution..."]
</td>
<td>
@if(_convertJpegHd == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertJpegHd == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertJpegHd == true)
{
<a href="@($"/assets/scans/documents/jpeg/hd/{_selectedScan.Id}.jpg")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/jpeg/hd/{_selectedScan.Id}.jpg")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to JPEG with a 1440p resolution..."]
</td>
<td>
@if(_convertJpeg1440 == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertJpeg1440 == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertJpeg1440 == true)
{
<a href="@($"/assets/scans/documents/jpeg/1440p/{_selectedScan.Id}.jpg")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/jpeg/1440p/{_selectedScan.Id}.jpg")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to JPEG with a 4K resolution..."]
</td>
<td>
@if(_convertJpeg4k == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertJpeg4k == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertJpeg4k == true)
{
<a href="@($"/assets/scans/documents/jpeg/4k/{_selectedScan.Id}.jpg")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/jpeg/4k/{_selectedScan.Id}.jpg")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to JPEG2000 with an HD resolution (thumbnail)..."]
</td>
<td>
@if(_convertJp2kHdTh == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertJp2kHdTh == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertJp2kHdTh == true)
{
<a href="@($"/assets/scans/documents/thumbs/jp2k/hd/{_selectedScan.Id}.jp2")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/jp2k/hd/{_selectedScan.Id}.jp2")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to JPEG2000 with a 1440p resolution (thumbnail)..."]
</td>
<td>
@if(_convertJp2k1440Th == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertJp2k1440Th == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertJp2k1440Th == true)
{
<a href="@($"/assets/scans/documents/thumbs/jp2k/1440p/{_selectedScan.Id}.jp2")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/jp2k/1440p/{_selectedScan.Id}.jp2")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to JPEG2000 with a 4K resolution (thumbnail)..."]
</td>
<td>
@if(_convertJp2k4kTh == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertJp2k4kTh == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertJp2k4kTh == true)
{
<a href="@($"/assets/scans/documents/thumbs/jp2k/4k/{_selectedScan.Id}.jp2")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/jp2k/4k/{_selectedScan.Id}.jp2")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to JPEG2000 with an HD resolution..."]
</td>
<td>
@if(_convertJp2kHd == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertJp2kHd == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertJp2kHd == true)
{
<a href="@($"/assets/scans/documents/jp2k/hd/{_selectedScan.Id}.jp2")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/jp2k/hd/{_selectedScan.Id}.jp2")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to JPEG2000 with a 1440p resolution..."]
</td>
<td>
@if(_convertJp2k1440 == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertJp2k1440 == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertJp2k1440 == true)
{
<a href="@($"/assets/scans/documents/jp2k/1440p/{_selectedScan.Id}.jp2")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/jp2k/1440p/{_selectedScan.Id}.jp2")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to JPEG2000 with a 4K resolution..."]
</td>
<td>
@if(_convertJp2k4k == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertJp2k4k == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertJp2k4k == true)
{
<a href="@($"/assets/scans/documents/jp2k/4k/{_selectedScan.Id}.jp2")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/jp2k/4k/{_selectedScan.Id}.jp2")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to WebP with an HD resolution (thumbnail)..."]
</td>
<td>
@if(_convertWebpHdTh == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertWebpHdTh == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertWebpHdTh == true)
{
<a href="@($"/assets/scans/documents/thumbs/webp/hd/{_selectedScan.Id}.webp")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/webp/hd/{_selectedScan.Id}.webp")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to WebP with a 1440p resolution (thumbnail)..."]
</td>
<td>
@if(_convertWebp1440Th == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertWebp1440Th == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertWebp1440Th == true)
{
<a href="@($"/assets/scans/documents/thumbs/webp/1440p/{_selectedScan.Id}.webp")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/webp/1440p/{_selectedScan.Id}.webp")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to WebP with a 4K resolution (thumbnail)..."]
</td>
<td>
@if(_convertWebp4kTh == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertWebp4kTh == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertWebp4kTh == true)
{
<a href="@($"/assets/scans/documents/thumbs/webp/4k/{_selectedScan.Id}.webp")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/webp/4k/{_selectedScan.Id}.webp")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to WebP with an HD resolution..."]
</td>
<td>
@if(_convertWebpHd == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertWebpHd == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertWebpHd == true)
{
<a href="@($"/assets/scans/documents/webp/hd/{_selectedScan.Id}.webp")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/webp/hd/{_selectedScan.Id}.webp")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to WebP with a 1440p resolution..."]
</td>
<td>
@if(_convertWebp1440 == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertWebp1440 == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertWebp1440 == true)
{
<a href="@($"/assets/scans/documents/webp/1440p/{_selectedScan.Id}.webp")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/webp/1440p/{_selectedScan.Id}.webp")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to WebP with a 4K resolution..."]
</td>
<td>
@if(_convertWebp4k == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertWebp4k == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertWebp4k == true)
{
<a href="@($"/assets/scans/documents/webp/4k/{_selectedScan.Id}.webp")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/webp/4k/{_selectedScan.Id}.webp")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to HEIF with an HD resolution (thumbnail)..."]
</td>
<td>
@if(_convertHeifHdTh == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertHeifHdTh == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertHeifHdTh == true)
{
<a href="@($"/assets/scans/documents/thumbs/heif/hd/{_selectedScan.Id}.heic")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/heif/hd/{_selectedScan.Id}.heic")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to HEIF with a 1440p resolution (thumbnail)..."]
</td>
<td>
@if(_convertHeif1440Th == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertHeif1440Th == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertHeif1440Th == true)
{
<a href="@($"/assets/scans/documents/thumbs/heif/1440p/{_selectedScan.Id}.heic")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/heif/1440p/{_selectedScan.Id}.heic")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to HEIF with a 4K resolution (thumbnail)..."]
</td>
<td>
@if(_convertHeif4kTh == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertHeif4kTh == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertHeif4kTh == true)
{
<a href="@($"/assets/scans/documents/thumbs/heif/4k/{_selectedScan.Id}.heic")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/heif/4k/{_selectedScan.Id}.heic")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to HEIF with an HD resolution..."]
</td>
<td>
@if(_convertHeifHd == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertHeifHd == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertHeifHd == true)
{
<a href="@($"/assets/scans/documents/heif/hd/{_selectedScan.Id}.heic")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/heif/hd/{_selectedScan.Id}.heic")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to HEIF with a 1440p resolution..."]
</td>
<td>
@if(_convertHeif1440 == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertHeif1440 == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertHeif1440 == true)
{
<a href="@($"/assets/scans/documents/heif/1440p/{_selectedScan.Id}.heic")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/heif/1440p/{_selectedScan.Id}.heic")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to HEIF with a 4K resolution..."]
</td>
<td>
@if(_convertHeif4k == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertHeif4k == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertHeif4k == true)
{
<a href="@($"/assets/scans/documents/heif/4k/{_selectedScan.Id}.heic")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/heif/4k/{_selectedScan.Id}.heic")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to AV1F with an HD resolution (thumbnail)..."]
</td>
<td>
@if(_convertAvifHdTh == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertAvifHdTh == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertAvifHdTh == true)
{
<a href="@($"/assets/scans/documents/thumbs/avif/hd/{_selectedScan.Id}.avif")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/avif/hd/{_selectedScan.Id}.avif")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to AV1F with a 1440p resolution (thumbnail)..."]
</td>
<td>
@if(_convertAvif1440Th == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertAvif1440Th == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertAvif1440Th == true)
{
<a href="@($"/assets/scans/documents/thumbs/avif/1440p/{_selectedScan.Id}.avif")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/avif/1440p/{_selectedScan.Id}.avif")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to AV1F with a 4K resolution (thumbnail)..."]
</td>
<td>
@if(_convertAvif4kTh == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertAvif4kTh == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertAvif4kTh == true)
{
<a href="@($"/assets/scans/documents/thumbs/avif/4k/{_selectedScan.Id}.avif")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/thumbs/avif/4k/{_selectedScan.Id}.avif")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to AV1F with an HD resolution..."]
</td>
<td>
@if(_convertAvifHd == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertAvifHd == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertAvifHd == true)
{
<a href="@($"/assets/scans/documents/avif/hd/{_selectedScan.Id}.avif")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/avif/hd/{_selectedScan.Id}.avif")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to AV1F with a 1440p resolution..."]
</td>
<td>
@if(_convertAvif1440 == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertAvif1440 == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertAvif1440 == true)
{
<a href="@($"/assets/scans/documents/avif/1440p/{_selectedScan.Id}.avif")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/avif/1440p/{_selectedScan.Id}.avif")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Converting photo to AV1F with a 4K resolution..."]
</td>
<td>
@if(_convertAvif4k == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_convertAvif4k == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
@if(_convertAvif4k == true)
{
<a href="@($"/assets/scans/documents/avif/4k/{_selectedScan.Id}.avif")" target="_blank">
<img alt="" height="auto" src="@($"/assets/scans/documents/avif/4k/{_selectedScan.Id}.avif")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
</tr>
<tr>
<td>
@L["Adding photo to database..."]
</td>
<td>
@if(_addToDatabase == true)
{
<span class="text-success">@L["OK!"]</span>
}
else if(_addToDatabase == false)
{
<span class="text-danger">@L["Error!"]</span>
}
</td>
<td>
</td>
</tr>
2020-08-14 01:56:22 +01:00
</table>
2020-12-20 21:34:13 +00:00
}
2020-08-14 01:56:22 +01:00
}
@if(_editingScan && !_editing)
{
<div>
<Field>
<FieldLabel>@L["Uploaded by"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<TextEdit Disabled="true" Text="@($"{_scanUser.UserName} <{_scanUser.Email}>")" />
2020-08-14 01:56:22 +01:00
</Field>
<Field>
<FieldLabel>@L["Uploaded date"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<TextEdit Disabled="true" Text="@($"{_selectedScan.UploadDate}")" />
2020-08-14 01:56:22 +01:00
</Field>
<Field>
<FieldLabel>@L["Scan type"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@ScanType" Disabled="!_editingScan" @TValue="uint">
@foreach(uint value in Enum.GetValues(typeof(DocumentScanType)))
2020-08-14 01:56:22 +01:00
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="uint" Value="@value">@(((DocumentScanType)value).ToString())</SelectItem>
}
2020-08-14 01:56:22 +01:00
</Select>
</Field>
<Field>
<FieldLabel>@L["Page"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownScanPage" @TValue="bool">@L["Unknown (scan page)"]</Check>
@if(!_unknownScanPage)
2020-08-14 01:56:22 +01:00
{
<Validation Validator="@ValidateUnsignedIntegerBiggerThanZero">
2020-12-20 21:34:13 +00:00
<NumericEdit @bind-Value="@_selectedScan.Page" Disabled="!_editing" @TValue="uint?">
2020-08-14 01:56:22 +01:00
<Feedback>
<ValidationError>@L["Please enter a valid scanned page."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
2020-08-14 01:56:22 +01:00
</Field>
<Field>
<FieldLabel>@L["Author"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownScanAuthor" @TValue="bool">@L["Unknown (author)"]</Check>
@if(!_unknownScanAuthor)
2020-08-14 01:56:22 +01:00
{
<Validation Validator="@ValidateScanAuthor">
2020-12-20 21:34:13 +00:00
<TextEdit @bind-Text="@_selectedScan.Author" Disabled="!_editingScan">
2020-08-14 01:56:22 +01:00
<Feedback>
<ValidationError>@L["Please enter a valid author."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
2020-08-14 01:56:22 +01:00
</Field>
<Field>
<FieldLabel>@L["Scanner manufacturer"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownScanScannerManufacturer" @TValue="bool">@L["Unknown (scanner manufacturer)"]</Check>
@if(!_unknownScanScannerManufacturer)
2020-08-14 01:56:22 +01:00
{
<Validation Validator="@ValidateScannerManufacturer">
2020-12-20 21:34:13 +00:00
<TextEdit @bind-Text="@_selectedScan.ScannerManufacturer" Disabled="!_editingScan">
2020-08-14 01:56:22 +01:00
<Feedback>
<ValidationError>@L["Please enter a valid scanner manufacturer."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
2020-08-14 01:56:22 +01:00
</Field>
<Field>
<FieldLabel>@L["Scanner model"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownScanScannerModel" @TValue="bool">@L["Unknown (scanner model)"]</Check>
@if(!_unknownScanScannerModel)
2020-08-14 01:56:22 +01:00
{
<Validation Validator="@ValidateScannerModel">
2020-12-20 21:34:13 +00:00
<TextEdit @bind-Text="@_selectedScan.ScannerModel" Disabled="!_editingScan">
2020-08-14 01:56:22 +01:00
<Feedback>
<ValidationError>@L["Please enter a valid scanner model."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
2020-08-14 01:56:22 +01:00
</Field>
<Field>
<FieldLabel>@L["Color space"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownScanColorSpace" @TValue="bool">@L["Unknown (color space)"]</Check>
@if(!_unknownScanColorSpace)
2020-08-14 01:56:22 +01:00
{
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@ScanColorSpace" Disabled="!_editingScan" @TValue="ushort">
@foreach(ushort value in Enum.GetValues(typeof(ColorSpace)))
2020-08-14 01:56:22 +01:00
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="ushort" Value="@value">@(((ColorSpace)value).ToString())</SelectItem>
}
2020-08-14 01:56:22 +01:00
</Select>
2020-12-20 21:34:13 +00:00
}
2020-08-14 01:56:22 +01:00
</Field>
<Field>
<FieldLabel>@L["Creation date"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownScanCreationDate" @TValue="bool">@L["Unknown (creation date)"]</Check>
@if(!_unknownScanCreationDate)
2020-08-14 01:56:22 +01:00
{
<Validation Validator="@ValidateDate">
2020-12-20 21:34:13 +00:00
<DateEdit @bind-Date="@_selectedScan.CreationDate" Disabled="!_editingScan" @TValue="DateTime?">
2020-08-14 01:56:22 +01:00
<Feedback>
<ValidationError>@L["Please enter a correct creation date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
</Field>
2020-08-14 01:56:22 +01:00
<Field>
<FieldLabel>@L["Exif version"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownScanExifVersion" @TValue="bool">@L["Unknown (exif version)"]</Check>
@if(!_unknownScanExifVersion)
2020-08-14 01:56:22 +01:00
{
<Validation Validator="@ValidateExifVersion">
2020-12-20 21:34:13 +00:00
<TextEdit @bind-Text="@_selectedScan.ExifVersion" Disabled="!_editingScan">
2020-08-14 01:56:22 +01:00
<Feedback>
<ValidationError>@L["Please enter a valid Exif version."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
2020-08-14 01:56:22 +01:00
</Field>
<Field>
<FieldLabel>@L["Horizontal resolution"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownScanHorizontalResolution" @TValue="bool">@L["Unknown (horizontal resolution)"]</Check>
@if(!_unknownScanHorizontalResolution)
2020-08-14 01:56:22 +01:00
{
<Validation Validator="@ValidateDoubleBiggerThanZero">
2020-12-20 21:34:13 +00:00
<NumericEdit @bind-Value="@_selectedScan.HorizontalResolution" Decimals="3" Disabled="!_editingScan" @TValue="double?">
2020-08-14 01:56:22 +01:00
<Feedback>
<ValidationError>@L["Please enter a valid horizontal resolution."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
2020-08-14 01:56:22 +01:00
</Field>
<Field>
<FieldLabel>@L["Resolution unit"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownScanResolutionUnit" @TValue="bool">@L["Unknown (resolution unit)"]</Check>
@if(!_unknownScanResolutionUnit)
2020-08-14 01:56:22 +01:00
{
2020-12-20 21:34:13 +00:00
<Select @bind-SelectedValue="@ScanResolutionUnit" Disabled="!_editingScan" @TValue="ushort">
@foreach(ushort value in Enum.GetValues(typeof(ResolutionUnit)))
2020-08-14 01:56:22 +01:00
{
2020-12-20 21:34:13 +00:00
<SelectItem @TValue="ushort" Value="@value">@(((ResolutionUnit)value).ToString())</SelectItem>
}
2020-08-14 01:56:22 +01:00
</Select>
2020-12-20 21:34:13 +00:00
}
2020-08-14 01:56:22 +01:00
</Field>
<Field>
<FieldLabel>@L["Software used"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownScanSoftwareUsed" @TValue="bool">@L["Unknown (software used)"]</Check>
@if(!_unknownScanSoftwareUsed)
2020-08-14 01:56:22 +01:00
{
<Validation Validator="@ValidateSoftwareUsed">
2020-12-20 21:34:13 +00:00
<TextEdit @bind-Text="@_selectedScan.SoftwareUsed" Disabled="!_editingScan">
2020-08-14 01:56:22 +01:00
<Feedback>
<ValidationError>@L["Please enter a valid software used."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
2020-08-14 01:56:22 +01:00
</Field>
<Field>
<FieldLabel>@L["Vertical resolution"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownScanVerticalResolution" @TValue="bool">@L["Unknown (vertical resolution)"]</Check>
@if(!_unknownScanVerticalResolution)
2020-08-14 01:56:22 +01:00
{
<Validation Validator="@ValidateDoubleBiggerThanZero">
2020-12-20 21:34:13 +00:00
<NumericEdit @bind-Value="@_selectedScan.VerticalResolution" Decimals="3" Disabled="!_editingScan" @TValue="double?">
2020-08-14 01:56:22 +01:00
<Feedback>
<ValidationError>@L["Please enter a valid vertical resolution."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
2020-08-14 01:56:22 +01:00
</Field>
<Field>
<FieldLabel>@L["User comments"]</FieldLabel>
2020-12-20 21:34:13 +00:00
<Check @bind-Checked="@_unknownScanComments" @TValue="bool">@L["Unknown or empty (user comments)"]</Check>
@if(!_unknownScanComments)
2020-08-14 01:56:22 +01:00
{
<Validation Validator="@ValidateComments">
2020-12-20 21:34:13 +00:00
<TextEdit @bind-Text="@_selectedScan.Comments" Disabled="!_editingScan">
2020-08-14 01:56:22 +01:00
<Feedback>
<ValidationError>@L["Please enter valid comments."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
2020-12-20 21:34:13 +00:00
}
2020-08-14 01:56:22 +01:00
</Field>
2020-12-20 21:34:13 +00:00
<Button Clicked="@OnSaveScanClicked" Color="Color.Success">@L["Save"]</Button>
<Button Clicked="@OnCancelScanClicked" Color="Color.Danger">@L["Cancel"]</Button>
2020-08-14 01:56:22 +01:00
</div>
2020-08-09 17:04:22 +01:00
}