Code refactor.

This commit is contained in:
2020-12-20 21:34:13 +00:00
parent 5880d93368
commit 13b7ba1f9b
117 changed files with 7284 additions and 7495 deletions

View File

@@ -221,7 +221,7 @@ space_after_last_attribute=false
space_before_self_closing=true
attribute_style=on_single_line
attribute_indent=align_by_first_attribute
sort_attributes=true
sort_attributes=false
sort_class_selectors=true
max_blank_lines_between_tags=0
linebreak_before_all_elements=true
@@ -630,3 +630,10 @@ indent_type_constraints=true
[*.{js,js.map,ts}]
quote_style=doublequoted
termination_style=ensure_semicolon
[*.razor]
razor_always_use_end_of_line_brace_style=false
blank_lines_around_razor_sections=true
blank_lines_around_razor_helpers=true
blank_lines_around_razor_functions=true
sort_attributes=false

View File

@@ -38,8 +38,7 @@ namespace Marechai.Database.Models
public class MarechaiContext : IdentityDbContext<ApplicationUser, ApplicationRole, string>
{
readonly ValueConverter<string, byte[]> hexToBytesConverter =
new ValueConverter<string, byte[]>(v => HexStringToBytesConverter.StringToHex(v),
v => HexStringToBytesConverter.HexToString(v));
new(v => HexStringToBytesConverter.StringToHex(v), v => HexStringToBytesConverter.HexToString(v));
public MarechaiContext() {}
@@ -142,13 +141,17 @@ namespace Marechai.Database.Models
IConfigurationBuilder builder = new ConfigurationBuilder().AddJsonFile("appsettings.json");
IConfigurationRoot configuration = builder.Build();
optionsBuilder.UseMySql(configuration.GetConnectionString("DefaultConnection"), new MariaDbServerVersion(new Version(10, 5, 0)), b=> b.UseMicrosoftJson()).UseLazyLoadingProxies();
optionsBuilder.
UseMySql(configuration.GetConnectionString("DefaultConnection"),
new MariaDbServerVersion(new Version(10, 5, 0)), b => b.UseMicrosoftJson()).
UseLazyLoadingProxies();
}
public async Task<int> SaveChangesWithUserAsync(string userId)
{
ChangeTracker.DetectChanges();
List<Audit> audits = new List<Audit>();
List<Audit> audits = new();
foreach(EntityEntry entry in ChangeTracker.Entries())
{
@@ -161,10 +164,10 @@ namespace Marechai.Database.Models
audit.UserId = userId;
audit.Table = entry.Metadata.GetTableName();
Dictionary<string, object> keys = new Dictionary<string, object>();
Dictionary<string, object> olds = new Dictionary<string, object>();
Dictionary<string, object> news = new Dictionary<string, object>();
List<string> columns = new List<string>();
Dictionary<string, object> keys = new();
Dictionary<string, object> olds = new();
Dictionary<string, object> news = new();
List<string> columns = new();
foreach(PropertyEntry property in entry.Properties)
{

View File

@@ -365,7 +365,7 @@ namespace Marechai.Database
Console.WriteLine("Getting all items from `console_company`");
Dictionary<int, string> consoleCompanies = new Dictionary<int, string>();
Dictionary<int, string> consoleCompanies = new();
dbCmd = dbCon.CreateCommand();
IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter();
dbCmd.CommandText = "SELECT * from console_company";
@@ -376,7 +376,7 @@ namespace Marechai.Database
foreach(DataRow dataRow in dataSet.Tables[0].Rows)
consoleCompanies.Add(int.Parse(dataRow["id"].ToString()), dataRow["company"].ToString());
Dictionary<int, int> conversionEquivalents = new Dictionary<int, int>();
Dictionary<int, int> conversionEquivalents = new();
IDbTransaction trans;
Console.WriteLine("Converting all items from `console_company` to `companies`");
@@ -417,7 +417,7 @@ namespace Marechai.Database
}
Console.WriteLine("Getting all items from `consoles`");
Dictionary<int, int> consoleIdAndCompanyId = new Dictionary<int, int>();
Dictionary<int, int> consoleIdAndCompanyId = new();
dbCmd = dbCon.CreateCommand();
dataAdapter = dbCore.GetNewDataAdapter();
dbCmd.CommandText = "SELECT id,company from consoles";
@@ -1309,7 +1309,7 @@ namespace Marechai.Database
Console.WriteLine("Getting all items from `music_synths`");
Dictionary<int, string> musicSynths = new Dictionary<int, string>();
Dictionary<int, string> musicSynths = new();
dbCmd = dbCon.CreateCommand();
IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter();
dbCmd.CommandText = "SELECT * from music_synths";
@@ -1320,7 +1320,7 @@ namespace Marechai.Database
foreach(DataRow dataRow in dataSet.Tables[0].Rows)
musicSynths.Add(int.Parse(dataRow["id"].ToString()), dataRow["name"].ToString());
Dictionary<int, int> conversionEquivalents = new Dictionary<int, int>();
Dictionary<int, int> conversionEquivalents = new();
Console.WriteLine("Converting all items from `music_synths` to `sound_synths`");
@@ -1359,7 +1359,7 @@ namespace Marechai.Database
}
Console.WriteLine("Getting all items from `consoles`");
Dictionary<int, int> consoleIdAndMusicSynthId = new Dictionary<int, int>();
Dictionary<int, int> consoleIdAndMusicSynthId = new();
dbCmd = dbCon.CreateCommand();
dataAdapter = dbCore.GetNewDataAdapter();
dbCmd.CommandText = "SELECT id,music_synth from consoles";
@@ -1391,7 +1391,7 @@ namespace Marechai.Database
trans.Commit();
Console.WriteLine("Getting all items from `computers`");
Dictionary<int, int> computerIdAndMusicSynthId = new Dictionary<int, int>();
Dictionary<int, int> computerIdAndMusicSynthId = new();
dbCmd = dbCon.CreateCommand();
dataAdapter = dbCore.GetNewDataAdapter();
dbCmd.CommandText = "SELECT id,music_synth from computers";

View File

@@ -37,7 +37,7 @@ namespace Marechai.Database.Seeders
public static void Seed(MarechaiContext context)
{
List<DocumentRole> existingRoles = context.DocumentRoles.ToList();
List<DocumentRole> newDocumentRoles = new List<DocumentRole>();
List<DocumentRole> newDocumentRoles = new();
int updatedDocumentRolesCount = 0;
foreach(DocumentRole role in new[]

View File

@@ -91,7 +91,7 @@ namespace Marechai.Database.Seeders
}
Dictionary<string, Models.Iso4217> existingCodes = context.Iso4217.ToDictionary(c => c.Code);
Dictionary<string, Models.Iso4217> newCodes = new Dictionary<string, Models.Iso4217>();
Dictionary<string, Models.Iso4217> newCodes = new();
long modified = 0;

View File

@@ -43,7 +43,7 @@ namespace Marechai.Database.Seeders
IEnumerable<string> files = Directory.EnumerateFiles("iso639", "iso-639-3_*.tab");
long modified = 0;
List<Models.Iso639> codes = new List<Models.Iso639>();
List<Models.Iso639> codes = new();
foreach(string file in files)
{
@@ -121,7 +121,7 @@ namespace Marechai.Database.Seeders
}
List<Models.Iso639> existingCodes = context.Iso639.ToList();
List<Models.Iso639> newCodes = new List<Models.Iso639>();
List<Models.Iso639> newCodes = new();
foreach(Models.Iso639 code in codes)
{

View File

@@ -36,7 +36,7 @@ namespace Marechai.Database.Seeders
public static void Seed(MarechaiContext context)
{
List<Models.License> existingLicenses = context.Licenses.ToList();
List<Models.License> newLicenses = new List<Models.License>();
List<Models.License> newLicenses = new();
int updatedLicencesCount = 0;
foreach(Models.License license in new[]

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -27,7 +27,7 @@
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/>
<AuthorizeRouteView DefaultLayout="@typeof(MainLayout)" RouteData="@routeData" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">

View File

@@ -4,4 +4,4 @@
ViewData["Title"] = "Confirm email change";
}
<h1>@ViewData["Title"]</h1>
<partial name="_StatusMessage" model="Model.StatusMessage" />
<partial model="Model.StatusMessage" name="_StatusMessage" />

View File

@@ -7,7 +7,7 @@
public async Task<IActionResult> OnPost()
{
if (SignInManager.IsSignedIn(User))
if(SignInManager.IsSignedIn(User))
{
await SignInManager.SignOutAsync();
}

View File

@@ -52,7 +52,7 @@
<h4>Use another service to log in.</h4>
<hr />
@{
if ((Model.ExternalLogins?.Count ?? 0) == 0)
if((Model.ExternalLogins?.Count ?? 0) == 0)
{
<div>
<p>
@@ -64,17 +64,17 @@
}
else
{
<form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="form-horizontal">
<form asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" class="form-horizontal" id="external-account" method="post">
<div>
<p>
@foreach (var provider in Model.ExternalLogins)
@foreach(var provider in Model.ExternalLogins)
{
<button type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button>
<button class="btn btn-primary" name="provider" title="Log in using your @provider.DisplayName account" type="submit" value="@provider.Name">@provider.DisplayName</button>
}
</p>
</div>
</form>
}
}
}
</section>
</div>

View File

@@ -8,12 +8,12 @@
<p>Your login is protected with an authenticator app. Enter your authenticator code below.</p>
<div class="row">
<div class="col-md-4">
<form method="post" asp-route-returnUrl="@Model.ReturnUrl">
<form asp-route-returnUrl="@Model.ReturnUrl" method="post">
<input asp-for="RememberMe" type="hidden" />
<div asp-validation-summary="All" class="text-danger"></div>
<div class="form-group">
<label asp-for="Input.TwoFactorCode"></label>
<input asp-for="Input.TwoFactorCode" class="form-control" autocomplete="off" />
<input asp-for="Input.TwoFactorCode" autocomplete="off" class="form-control" />
<span asp-validation-for="Input.TwoFactorCode" class="text-danger"></span>
</div>
<div class="form-group">
@@ -32,7 +32,7 @@
</div>
<p>
Don't have access to your authenticator device? You can
<a id="recovery-code-login" asp-page="./LoginWithRecoveryCode" asp-route-returnUrl="@Model.ReturnUrl">log in with a recovery code</a>.
<a asp-page="./LoginWithRecoveryCode" asp-route-returnUrl="@Model.ReturnUrl" id="recovery-code-login">log in with a recovery code</a>.
</p>
@section Scripts {

View File

@@ -15,7 +15,7 @@
<div asp-validation-summary="All" class="text-danger"></div>
<div class="form-group">
<label asp-for="Input.RecoveryCode"></label>
<input asp-for="Input.RecoveryCode" class="form-control" autocomplete="off" />
<input asp-for="Input.RecoveryCode" autocomplete="off" class="form-control" />
<span asp-validation-for="Input.RecoveryCode" class="text-danger"></span>
</div>
<button class="btn btn-primary" type="submit">Log in</button>

View File

@@ -5,7 +5,7 @@
ViewData["ActivePage"] = ManageNavPages.ChangePassword;
}
<h4>@ViewData["Title"]</h4>
<partial name="_StatusMessage" for="StatusMessage" />
<partial for="StatusMessage" name="_StatusMessage" />
<div class="row">
<div class="col-md-6">
<form id="change-password-form" method="post">

View File

@@ -13,7 +13,7 @@
<div>
<form class="form-group" id="delete-user" method="post">
<div asp-validation-summary="All" class="text-danger"></div>
@if (Model.RequirePassword)
@if(Model.RequirePassword)
{
<div class="form-group">
<label asp-for="Input.Password"></label>

View File

@@ -4,7 +4,7 @@
ViewData["Title"] = "Disable two-factor authentication (2FA)";
ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication;
}
<partial name="_StatusMessage" for="StatusMessage" />
<partial for="StatusMessage" name="_StatusMessage" />
<h2>@ViewData["Title"]</h2>
<div class="alert alert-warning" role="alert">
<p>

View File

@@ -37,7 +37,7 @@ namespace Marechai.Areas.Identity.Pages.Account.Manage
_userManager.GetUserId(User));
// Only include personal data for download
Dictionary<string, string> personalData = new Dictionary<string, string>();
Dictionary<string, string> personalData = new();
IEnumerable<PropertyInfo> personalDataProps = typeof(ApplicationUser).GetProperties().
Where(prop => Attribute.IsDefined(prop, typeof(PersonalDataAttribute)));

View File

@@ -5,14 +5,14 @@
ViewData["ActivePage"] = ManageNavPages.Email;
}
<h4>@ViewData["Title"]</h4>
<partial name="_StatusMessage" model="Model.StatusMessage" />
<partial model="Model.StatusMessage" name="_StatusMessage" />
<div class="row">
<div class="col-md-6">
<form id="email-form" method="post">
<div asp-validation-summary="All" class="text-danger"></div>
<div class="form-group">
<label asp-for="Email"></label>
@if (Model.IsEmailConfirmed)
@if(Model.IsEmailConfirmed)
{
<div class="input-group">
<input asp-for="Email" class="form-control" disabled />
@@ -25,7 +25,7 @@
{
<input asp-for="Email" class="form-control" disabled />
<button asp-page-handler="SendVerificationEmail" class="btn btn-link" id="email-verification" type="submit">Send verification email</button>
}
}
</div>
<div class="form-group">
<label asp-for="Input.NewEmail"></label>

View File

@@ -4,7 +4,7 @@
ViewData["Title"] = "Configure authenticator app";
ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication;
}
<partial name="_StatusMessage" for="StatusMessage" />
<partial for="StatusMessage" name="_StatusMessage" />
<h4>@ViewData["Title"]</h4>
<div>
<p>To use an authenticator app go through the following steps:</p>
@@ -29,7 +29,7 @@
<a href="https://go.microsoft.com/fwlink/?Linkid=852423">enable QR code generation</a>.
</div>
<div id="qrCode"></div>
<div id="qrCodeData" data-url="@Html.Raw(Model.AuthenticatorUri)"></div>
<div data-url="@Html.Raw(Model.AuthenticatorUri)" id="qrCodeData"></div>
</li>
<li>
<p>
@@ -41,7 +41,7 @@
<form id="send-code" method="post">
<div class="form-group">
<label asp-for="Input.Code" class="control-label">Verification Code</label>
<input asp-for="Input.Code" class="form-control" autocomplete="off" />
<input asp-for="Input.Code" autocomplete="off" class="form-control" />
<span asp-validation-for="Input.Code" class="text-danger"></span>
</div>
<button class="btn btn-primary" type="submit">Verify</button>

View File

@@ -4,27 +4,27 @@
ViewData["Title"] = "Manage your external logins";
ViewData["ActivePage"] = ManageNavPages.ExternalLogins;
}
<partial name="_StatusMessage" for="StatusMessage" />
@if (Model.CurrentLogins?.Count > 0)
<partial for="StatusMessage" name="_StatusMessage" />
@if(Model.CurrentLogins?.Count > 0)
{
<h4>Registered Logins</h4>
<table class="table">
<tbody>
@foreach (var login in Model.CurrentLogins)
@foreach(var login in Model.CurrentLogins)
{
<tr>
<td id="@($"login-provider-{login.LoginProvider}")">@login.ProviderDisplayName</td>
<td>
@if (Model.ShowRemoveButton)
@if(Model.ShowRemoveButton)
{
<form id="@($"remove-login-{login.LoginProvider}")" asp-page-handler="RemoveLogin" method="post">
<form asp-page-handler="RemoveLogin" id="@($"remove-login-{login.LoginProvider}")" method="post">
<div>
<input asp-for="@login.LoginProvider" name="LoginProvider" type="hidden" />
<input asp-for="@login.ProviderKey" name="ProviderKey" type="hidden" />
<button type="submit" class="btn btn-primary" title="Remove this @login.ProviderDisplayName login from your account">Remove</button>
<button class="btn btn-primary" title="Remove this @login.ProviderDisplayName login from your account" type="submit">Remove</button>
</div>
</form>
}
}
else
{
@: &nbsp;
@@ -35,18 +35,17 @@
</tbody>
</table>
}
@if (Model.OtherLogins?.Count > 0)
@if(Model.OtherLogins?.Count > 0)
{
<h4>Add another service to log in.</h4>
<hr />
<form asp-page-handler="LinkLogin" class="form-horizontal" id="link-login-form" method="post">
<div id="socialLoginList">
<p>
@foreach (var provider in Model.OtherLogins)
@foreach(var provider in Model.OtherLogins)
{
<button id="@($"link-login-button-{provider.Name}")" type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button>
<button class="btn btn-primary" id="@($"link-login-button-{provider.Name}")" name="provider" title="Log in using your @provider.DisplayName account" type="submit" value="@provider.Name">@provider.DisplayName</button>
}
</p>
</div>
</form>
}
</form>}

View File

@@ -4,7 +4,7 @@
ViewData["Title"] = "Generate two-factor authentication (2FA) recovery codes";
ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication;
}
<partial name="_StatusMessage" for="StatusMessage" />
<partial for="StatusMessage" name="_StatusMessage" />
<h4>@ViewData["Title"]</h4>
<div class="alert alert-warning" role="alert">
<p>

View File

@@ -5,7 +5,7 @@
ViewData["ActivePage"] = ManageNavPages.Index;
}
<h4>@ViewData["Title"]</h4>
<partial name="_StatusMessage" model="Model.StatusMessage" />
<partial model="Model.StatusMessage" name="_StatusMessage" />
<div class="row">
<div class="col-md-6">
<form id="profile-form" method="post">

View File

@@ -4,7 +4,7 @@
ViewData["Title"] = "Reset authenticator key";
ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication;
}
<partial name="_StatusMessage" for="StatusMessage" />
<partial for="StatusMessage" name="_StatusMessage" />
<h4>@ViewData["Title"]</h4>
<div class="alert alert-warning" role="alert">
<p>

View File

@@ -5,7 +5,7 @@
ViewData["ActivePage"] = ManageNavPages.ChangePassword;
}
<h4>Set your password</h4>
<partial name="_StatusMessage" for="StatusMessage" />
<partial for="StatusMessage" name="_StatusMessage" />
<p class="text-info">
You do not have a local username/password for this site. Add a local
account so you can log in without an external login.

View File

@@ -4,7 +4,7 @@
ViewData["Title"] = "Recovery codes";
ViewData["ActivePage"] = "TwoFactorAuthentication";
}
<partial name="_StatusMessage" for="StatusMessage" />
<partial for="StatusMessage" name="_StatusMessage" />
<h4>@ViewData["Title"]</h4>
<div class="alert alert-warning" role="alert">
<p>
@@ -16,7 +16,7 @@
</div>
<div class="row">
<div class="col-md-12">
@for (var row = 0; row < Model.RecoveryCodes.Length; row += 2)
@for(var row = 0; row < Model.RecoveryCodes.Length; row += 2)
{
<code class="recovery-code">@Model.RecoveryCodes[row]</code>
<text>&nbsp;</text>

View File

@@ -4,11 +4,11 @@
ViewData["Title"] = "Two-factor authentication (2FA)";
ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication;
}
<partial name="_StatusMessage" for="StatusMessage" />
<partial for="StatusMessage" name="_StatusMessage" />
<h4>@ViewData["Title"]</h4>
@if (Model.Is2faEnabled)
@if(Model.Is2faEnabled)
{
if (Model.RecoveryCodesLeft == 0)
if(Model.RecoveryCodesLeft == 0)
{
<div class="alert alert-danger">
<strong>You have no recovery codes left.</strong>
@@ -18,7 +18,7 @@
</p>
</div>
}
else if (Model.RecoveryCodesLeft == 1)
else if(Model.RecoveryCodesLeft == 1)
{
<div class="alert alert-danger">
<strong>You have 1 recovery code left.</strong>
@@ -28,7 +28,7 @@
</p>
</div>
}
else if (Model.RecoveryCodesLeft <= 3)
else if(Model.RecoveryCodesLeft <= 3)
{
<div class="alert alert-warning">
<strong>You have @Model.RecoveryCodesLeft recovery codes left.</strong>
@@ -39,25 +39,22 @@
</div>
}
if (Model.IsMachineRemembered)
if(Model.IsMachineRemembered)
{
<form method="post" style="display: inline-block">
<button class="btn btn-default" type="submit">Forget this browser</button>
</form>
}
}
<a asp-page="./Disable2fa" class="btn btn-default">Disable 2FA</a>
<a asp-page="./GenerateRecoveryCodes" class="btn btn-default">Reset recovery codes</a>
}
<a asp-page="./GenerateRecoveryCodes" class="btn btn-default">Reset recovery codes</a>}
<h5>Authenticator app</h5>
@if (!Model.HasAuthenticator)
@if(!Model.HasAuthenticator)
{
<a asp-page="./EnableAuthenticator" class="btn btn-default" id="enable-authenticator">Add authenticator app</a>
}
<a asp-page="./EnableAuthenticator" class="btn btn-default" id="enable-authenticator">Add authenticator app</a>}
else
{
<a asp-page="./EnableAuthenticator" class="btn btn-default" id="enable-authenticator">Setup authenticator app</a>
<a asp-page="./ResetAuthenticator" class="btn btn-default" id="reset-authenticator">Reset authenticator app</a>
}
<a asp-page="./ResetAuthenticator" class="btn btn-default" id="reset-authenticator">Reset authenticator app</a>}
@section Scripts {
<partial name="_ValidationScriptsPartial" />

View File

@@ -1,5 +1,5 @@
@{
if (ViewData.TryGetValue("ParentLayout", out var parentLayout))
if(ViewData.TryGetValue("ParentLayout", out var parentLayout))
{
Layout = (string)parentLayout;
}

View File

@@ -5,24 +5,24 @@
}
<ul class="flex-column nav nav-pills">
<li class="nav-item">
<a class="nav-link @ManageNavPages.IndexNavClass(ViewContext)" id="profile" asp-page="./Index">Profile</a>
<a asp-page="./Index" class="nav-link @ManageNavPages.IndexNavClass(ViewContext)" id="profile">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link @ManageNavPages.EmailNavClass(ViewContext)" id="email" asp-page="./Email">Email</a>
<a asp-page="./Email" class="nav-link @ManageNavPages.EmailNavClass(ViewContext)" id="email">Email</a>
</li>
<li class="nav-item">
<a class="nav-link @ManageNavPages.ChangePasswordNavClass(ViewContext)" id="change-password" asp-page="./ChangePassword">Password</a>
<a asp-page="./ChangePassword" class="nav-link @ManageNavPages.ChangePasswordNavClass(ViewContext)" id="change-password">Password</a>
</li>
@if (hasExternalLogins)
@if(hasExternalLogins)
{
<li class="nav-item" id="external-logins">
<a id="external-login" class="nav-link @ManageNavPages.ExternalLoginsNavClass(ViewContext)" asp-page="./ExternalLogins">External logins</a>
<a asp-page="./ExternalLogins" class="nav-link @ManageNavPages.ExternalLoginsNavClass(ViewContext)" id="external-login">External logins</a>
</li>
}
<li class="nav-item">
<a class="nav-link @ManageNavPages.TwoFactorAuthenticationNavClass(ViewContext)" id="two-factor" asp-page="./TwoFactorAuthentication">Two-factor authentication</a>
<a asp-page="./TwoFactorAuthentication" class="nav-link @ManageNavPages.TwoFactorAuthenticationNavClass(ViewContext)" id="two-factor">Two-factor authentication</a>
</li>
<li class="nav-item">
<a class="nav-link @ManageNavPages.PersonalDataNavClass(ViewContext)" id="personal-data" asp-page="./PersonalData">Personal data</a>
<a asp-page="./PersonalData" class="nav-link @ManageNavPages.PersonalDataNavClass(ViewContext)" id="personal-data">Personal data</a>
</li>
</ul>

View File

@@ -1,6 +1,6 @@
@model string
@if (!string.IsNullOrEmpty(Model))
@if(!string.IsNullOrEmpty(Model))
{
var statusMessageClass = Model.StartsWith("Error") ? "danger" : "success";
<div class="alert alert-@statusMessageClass alert-dismissible" role="alert">

View File

@@ -33,7 +33,7 @@
<h4>Use another service to register.</h4>
<hr />
@{
if ((Model.ExternalLogins?.Count ?? 0) == 0)
if((Model.ExternalLogins?.Count ?? 0) == 0)
{
<div>
<p>
@@ -45,17 +45,17 @@
}
else
{
<form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="form-horizontal">
<form asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" class="form-horizontal" id="external-account" method="post">
<div>
<p>
@foreach (var provider in Model.ExternalLogins)
@foreach(var provider in Model.ExternalLogins)
{
<button type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button>
<button class="btn btn-primary" name="provider" title="Log in using your @provider.DisplayName account" type="submit" value="@provider.Name">@provider.DisplayName</button>
}
</p>
</div>
</form>
}
}
}
</section>
</div>

View File

@@ -5,13 +5,13 @@
}
<h1>@ViewData["Title"]</h1>
@{
if (Model.DisplayConfirmAccountLink)
if(Model.DisplayConfirmAccountLink)
{
<p>
This app does not currently have a real email sender registered, see
<a href="https://aka.ms/aspaccountconf">these docs</a> for how to configure a real email sender.
Normally this would be emailed:
<a id="confirm-link" href="@Model.EmailConfirmationUrl">Click here to confirm your account</a>
<a href="@Model.EmailConfirmationUrl" id="confirm-link">Click here to confirm your account</a>
</p>
}
else

View File

@@ -1,6 +1,6 @@
@model string
@if (!string.IsNullOrEmpty(Model))
@if(!string.IsNullOrEmpty(Model))
{
var statusMessageClass = Model.StartsWith("Error") ? "danger" : "success";
<div class="alert alert-@statusMessageClass alert-dismissible" role="alert">

View File

@@ -5,7 +5,7 @@
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
@if(Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong>

View File

@@ -3,7 +3,7 @@
@inject UserManager<ApplicationUser> UserManager
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
<ul class="navbar-nav">
@if (SignInManager.IsSignedIn(User))
@if(SignInManager.IsSignedIn(User))
{
<li class="nav-item">
<a asp-area="Identity" asp-page="/Account/Manage/Index" class="nav-link text-dark" title="Manage">Hello @User.Identity.Name!</a>

View File

@@ -38,7 +38,7 @@ namespace Marechai.Helpers
public static void EnsureCreated(string webRootPath, bool scan, string item)
{
List<string> paths = new List<string>();
List<string> paths = new();
string photosRoot = Path.Combine(webRootPath, "assets", scan ? "scan" : "photos");
string itemPhotosRoot = Path.Combine(photosRoot, item);
@@ -271,87 +271,82 @@ namespace Marechai.Helpers
public void ConversionWorker(string webRootPath, Guid id, string originalFilePath, string sourceFormat,
bool scan, string item)
{
List<Task> pool = new List<Task>
List<Task> pool = new()
{
new Task(() => FinishedRenderingJpeg4kThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "JPEG", "4k", true,
scan, item))),
new Task(() => FinishedRenderingJpeg1440Thumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "JPEG", "1440p", true,
scan, item))),
new Task(() => FinishedRenderingJpegHdThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "JPEG", "hd", true,
scan, item))),
new Task(() => FinishedRenderingJpeg4k?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
new(() => FinishedRenderingJpeg4kThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "JPEG", "4k", true, scan,
item))),
new(() => FinishedRenderingJpeg1440Thumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "JPEG", "1440p", true, scan,
item))),
new(() => FinishedRenderingJpegHdThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "JPEG", "hd", true, scan,
item))),
new(() => FinishedRenderingJpeg4k?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"JPEG", "4k", false, scan, item))),
new Task(() => FinishedRenderingJpeg1440?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "JPEG", "1440p", false, scan,
item))),
new Task(() => FinishedRenderingJpegHd?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
new(() => FinishedRenderingJpeg1440?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"JPEG", "1440p", false, scan, item))),
new(() => FinishedRenderingJpegHd?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"JPEG", "hd", false, scan, item))),
new Task(() => FinishedRenderingJp2k4kThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "JP2K", "4k", true,
scan, item))),
new Task(() => FinishedRenderingJp2k1440Thumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "JP2K", "1440p", true,
scan, item))),
new Task(() => FinishedRenderingJp2kHdThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "JP2K", "hd", true,
scan, item))),
new Task(() => FinishedRenderingJp2k4k?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
new(() => FinishedRenderingJp2k4kThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "JP2K", "4k", true, scan,
item))),
new(() => FinishedRenderingJp2k1440Thumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "JP2K", "1440p", true, scan,
item))),
new(() => FinishedRenderingJp2kHdThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "JP2K", "hd", true, scan,
item))),
new(() => FinishedRenderingJp2k4k?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"JP2K", "4k", false, scan, item))),
new Task(() => FinishedRenderingJp2k1440?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "JP2K", "1440p", false, scan,
item))),
new Task(() => FinishedRenderingJp2kHd?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
new(() => FinishedRenderingJp2k1440?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"JP2K", "1440p", false, scan, item))),
new(() => FinishedRenderingJp2kHd?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"JP2K", "hd", false, scan, item))),
new Task(() => FinishedRenderingWebp4kThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "WEBP", "4k", true,
scan, item))),
new Task(() => FinishedRenderingWebp1440Thumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "WEBP", "1440p", true,
scan, item))),
new Task(() => FinishedRenderingWebpHdThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "WEBP", "hd", true,
scan, item))),
new Task(() => FinishedRenderingWebp4k?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
new(() => FinishedRenderingWebp4kThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "WEBP", "4k", true, scan,
item))),
new(() => FinishedRenderingWebp1440Thumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "WEBP", "1440p", true, scan,
item))),
new(() => FinishedRenderingWebpHdThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "WEBP", "hd", true, scan,
item))),
new(() => FinishedRenderingWebp4k?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"WEBP", "4k", false, scan, item))),
new Task(() => FinishedRenderingWebp1440?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "WEBP", "1440p", false, scan,
item))),
new Task(() => FinishedRenderingWebpHd?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
new(() => FinishedRenderingWebp1440?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"WEBP", "1440p", false, scan, item))),
new(() => FinishedRenderingWebpHd?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"WEBP", "hd", false, scan, item))),
new Task(() => FinishedRenderingHeif4kThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "HEIF", "4k", true,
scan, item))),
new Task(() => FinishedRenderingHeif1440Thumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "HEIF", "1440p", true,
scan, item))),
new Task(() => FinishedRenderingHeifHdThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "HEIF", "hd", true,
scan, item))),
new Task(() => FinishedRenderingHeif4k?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
new(() => FinishedRenderingHeif4kThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "HEIF", "4k", true, scan,
item))),
new(() => FinishedRenderingHeif1440Thumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "HEIF", "1440p", true, scan,
item))),
new(() => FinishedRenderingHeifHdThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "HEIF", "hd", true, scan,
item))),
new(() => FinishedRenderingHeif4k?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"HEIF", "4k", false, scan, item))),
new Task(() => FinishedRenderingHeif1440?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "HEIF", "1440p", false, scan,
item))),
new Task(() => FinishedRenderingHeifHd?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
new(() => FinishedRenderingHeif1440?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"HEIF", "1440p", false, scan, item))),
new(() => FinishedRenderingHeifHd?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"HEIF", "hd", false, scan, item))),
new Task(() => FinishedRenderingAvif4kThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "AVIF", "4k", true,
scan, item))),
new Task(() => FinishedRenderingAvif1440Thumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "AVIF", "1440p", true,
scan, item))),
new Task(() => FinishedRenderingAvifHdThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "AVIF", "hd", true,
scan, item))),
new Task(() => FinishedRenderingAvif4k?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"AVIF", "4k", false, scan, item))),
new Task(() => FinishedRenderingAvif1440?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "AVIF", "1440p", false, scan,
new(() => FinishedRenderingAvif4kThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "AVIF", "4k", true, scan,
item))),
new Task(() => FinishedRenderingAvifHd?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
new(() => FinishedRenderingAvif1440Thumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "AVIF", "1440p", true, scan,
item))),
new(() => FinishedRenderingAvifHdThumbnail?.Invoke(Convert(webRootPath, id, originalFilePath,
sourceFormat, "AVIF", "hd", true, scan,
item))),
new(() => FinishedRenderingAvif4k?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"AVIF", "4k", false, scan, item))),
new(() => FinishedRenderingAvif1440?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"AVIF", "1440p", false, scan, item))),
new(() => FinishedRenderingAvifHd?.Invoke(Convert(webRootPath, id, originalFilePath, sourceFormat,
"AVIF", "hd", false, scan, item)))
};

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<BooksService>
@inject IStringLocalizer<BooksService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Books"]</h3>
@if (_books is null)
@if(_books is null)
{
<p>@L["Loading..."]</p>
@@ -64,7 +64,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _books)
@foreach(var item in _books)
{
<tr>
<td>
@@ -85,26 +85,25 @@
<td>
<a class="btn btn-primary" href="/admin/books/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/books/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete book"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete the book {0}?"], _currentBook?.Title)</Text>
<Text>@string.Format(L["Are you sure you want to delete the book {0}?"], _currentBook?.Title)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -30,7 +30,7 @@
@inject IStringLocalizer<BrowserTestsService> L
@attribute [Authorize(Roles = "UberAdmin")]
<h3>@L["Browser tests"]</h3>
@if (_tests is null)
@if(_tests is null)
{
<p>@L["Loading..."]</p>
@@ -90,7 +90,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _tests)
@foreach(var item in _tests)
{
<tr>
<td>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<CompaniesService>
@inject IStringLocalizer<CompaniesService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Companies"]</h3>
@if (_companies is null)
@if(_companies is null)
{
<p>@L["Loading..."]</p>
@@ -67,7 +67,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _companies)
@foreach(var item in _companies)
{
<tr>
<td>
@@ -91,26 +91,25 @@
<td>
<a class="btn btn-primary" href="/admin/companies/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/companies/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete company"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete the company {0}?"], _currentCompany?.Name)</Text>
<Text>@string.Format(L["Are you sure you want to delete the company {0}?"], _currentCompany?.Name)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<CurrencyInflationService>
@inject IStringLocalizer<CurrencyInflationService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Currency inflation"]</h3>
@if (_inflations is null)
@if(_inflations is null)
{
<p>@L["Loading..."]</p>
@@ -58,7 +58,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _inflations)
@foreach(var item in _inflations)
{
<tr>
<td>
@@ -73,26 +73,25 @@
<td>
<a class="btn btn-primary" href="/admin/currency_inflation/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/currency_inflation/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete currency inflation"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete the inflation of {0:F} happened to currency {1} on {2}?"], _currentInflation?.Inflation, _currentInflation?.CurrencyName, _currentInflation?.Year)</Text>
<Text>@string.Format(L["Are you sure you want to delete the inflation of {0:F} happened to currency {1} on {2}?"], _currentInflation?.Inflation, _currentInflation?.CurrencyName, _currentInflation?.Year)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<CurrencyPeggingService>
@inject IStringLocalizer<CurrencyPeggingService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Currency pegging"]</h3>
@if (_peggings is null)
@if(_peggings is null)
{
<p>@L["Loading..."]</p>
@@ -64,7 +64,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _peggings)
@foreach(var item in _peggings)
{
<tr>
<td>
@@ -85,26 +85,25 @@
<td>
<a class="btn btn-primary" href="/admin/currency_pegging/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/currency_pegging/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete currency pegging"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete the pegging of {0:F} happened to currency {1} with currency {2} since {3}?"], _currentPegging?.Ratio, _currentPegging?.SourceName, _currentPegging?.DestinationName, _currentPegging?.Start.ToLongDateString())</Text>
<Text>@string.Format(L["Are you sure you want to delete the pegging of {0:F} happened to currency {1} with currency {2} since {3}?"], _currentPegging?.Ratio, _currentPegging?.SourceName, _currentPegging?.DestinationName, _currentPegging?.Start.ToLongDateString())</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

File diff suppressed because it is too large Load Diff

View File

@@ -309,7 +309,7 @@ namespace Marechai.Pages.Admin.Details
newIsbn[1] = '7';
newIsbn[2] = '8';
int sum = (newIsbn[0] - 0x30) + ((newIsbn[1] - 0x30) * 3) + (newIsbn[2] - 0x30) +
int sum = newIsbn[0] - 0x30 + ((newIsbn[1] - 0x30) * 3) + (newIsbn[2] - 0x30) +
((newIsbn[3] - 0x30) * 3) + (newIsbn[4] - 0x30) + ((newIsbn[5] - 0x30) * 3) +
(newIsbn[6] - 0x30) + ((newIsbn[7] - 0x30) * 3) + (newIsbn[8] - 0x30) +
((newIsbn[9] - 0x30) * 3) + (newIsbn[10] - 0x30) + ((newIsbn[11] - 0x30) * 3);
@@ -869,7 +869,7 @@ namespace Marechai.Pages.Admin.Details
{
await outFs.WriteAsync(buffer, 0, count);
double progress = ((double)fs.Position * 100) / fs.Length;
double progress = (double)fs.Position * 100 / fs.Length;
if(!(progress > lastProgress + 0.01))
continue;
@@ -1465,4 +1465,6 @@ namespace Marechai.Pages.Admin.Details
StateHasChanged();
}
}
class BookImpl : Book {}
}

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -28,8 +28,8 @@
@page "/admin/companies/details/{Id:int}"
@page "/admin/companies/edit/{Id:int}"
@page "/admin/companies/create"
@using Marechai.Database
@using Marechai.Database.Models
@using Marechai.Database
@inherits OwningComponentBase<CompaniesService>
@inject IStringLocalizer<CompaniesService> L
@inject Iso31661NumericService CountriesService
@@ -38,317 +38,272 @@
@inject IWebHostEnvironment Host
@inject IFileReaderService FileReaderService;
@inject IJSRuntime JSRuntime
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Company details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<Field>
<FieldLabel>@L["Common name (as usually displayed publicly)"]</FieldLabel>
<Validation Validator="@ValidateName">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Name">
<TextEdit @bind-Text="@_model.Name" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid name."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
</Field>
@if (_editing || _model.LegalName != null)
{
</Field>
@if(_editing || _model.LegalName != null)
{
<Field>
<FieldLabel>@L["Legal name (as shown in governmental registries including \"Inc.\", \"Corp.\", \"gmbH\", etc...)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownLegalName">@L["Unknown (legal name)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownLegalName" @TValue="bool">@L["Unknown (legal name)"]</Check> }
@if(!_editing ||
!_unknownLegalName)
{
<Validation Validator="@ValidateLegalName">
<TextEdit Disabled="!_editing" @bind-Text="@_model.LegalName">
<TextEdit @bind-Text="@_model.LegalName" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid legal name."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
<Field>
</Validation> }
</Field>}
<Field>
<FieldLabel>@L["Status"]</FieldLabel>
<Select Disabled="!_editing" TValue="int" @bind-SelectedValue="@Status">
@foreach (int status in Enum.GetValues(typeof(CompanyStatus)))
<Select @bind-SelectedValue="@Status" Disabled="!_editing" @TValue="int">
@foreach(int status in Enum.GetValues(typeof(CompanyStatus)))
{
<SelectItem TValue="int" Value="@status">@(((CompanyStatus)status).ToString())</SelectItem>
}
<SelectItem @TValue="int" Value="@status">@(((CompanyStatus)status).ToString())</SelectItem> }
</Select>
</Field>
@if (_editing || _model.Founded != null)
{
</Field>
@if(_editing || _model.Founded != null)
{
<Field>
<FieldLabel>@L["Founded"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownFounded">@L["Unknown (foundation date)"]</Check>
}
@if (!_editing || !_unknownFounded)
<Check @bind-Checked="@_unknownFounded" @TValue="bool">@L["Unknown (foundation date)"]</Check> }
@if(!_editing ||
!_unknownFounded)
{
<Check TValue="bool" @bind-Checked="@_model.FoundedMonthIsUnknown" Disabled="!_editing">@L["Unknown foundation month"]</Check>
<Check TValue="bool" @bind-Checked="@_model.FoundedDayIsUnknown" Disabled="_model.FoundedMonthIsUnknown || !_editing">@L["Unknown foundation day"]</Check>
<Check @bind-Checked="@_model.FoundedMonthIsUnknown" Disabled="!_editing" @TValue="bool">@L["Unknown foundation month"]</Check>
<Check @bind-Checked="@_model.FoundedDayIsUnknown" Disabled="_model.FoundedMonthIsUnknown || !_editing" @TValue="bool">@L["Unknown foundation day"]</Check>
@L["If the foundation day or month are selected as unknown, pick anyone in the field below, it will be ignored."]
<Validation Validator="@ValidateFounded">
<DateEdit TValue="DateTime?" ReadOnly="!_editing" @bind-Date="@_model.Founded" >
<DateEdit @bind-Date="@_model.Founded" ReadOnly="!_editing" @TValue="DateTime?">
<Feedback>
<ValidationError>@L["Please enter a valid foundation date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.Website != null)
{
</Validation> }
</Field>}
@if(_editing || _model.Website != null)
{
<Field>
<FieldLabel>@L["Website"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownWebsite">@L["Unknown (website)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownWebsite" @TValue="bool">@L["Unknown (website)"]</Check> }
@if(!_editing ||
!_unknownWebsite)
{
<Validation Validator="@ValidateWebsite">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Website">
<TextEdit @bind-Text="@_model.Website" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid website."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.Twitter != null)
{
</Validation> }
</Field>}
@if(_editing || _model.Twitter != null)
{
<Field>
<FieldLabel>@L["Twitter"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownTwitter">@L["Unknown (twitter)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownTwitter" @TValue="bool">@L["Unknown (twitter)"]</Check> }
@if(!_editing ||
!_unknownTwitter)
{
<Validation Validator="@ValidateTwitter">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Twitter">
<TextEdit @bind-Text="@_model.Twitter" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid Twitter handle."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.Facebook != null)
{
</Validation> }
</Field>}
@if(_editing || _model.Facebook != null)
{
<Field>
<FieldLabel>@L["Facebook"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownFacebook">@L["Unknown (facebook)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownFacebook" @TValue="bool">@L["Unknown (facebook)"]</Check> }
@if(!_editing ||
!_unknownFacebook)
{
<Validation Validator="@ValidateFacebook">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Facebook">
<TextEdit @bind-Text="@_model.Facebook" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid Facebook user name."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.Address != null)
{
</Validation> }
</Field>}
@if(_editing || _model.Address != null)
{
<Field>
<FieldLabel>@L["Address"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownAddress">@L["Unknown (address)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownAddress" @TValue="bool">@L["Unknown (address)"]</Check> }
@if(!_editing ||
!_unknownAddress)
{
<Validation Validator="@ValidateAddress">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Address">
<TextEdit @bind-Text="@_model.Address" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid address."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.City != null)
{
</Validation> }
</Field>}
@if(_editing || _model.City != null)
{
<Field>
<FieldLabel>@L["City"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownCity">@L["Unknown (city)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownCity" @TValue="bool">@L["Unknown (city)"]</Check> }
@if(!_editing ||
!_unknownCity)
{
<Validation Validator="@ValidateCity">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.City">
<TextEdit @bind-Text="@_model.City" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid city."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.Province != null)
{
</Validation> }
</Field>}
@if(_editing || _model.Province != null)
{
<Field>
<FieldLabel>@L["Province"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownProvince">@L["Unknown (province)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownProvince" @TValue="bool">@L["Unknown (province)"]</Check> }
@if(!_editing ||
!_unknownProvince)
{
<Validation Validator="@ValidateProvince">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Province">
<TextEdit @bind-Text="@_model.Province" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid province."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.PostalCode != null)
{
</Validation> }
</Field>}
@if(_editing || _model.PostalCode != null)
{
<Field>
<FieldLabel>@L["Postal code"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownPostalCode">@L["Unknown (postal code)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownPostalCode" @TValue="bool">@L["Unknown (postal code)"]</Check> }
@if(!_editing ||
!_unknownPostalCode)
{
<Validation Validator="@ValidatePostalCode">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.PostalCode">
<TextEdit @bind-Text="@_model.PostalCode" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid postal code."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.CountryId != null)
{
</Validation> }
</Field>}
@if(_editing || _model.CountryId != null)
{
<Field>
<FieldLabel>@L["Country"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownCountry">@L["Unknown (country)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownCountry" @TValue="bool">@L["Unknown (country)"]</Check> }
@if(!_editing ||
!_unknownCountry)
{
<Select Disabled="!_editing" TValue="short?" @bind-SelectedValue="@_model.CountryId">
@foreach (var country in _countries)
<Select @bind-SelectedValue="@_model.CountryId" Disabled="!_editing" @TValue="short?">
@foreach(var country in _countries)
{
<SelectItem TValue="short?" Value="@country.Id">@country.Name</SelectItem>
}
</Select>
}
</Field>
}
@if (((int)_model.Status) > 1)
{
@if (_editing || _model.Sold != null)
<SelectItem @TValue="short?" Value="@country.Id">@country.Name</SelectItem> }
</Select> }
</Field>}
@if((int)_model.Status > 1)
{
@if(_editing || _model.Sold != null)
{
<Field>
<FieldLabel>@L["Sold"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownSold">@L["Unknown (sold/merged/bankrupt date)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownSold" @TValue="bool">@L["Unknown (sold/merged/bankrupt date)"]</Check> }
@if(!_editing ||
!_unknownSold)
{
<Check TValue="bool" @bind-Checked="@_model.SoldMonthIsUnknown" Disabled="!_editing">@L["Unknown sold/merge/bankruptcy month"]</Check>
<Check TValue="bool" @bind-Checked="@_model.SoldDayIsUnknown" Disabled="_model.SoldMonthIsUnknown || !_editing">@L["Unknown sold/merge/bankruptcy day"]</Check>
<Check @bind-Checked="@_model.SoldMonthIsUnknown" Disabled="!_editing" @TValue="bool">@L["Unknown sold/merge/bankruptcy month"]</Check>
<Check @bind-Checked="@_model.SoldDayIsUnknown" Disabled="_model.SoldMonthIsUnknown || !_editing" @TValue="bool">@L["Unknown sold/merge/bankruptcy day"]</Check>
@L["If the sold, merge or bankruptcy day or month are selected as unknown, pick anyone in the field below, it will be ignored."]
<Validation Validator="@ValidateSold">
<DateEdit TValue="DateTime?" ReadOnly="!_editing" @bind-Date="@_model.Sold">
<DateEdit @bind-Date="@_model.Sold" ReadOnly="!_editing" @TValue="DateTime?">
<Feedback>
<ValidationError>@L["Please enter a valid sold/merge/bankruptcy date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.SoldToId != null)
</Validation> }
</Field> }
@if(_editing || _model.SoldToId != null)
{
<Field>
<FieldLabel>@L["Sold to"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownSoldTo">@L["Unknown (sold to)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownSoldTo" @TValue="bool">@L["Unknown (sold to)"]</Check> }
@if(!_editing ||
!_unknownSoldTo)
{
<Select Disabled="!_editing" TValue="int?" @bind-SelectedValue="@_model.SoldToId">
@foreach (var company in _companies)
<Select @bind-SelectedValue="@_model.SoldToId" Disabled="!_editing" @TValue="int?">
@foreach(var company in _companies)
{
<SelectItem TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
</Select>
}
</Field>
}
}
</div>
<div>
@if (!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/companies" class="btn btn-secondary">@L["Back to list"]</a>
@if (!_editing)
{
<Button Color="Color.Success" Clicked="@ShowUploadModal">@L["Upload new logo"]</Button>
<SelectItem @TValue="int?" Value="@company.Id">@company.Name</SelectItem> }
</Select> }
</Field> }
}
</div>
@if (_logos.Count > 0)
<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/companies">@L["Back to list"]</a>
@if(!_editing)
{
<Button Clicked="@ShowUploadModal" Color="Color.Success">@L["Upload new logo"]</Button> }
</div>
@if(_logos.Count > 0)
{
<h4>@L["Logos"]</h4>
<table class="table table-striped">
@@ -364,18 +319,17 @@
</tr>
</thead>
<tbody>
@foreach (var logo in _logos)
@foreach(var logo in _logos)
{
bool logoFound = File.Exists(Path.Combine(Host.WebRootPath, "assets/logos", logo.Guid + ".svg"));
var logoFound = File.Exists(Path.Combine(Host.WebRootPath, "assets/logos", logo.Guid + ".svg"));
<tr>
<td>
@if (logoFound)
@if(logoFound)
{
<picture>
<source type="image/svg+xml" srcset="/assets/logos/@(logo.Guid).svg">
<source type="image/webp" srcset="/assets/logos/webp/1x/@(logo.Guid).webp, /assets/logos/webp/2x/@(logo.Guid).webp 2x, /assets/logos/webp/3x/@(logo.Guid).webp 3x">
<img srcset="/assets/logos/png/1x/@(logo.Guid).png, /assets/logos/png/2x/@(logo.Guid).png 2x, /assets/logos/png/3x/@(logo.Guid).png 3x"
src="/assets/logos/png/1x/@(logo.Guid).png" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<source srcset="/assets/logos/@(logo.Guid).svg" type="image/svg+xml">
<source srcset="/assets/logos/webp/1x/@(logo.Guid).webp, /assets/logos/webp/2x/@(logo.Guid).webp 2x, /assets/logos/webp/3x/@(logo.Guid).webp 3x" type="image/webp">
<img alt="" height="auto" src="/assets/logos/png/1x/@(logo.Guid).png" srcset="/assets/logos/png/1x/@(logo.Guid).png, /assets/logos/png/2x/@(logo.Guid).png 2x, /assets/logos/png/3x/@(logo.Guid).png 3x" style="max-height: 256px; max-width: 256px" width="auto" />
</picture>
}
else
@@ -384,7 +338,7 @@
}
</td>
<td>
@if (logo.Year.HasValue)
@if(logo.Year.HasValue)
{
@logo.Year
}
@@ -394,110 +348,101 @@
}
</td>
<td>
@if (logoFound)
@if(logoFound)
{
<Button Color="Color.Success" Clicked="() => {ShowLogoYearModal(logo.Id);}">@L["Change year"]</Button>
}
<Button Color="Color.Danger" Clicked="() => {ShowDeleteModal(logo.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowLogoYearModal(logo.Id);}" Color="Color.Success">@L["Change year"]</Button> }
<Button Clicked="() => {ShowDeleteModal(logo.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
}
<Modal @ref="_frmDelete" IsCentered="true" Closing="@DeleteModalClosing">
<ModalBackdrop/>
</table>}
<Modal Closing="@DeleteModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete logo"]</ModalTitle>
<CloseButton Clicked="@HideDeleteModal"/>
<CloseButton Clicked="@HideDeleteModal" />
</ModalHeader>
<ModalBody>
@if (_currentLogo?.Year != null)
@if(_currentLogo?.Year != null)
{
<Text>@string.Format(L["Are you sure you want to delete the company logo introduced in {0}?"], _currentLogo?.Year)</Text>
}
<Text>@string.Format(L["Are you sure you want to delete the company logo introduced in {0}?"], _currentLogo?.Year)</Text> }
else
{
<Text>@L["Are you sure you want to delete the company logo you selected?"]</Text>
}
<Text>@L["Are you sure you want to delete the company logo you selected?"]</Text> }
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideDeleteModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideDeleteModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>
<Modal @ref="_frmLogoYear" IsCentered="true" Closing="@LogoYearModalClosing">
<ModalBackdrop/>
<Modal Closing="@LogoYearModalClosing" IsCentered="true" ref="_frmLogoYear">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Change logo year"]</ModalTitle>
<CloseButton Clicked="@HideLogoYearModal"/>
<CloseButton Clicked="@HideLogoYearModal" />
</ModalHeader>
<ModalBody>
@if (_currentLogo != null)
@if(_currentLogo != null)
{
<div class="text-center">
<picture>
<source type="image/svg+xml" srcset="/assets/logos/@(_currentLogo.Guid).svg">
<source type="image/webp" srcset="/assets/logos/webp/1x/@(_currentLogo.Guid).webp, /assets/logos/webp/2x/@(_currentLogo.Guid).webp 2x, /assets/logos/webp/3x/@(_currentLogo.Guid).webp 3x">
<img srcset="/assets/logos/png/1x/@(_currentLogo.Guid).png, /assets/logos/png/2x/@(_currentLogo.Guid).png 2x, /assets/logos/png/3x/@(_currentLogo.Guid).png 3x" src="/assets/logos/png/1x/@(_currentLogo.Guid).png" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<source srcset="/assets/logos/@(_currentLogo.Guid).svg" type="image/svg+xml">
<source srcset="/assets/logos/webp/1x/@(_currentLogo.Guid).webp, /assets/logos/webp/2x/@(_currentLogo.Guid).webp 2x, /assets/logos/webp/3x/@(_currentLogo.Guid).webp 3x" type="image/webp">
<img alt="" height="auto" src="/assets/logos/png/1x/@(_currentLogo.Guid).png" srcset="/assets/logos/png/1x/@(_currentLogo.Guid).png, /assets/logos/png/2x/@(_currentLogo.Guid).png 2x, /assets/logos/png/3x/@(_currentLogo.Guid).png 3x" style="max-height: 256px; max-width: 256px" width="auto" />
</picture>
</div>
<Field>
<FieldLabel>@L["Year logo came in use"]</FieldLabel>
<Check TValue="bool" @bind-Checked="@_unknownLogoYear">@L["Unknown (logo year)"]</Check>
@if (!_unknownLogoYear)
<Check @bind-Checked="@_unknownLogoYear" @TValue="bool">@L["Unknown (logo year)"]</Check>
@if(!_unknownLogoYear)
{
<Validation Validator="@ValidateLogoYear">
<NumericEdit TValue="int?" Decimals="0" @bind-Value="@_currentLogoYear">
<NumericEdit @bind-Value="@_currentLogoYear" Decimals="0" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid year."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
</Validation> }
</Field> }
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideLogoYearModal" Disabled="@_yearChangeInProgress">@L["Cancel"]</Button>
@if (_currentLogo != null)
<Button Clicked="@HideLogoYearModal" Color="Color.Primary" Disabled="@_yearChangeInProgress">@L["Cancel"]</Button>
@if(_currentLogo != null)
{
<Button Color="Color.Success" Clicked="@ConfirmLogoYear" Disabled="@_yearChangeInProgress">@L["Save"]</Button>
}
<Button Clicked="@ConfirmLogoYear" Color="Color.Success" Disabled="@_yearChangeInProgress">@L["Save"]</Button> }
</ModalFooter>
</ModalContent>
</Modal>
<Modal @ref="_frmUpload" IsCentered="true" Closing="@UploadModalClosing">
<ModalBackdrop/>
<Modal Closing="@UploadModalClosing" IsCentered="true" ref="_frmUpload">
<ModalBackdrop />
<ModalContent Centered="true" Size="ModalSize.ExtraLarge">
<ModalHeader>
<ModalTitle>@L["Upload new logo"]</ModalTitle>
<CloseButton Clicked="@HideUploadModal"/>
<CloseButton Clicked="@HideUploadModal" />
</ModalHeader>
<ModalBody>
<Field>
@if (!_uploaded)
@if(!_uploaded)
{
@if (!_uploading)
@if(!_uploading)
{
<FieldLabel>@L["Choose SVG (version 1.1 or lower) logo file"]</FieldLabel>
<input type="file" @ref=_inputUpload Accept=".svg" /><br/>
<Button Color="Color.Success" Clicked="@UploadFile" Disabled="@_uploading">@L["Upload"]</Button><br/>
<input Accept=".svg" @ref=_inputUpload type="file" />
<br />
<Button Clicked="@UploadFile" Color="Color.Success" Disabled="@_uploading">@L["Upload"]</Button> <br />
}
else
{
@L["Uploading..."]
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: @(_progressValue)%;" aria-valuenow="@_progressValue" aria-valuemin="0" aria-valuemax="100">@($"{_progressValue:F2}")%</div>
<div aria-valuemax="100" aria-valuemin="0" aria-valuenow="@_progressValue" class="progress-bar" role="progressbar" style="width: @(_progressValue)%;">@($"{_progressValue:F2}")%</div>
</div>
}
@if (_uploadError)
@if(_uploadError)
{
<span class="text-danger">@_uploadErrorMessage</span>
}
@@ -524,61 +469,55 @@
</tr>
<tr>
<td>
<img src="@_uploadedSvgData" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@_uploadedSvgData" style="max-height: 256px; max-width: 256px" width="auto" />
</td>
<td>
<img src="@_uploadedPngData" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@_uploadedPngData" style="max-height: 256px; max-width: 256px" width="auto" />
</td>
<td>
<img src="@_uploadedWebpData" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@_uploadedWebpData" style="max-height: 256px; max-width: 256px" width="auto" />
</td>
</tr>
</tbody>
</table>
<Field>
<FieldLabel>@L["Year logo came in use"]</FieldLabel>
<Check TValue="bool" @bind-Checked="@_unknownLogoYear">@L["Unknown (logo year)"]</Check>
@if (!_unknownLogoYear)
<Check @bind-Checked="@_unknownLogoYear" @TValue="bool">@L["Unknown (logo year)"]</Check>
@if(!_unknownLogoYear)
{
<Validation Validator="@ValidateLogoYear">
<NumericEdit TValue="int?" Decimals="0" @bind-Value="@_currentLogoYear">
<NumericEdit @bind-Value="@_currentLogoYear" Decimals="0" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid year."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
</Validation> }
</Field> }
</Field>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideUploadModal" Disabled="_uploading || _savingLogo">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@ConfirmUpload" Disabled="!_uploaded || _savingLogo">@L["Save"]</Button>
<Button Clicked="@HideUploadModal" Color="Color.Primary" Disabled="_uploading || _savingLogo">@L["Cancel"]</Button>
<Button Clicked="@ConfirmUpload" Color="Color.Success" Disabled="!_uploaded || _savingLogo">@L["Save"]</Button>
</ModalFooter>
</ModalContent>
</Modal>
<hr/>
<hr />
<div class="container">
<h4>@L["Company description"]</h4>
<hr/>
@if (_readonlyDescription &&
_description is null)
<hr />
@if(_readonlyDescription && _description is null)
{
<Button Color="Color.Success" Clicked="@AddNewDescription">@L["Add new description"]</Button>
}
@if (!_readonlyDescription || _description != null)
<Button Clicked="@AddNewDescription" Color="Color.Success">@L["Add new description"]</Button> }
@if(!_readonlyDescription ||
_description != null)
{
if (_readonlyDescription)
if(_readonlyDescription)
{
<Button Color="Color.Success" Clicked="@EditDescription">@L["Edit"]</Button>
}
<Button Clicked="@EditDescription" Color="Color.Success">@L["Edit"]</Button> }
else
{
<Button Color="Color.Primary" Clicked="@CancelDescription">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@SaveDescription">@L["Save"]</Button>
}
<Button Clicked="@CancelDescription" Color="Color.Primary">@L["Cancel"]</Button>
<Button Clicked="@SaveDescription" Color="Color.Success">@L["Save"]</Button> }
<Tabs SelectedTab="@_selectedDescriptionTab" SelectedTabChanged="@OnSelectedDescriptionTabChanged">
<Items>
<Tab Name="markdown">Markdown</Tab>
@@ -586,12 +525,11 @@
</Items>
<Content>
<TabPanel Name="markdown">
<textarea onchange="OnCompanyMarkdownChanged()" class="form-control" rows="200" id="txtCompanyDescriptionMarkdown" readonly="@_readonlyDescription">@_description.Markdown</textarea>
<textarea class="form-control" id="txtCompanyDescriptionMarkdown" onchange="OnCompanyMarkdownChanged()" readonly="@_readonlyDescription" rows="200">@_description.Markdown</textarea>
</TabPanel>
<TabPanel Name="preview">
@((MarkupString)_description.Html)
</TabPanel>
</Content>
</Tabs>
}
</Tabs> }
</div>

View File

@@ -471,7 +471,7 @@ namespace Marechai.Pages.Admin.Details
{
await _uploadMs.WriteAsync(buffer, 0, count);
double progress = ((double)fs.Position * 100) / fs.Length;
double progress = (double)fs.Position * 100 / fs.Length;
if(!(progress > lastProgress + 0.01))
continue;

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -26,7 +26,6 @@
}
@page "/admin/machines/photo/create/{MachineId:int}"
@using Marechai.Database
@using Marechai.Database.Models
@inherits OwningComponentBase<MachinePhotosService>
@inject IStringLocalizer<MachinePhotosService> L
@@ -34,40 +33,39 @@
@inject LicensesService LicensesService
@inject IFileReaderService FileReaderService;
@inject MachinesService MachinesService;
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@inject IWebHostEnvironment Host
@attribute [Authorize(Roles = "UberAdmin, Admin")]
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<h3>@string.Format(L["Upload photo for machine {0} manufactured by {1}"], _machine.Name, _machine.Company)</h3>
<hr />
@if(!_uploaded)
{
@if(!_uploading)
{
<FieldLabel>@L["Choose photo file"]</FieldLabel>
<input type="file" @ref=_inputUpload /><br/>
<input ref=_inputUpload @type="file" />
<br />
<Field>
<FieldLabel>@L["License"]</FieldLabel>
<Select TValue="int" @bind-SelectedValue="@_licenseId">
@foreach (var license in _licenses)
<Select @bind-SelectedValue="@_licenseId" @TValue="int">
@foreach(var license in _licenses)
{
<SelectItem TValue="int" Value="@license.Id">@license.Name</SelectItem>
}
<SelectItem @TValue="int" Value="@license.Id">@license.Name</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Source URL"]</FieldLabel>
<Check TValue="bool" @bind-Checked="@_unknownSource">@L["Unknown (source url)"]</Check>
@if (!_unknownSource)
<Check @bind-Checked="@_unknownSource" @TValue="bool">@L["Unknown (source url)"]</Check>
@if(!_unknownSource)
{
<Validation Validator="@ValidateSource">
<TextEdit @bind-Text="@_sourceUrl">
@@ -76,16 +74,16 @@
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
<div>TODO: Put legal disclaimer here</div>
<Button Color="Color.Success" Clicked="@UploadFile" Disabled="@_uploading">@L["Upload"]</Button><br/>
<Button Clicked="@UploadFile" Color="Color.Success" Disabled="@_uploading">@L["Upload"]</Button> <br />
}
else
{
@L["Uploading..."]
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: @(_progressValue)%;" aria-valuenow="@_progressValue" aria-valuemin="0" aria-valuemax="100">@($"{_progressValue:F2}")%</div>
<div aria-valuemax="100" aria-valuemin="0" aria-valuenow="@_progressValue" class="progress-bar" role="progressbar" style="width: @(_progressValue)%;">@($"{_progressValue:F2}")%</div>
</div>
}
@if(_uploadError)
@@ -96,7 +94,7 @@
else
{
<h5>@string.Format(L["Image format recognized as {0}"], _imageFormat)</h5>
@if (_allFinished)
@if(_allFinished)
{
<span class="text-success">@L["All finished!"]</span>
<a class="btn btn-success" href="/admin/machines/photo/details/@_model.Id">@L["Go to photo details"]</a>
@@ -135,7 +133,7 @@ else
@if(_moveFile == true)
{
<a href="/assets/photos/machines/originals/@($"{_model.Id}{_model.OriginalExtension}")" target="_blank">
<img src="/assets/photos/machines/originals/@($"{_model.Id}{_model.OriginalExtension}")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="/assets/photos/machines/originals/@($"{_model.Id}{_model.OriginalExtension}")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -158,7 +156,7 @@ else
@if(_convertJpegHdTh == true)
{
<a href="@($"/assets/photos/machines/thumbs/jpeg/hd/{_model.Id}.jpg")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/jpeg/hd/{_model.Id}.jpg")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/jpeg/hd/{_model.Id}.jpg")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -181,7 +179,7 @@ else
@if(_convertJpeg1440Th == true)
{
<a href="@($"/assets/photos/machines/thumbs/jpeg/1440p/{_model.Id}.jpg")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/jpeg/1440p/{_model.Id}.jpg")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/jpeg/1440p/{_model.Id}.jpg")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -204,7 +202,7 @@ else
@if(_convertJpeg4kTh == true)
{
<a href="@($"/assets/photos/machines/thumbs/jpeg/4k/{_model.Id}.jpg")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/jpeg/4k/{_model.Id}.jpg")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/jpeg/4k/{_model.Id}.jpg")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -227,7 +225,7 @@ else
@if(_convertJpegHd == true)
{
<a href="@($"/assets/photos/machines/jpeg/hd/{_model.Id}.jpg")" target="_blank">
<img src="@($"/assets/photos/machines/jpeg/hd/{_model.Id}.jpg")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/jpeg/hd/{_model.Id}.jpg")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -250,7 +248,7 @@ else
@if(_convertJpeg1440 == true)
{
<a href="@($"/assets/photos/machines/jpeg/1440p/{_model.Id}.jpg")" target="_blank">
<img src="@($"/assets/photos/machines/jpeg/1440p/{_model.Id}.jpg")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/jpeg/1440p/{_model.Id}.jpg")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -273,7 +271,7 @@ else
@if(_convertJpeg4k == true)
{
<a href="@($"/assets/photos/machines/jpeg/4k/{_model.Id}.jpg")" target="_blank">
<img src="@($"/assets/photos/machines/jpeg/4k/{_model.Id}.jpg")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/jpeg/4k/{_model.Id}.jpg")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -296,7 +294,7 @@ else
@if(_convertJp2kHdTh == true)
{
<a href="@($"/assets/photos/machines/thumbs/jp2k/hd/{_model.Id}.jp2")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/jp2k/hd/{_model.Id}.jp2")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/jp2k/hd/{_model.Id}.jp2")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -319,7 +317,7 @@ else
@if(_convertJp2k1440Th == true)
{
<a href="@($"/assets/photos/machines/thumbs/jp2k/1440p/{_model.Id}.jp2")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/jp2k/1440p/{_model.Id}.jp2")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/jp2k/1440p/{_model.Id}.jp2")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -342,7 +340,7 @@ else
@if(_convertJp2k4kTh == true)
{
<a href="@($"/assets/photos/machines/thumbs/jp2k/4k/{_model.Id}.jp2")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/jp2k/4k/{_model.Id}.jp2")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/jp2k/4k/{_model.Id}.jp2")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -365,7 +363,7 @@ else
@if(_convertJp2kHd == true)
{
<a href="@($"/assets/photos/machines/jp2k/hd/{_model.Id}.jp2")" target="_blank">
<img src="@($"/assets/photos/machines/jp2k/hd/{_model.Id}.jp2")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/jp2k/hd/{_model.Id}.jp2")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -388,7 +386,7 @@ else
@if(_convertJp2k1440 == true)
{
<a href="@($"/assets/photos/machines/jp2k/1440p/{_model.Id}.jp2")" target="_blank">
<img src="@($"/assets/photos/machines/jp2k/1440p/{_model.Id}.jp2")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/jp2k/1440p/{_model.Id}.jp2")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -411,7 +409,7 @@ else
@if(_convertJp2k4k == true)
{
<a href="@($"/assets/photos/machines/jp2k/4k/{_model.Id}.jp2")" target="_blank">
<img src="@($"/assets/photos/machines/jp2k/4k/{_model.Id}.jp2")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/jp2k/4k/{_model.Id}.jp2")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -434,7 +432,7 @@ else
@if(_convertWebpHdTh == true)
{
<a href="@($"/assets/photos/machines/thumbs/webp/hd/{_model.Id}.webp")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/webp/hd/{_model.Id}.webp")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/webp/hd/{_model.Id}.webp")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -457,7 +455,7 @@ else
@if(_convertWebp1440Th == true)
{
<a href="@($"/assets/photos/machines/thumbs/webp/1440p/{_model.Id}.webp")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/webp/1440p/{_model.Id}.webp")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/webp/1440p/{_model.Id}.webp")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -480,7 +478,7 @@ else
@if(_convertWebp4kTh == true)
{
<a href="@($"/assets/photos/machines/thumbs/webp/4k/{_model.Id}.webp")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/webp/4k/{_model.Id}.webp")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/webp/4k/{_model.Id}.webp")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -503,7 +501,7 @@ else
@if(_convertWebpHd == true)
{
<a href="@($"/assets/photos/machines/webp/hd/{_model.Id}.webp")" target="_blank">
<img src="@($"/assets/photos/machines/webp/hd/{_model.Id}.webp")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/webp/hd/{_model.Id}.webp")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -526,7 +524,7 @@ else
@if(_convertWebp1440 == true)
{
<a href="@($"/assets/photos/machines/webp/1440p/{_model.Id}.webp")" target="_blank">
<img src="@($"/assets/photos/machines/webp/1440p/{_model.Id}.webp")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/webp/1440p/{_model.Id}.webp")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -549,7 +547,7 @@ else
@if(_convertWebp4k == true)
{
<a href="@($"/assets/photos/machines/webp/4k/{_model.Id}.webp")" target="_blank">
<img src="@($"/assets/photos/machines/webp/4k/{_model.Id}.webp")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/webp/4k/{_model.Id}.webp")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -572,7 +570,7 @@ else
@if(_convertHeifHdTh == true)
{
<a href="@($"/assets/photos/machines/thumbs/heif/hd/{_model.Id}.heic")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/heif/hd/{_model.Id}.heic")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/heif/hd/{_model.Id}.heic")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -595,7 +593,7 @@ else
@if(_convertHeif1440Th == true)
{
<a href="@($"/assets/photos/machines/thumbs/heif/1440p/{_model.Id}.heic")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/heif/1440p/{_model.Id}.heic")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/heif/1440p/{_model.Id}.heic")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -618,7 +616,7 @@ else
@if(_convertHeif4kTh == true)
{
<a href="@($"/assets/photos/machines/thumbs/heif/4k/{_model.Id}.heic")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/heif/4k/{_model.Id}.heic")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/heif/4k/{_model.Id}.heic")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -641,7 +639,7 @@ else
@if(_convertHeifHd == true)
{
<a href="@($"/assets/photos/machines/heif/hd/{_model.Id}.heic")" target="_blank">
<img src="@($"/assets/photos/machines/heif/hd/{_model.Id}.heic")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/heif/hd/{_model.Id}.heic")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -664,7 +662,7 @@ else
@if(_convertHeif1440 == true)
{
<a href="@($"/assets/photos/machines/heif/1440p/{_model.Id}.heic")" target="_blank">
<img src="@($"/assets/photos/machines/heif/1440p/{_model.Id}.heic")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/heif/1440p/{_model.Id}.heic")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -687,7 +685,7 @@ else
@if(_convertHeif4k == true)
{
<a href="@($"/assets/photos/machines/heif/4k/{_model.Id}.heic")" target="_blank">
<img src="@($"/assets/photos/machines/heif/4k/{_model.Id}.heic")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/heif/4k/{_model.Id}.heic")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -710,7 +708,7 @@ else
@if(_convertAvifHdTh == true)
{
<a href="@($"/assets/photos/machines/thumbs/avif/hd/{_model.Id}.avif")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/avif/hd/{_model.Id}.avif")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/avif/hd/{_model.Id}.avif")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -733,7 +731,7 @@ else
@if(_convertAvif1440Th == true)
{
<a href="@($"/assets/photos/machines/thumbs/avif/1440p/{_model.Id}.avif")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/avif/1440p/{_model.Id}.avif")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/avif/1440p/{_model.Id}.avif")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -756,7 +754,7 @@ else
@if(_convertAvif4kTh == true)
{
<a href="@($"/assets/photos/machines/thumbs/avif/4k/{_model.Id}.avif")" target="_blank">
<img src="@($"/assets/photos/machines/thumbs/avif/4k/{_model.Id}.avif")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/thumbs/avif/4k/{_model.Id}.avif")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -779,7 +777,7 @@ else
@if(_convertAvifHd == true)
{
<a href="@($"/assets/photos/machines/avif/hd/{_model.Id}.avif")" target="_blank">
<img src="@($"/assets/photos/machines/avif/hd/{_model.Id}.avif")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/avif/hd/{_model.Id}.avif")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -802,7 +800,7 @@ else
@if(_convertAvif1440 == true)
{
<a href="@($"/assets/photos/machines/avif/1440p/{_model.Id}.avif")" target="_blank">
<img src="@($"/assets/photos/machines/avif/1440p/{_model.Id}.avif")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/avif/1440p/{_model.Id}.avif")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -825,7 +823,7 @@ else
@if(_convertAvif4k == true)
{
<a href="@($"/assets/photos/machines/avif/4k/{_model.Id}.avif")" target="_blank">
<img src="@($"/assets/photos/machines/avif/4k/{_model.Id}.avif")" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<img alt="" height="auto" src="@($"/assets/photos/machines/avif/4k/{_model.Id}.avif")" style="max-height: 256px; max-width: 256px" width="auto" />
</a>
}
</td>
@@ -847,5 +845,4 @@ else
<td>
</td>
</tr>
</table>
}
</table>}

View File

@@ -233,7 +233,7 @@ namespace Marechai.Pages.Admin.Details
{
await outFs.WriteAsync(buffer, 0, count);
double progress = ((double)fs.Position * 100) / fs.Length;
double progress = (double)fs.Position * 100 / fs.Length;
if(!(progress > lastProgress + 0.01))
continue;

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -34,35 +34,31 @@
@inject Iso4217Service CurrenciesService
@inject NavigationManager NavigationManager
@inject IWebHostEnvironment Host
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Currency inflation details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Currency"]</FieldLabel>
<Select Disabled="!_editing" TValue="string" @bind-SelectedValue="@_model.CurrencyCode">
@foreach (var currency in _currencies)
<Select @bind-SelectedValue="@_model.CurrencyCode" Disabled="!_editing" @TValue="string">
@foreach(var currency in _currencies)
{
<SelectItem TValue="string" Value="@currency.Code">@currency.Name</SelectItem>
}
<SelectItem @TValue="string" Value="@currency.Code">@currency.Name</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Year"]</FieldLabel>
<Validation Validator="@ValidateYear">
<NumericEdit Disabled="!_editing" TValue="uint" Decimals="0" @bind-Value="@_model.Year">
<NumericEdit @bind-Value="@_model.Year" Decimals="0" Disabled="!_editing" @TValue="uint">
<Feedback>
<ValidationError>@L["Please enter a valid year."]</ValidationError>
</Feedback>
@@ -72,7 +68,7 @@
<Field>
<FieldLabel>@L["Inflation (ratio)"]</FieldLabel>
<Validation Validator="@ValidateInflation">
<NumericEdit Disabled="!_editing" TValue="float" Decimals="3" @bind-Value="@_model.Inflation">
<NumericEdit @bind-Value="@_model.Inflation" Decimals="3" Disabled="!_editing" @TValue="float">
<Feedback>
<ValidationError>@L["Please enter a valid inflation."]</ValidationError>
</Feedback>
@@ -81,14 +77,14 @@
</Field>
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/currency_inflation" class="btn btn-secondary">@L["Back to list"]</a>
<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/currency_inflation">@L["Back to list"]</a>
</div>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -34,44 +34,40 @@
@inject Iso4217Service CurrenciesService
@inject NavigationManager NavigationManager
@inject IWebHostEnvironment Host
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Currency pegging details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Source currency"]</FieldLabel>
<Select Disabled="!_editing" TValue="string" @bind-SelectedValue="@_model.SourceCode">
@foreach (var currency in _currencies)
<Select @bind-SelectedValue="@_model.SourceCode" Disabled="!_editing" @TValue="string">
@foreach(var currency in _currencies)
{
<SelectItem TValue="string" Value="@currency.Code">@currency.Name</SelectItem>
}
<SelectItem @TValue="string" Value="@currency.Code">@currency.Name</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Destination currency"]</FieldLabel>
<Select Disabled="!_editing" TValue="string" @bind-SelectedValue="@_model.DestinationCode">
@foreach (var currency in _currencies)
<Select @bind-SelectedValue="@_model.DestinationCode" Disabled="!_editing" @TValue="string">
@foreach(var currency in _currencies)
{
<SelectItem TValue="string" Value="@currency.Code">@currency.Name</SelectItem>
}
<SelectItem @TValue="string" Value="@currency.Code">@currency.Name</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Pegging (ratio)"]</FieldLabel>
<Validation Validator="@ValidatePegging">
<NumericEdit Disabled="!_editing" TValue="float" Decimals="3" @bind-Value="@_model.Ratio">
<NumericEdit @bind-Value="@_model.Ratio" Decimals="3" Disabled="!_editing" @TValue="float">
<Feedback>
<ValidationError>@L["Please enter a valid pegging."]</ValidationError>
</Feedback>
@@ -81,44 +77,44 @@
<Field>
<FieldLabel>@L["Start date"]</FieldLabel>
<Validation Validator="@ValidateStart">
<DateEdit Disabled="!_editing" TValue="DateTime" @bind-Date="@_model.Start">
<DateEdit @bind-Date="@_model.Start" Disabled="!_editing" @TValue="DateTime">
<Feedback>
<ValidationError>@L["Please enter a start date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
</Field>
@if (_editing || _model.End.HasValue)
@if(_editing || _model.End.HasValue)
{
<Field>
<FieldLabel>@L["End date"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownEnd">@L["Unknown or never (end date)"]</Check>
}
@if (!_editing ||
(!_unknownEnd))
<Check @bind-Checked="@_unknownEnd" @TValue="bool">@L["Unknown or never (end date)"]</Check>
}
@if(!_editing ||
!_unknownEnd)
{
<Validation Validator="@ValidateEnd">
<DateEdit Disabled="!_editing" TValue="DateTime?" @bind-Date="@_model.End">
<DateEdit @bind-Date="@_model.End" Disabled="!_editing" @TValue="DateTime?">
<Feedback>
<ValidationError>@L["Please enter an ending date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
}
}
</Field>
}
}
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/currency_pegging" class="btn btn-secondary">@L["Back to list"]</a>
<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/currency_pegging">@L["Back to list"]</a>
</div>

File diff suppressed because it is too large Load Diff

View File

@@ -818,7 +818,7 @@ namespace Marechai.Pages.Admin.Details
{
await outFs.WriteAsync(buffer, 0, count);
double progress = ((double)fs.Position * 100) / fs.Length;
double progress = (double)fs.Position * 100 / fs.Length;
if(!(progress > lastProgress + 0.01))
continue;
@@ -1418,4 +1418,6 @@ namespace Marechai.Pages.Admin.Details
StateHasChanged();
}
}
class DocumentImpl : Document {}
}

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -33,60 +33,58 @@
@inject IStringLocalizer<DocumentCompaniesService> L
@inject CompaniesService CompaniesService
@inject NavigationManager NavigationManager
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Document company details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Name"]</FieldLabel>
<Validation Validator="@ValidateName">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Name">
<TextEdit @bind-Text="@_model.Name" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid name."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
</Field>
@if (_editing || _model.CompanyId != null)
@if(_editing || _model.CompanyId != null)
{
<Field>
<FieldLabel>@L["Linked company"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_noLinkedCompany">@L["None (linked company)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_noLinkedCompany" @TValue="bool">@L["None (linked company)"]</Check>
}
@if(!_editing ||
!_noLinkedCompany)
{
<Select Disabled="!_editing" TValue="int?" @bind-SelectedValue="@_model.CompanyId">
@foreach (var company in _companies)
<Select @bind-SelectedValue="@_model.CompanyId" Disabled="!_editing" @TValue="int?">
@foreach(var company in _companies)
{
<SelectItem TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
<SelectItem @TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
</Select>
}
}
</Field>
}
}
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/document_people" class="btn btn-secondary">@L["Back to list"]</a>
<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>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -33,134 +33,132 @@
@inject IStringLocalizer<DocumentPeopleService> L
@inject PeopleService PeopleService
@inject NavigationManager NavigationManager
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Document person details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
@if (_editing || _model.Name != null)
@if(_editing || _model.Name != null)
{
<Field>
<FieldLabel>@L["Name"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownName">@L["Unknown (name)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownName" @TValue="bool">@L["Unknown (name)"]</Check>
}
@if(!_editing ||
!_unknownName)
{
<Validation Validator="@ValidateName">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Name">
<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)
}
@if(_editing || _model.Surname != null)
{
<Field>
<FieldLabel>@L["Surname"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownSurname">@L["Unknown (surname)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownSurname" @TValue="bool">@L["Unknown (surname)"]</Check>
}
@if(!_editing ||
!_unknownSurname)
{
<Validation Validator="@ValidateSurname">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Surname">
<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)
}
@if(_editing || _model.Alias != null)
{
<Field>
<FieldLabel>@L["Alias"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownAlias">@L["Unknown (alias)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownAlias" @TValue="bool">@L["Unknown (alias)"]</Check>
}
@if(!_editing ||
!_unknownAlias)
{
<Validation Validator="@ValidateAlias">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Alias">
<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)
}
@if(_editing || _model.DisplayName != null)
{
<Field>
<FieldLabel>@L["Display name"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownDisplayName">@L["Unknown (display name)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownDisplayName" @TValue="bool">@L["Unknown (display name)"]</Check>
}
@if(!_editing ||
!_unknownDisplayName)
{
<Validation Validator="@ValidateDisplayName">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.DisplayName">
<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)
}
@if(_editing || _model.PersonId != null)
{
<Field>
<FieldLabel>@L["Linked person"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_noLinkedPerson">@L["None (linked person)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_noLinkedPerson" @TValue="bool">@L["None (linked person)"]</Check>
}
@if(!_editing ||
!_noLinkedPerson)
{
<Select Disabled="!_editing" TValue="int?" @bind-SelectedValue="@_model.PersonId">
@foreach (var person in _people)
<Select @bind-SelectedValue="@_model.PersonId" Disabled="!_editing" @TValue="int?">
@foreach(var person in _people)
{
<SelectItem TValue="int?" Value="@person.Id">@person.DisplayName</SelectItem>
}
<SelectItem @TValue="int?" Value="@person.Id">@person.DisplayName</SelectItem>
}
</Select>
}
}
</Field>
}
}
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/document_people" class="btn btn-secondary">@L["Back to list"]</a>
<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>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -28,7 +28,6 @@
@page "/admin/dumps/details/{Id:long}"
@page "/admin/dumps/edit/{Id:long}"
@page "/admin/dumps/create"
@using Marechai.Database
@using Marechai.Database.Models
@inherits OwningComponentBase<DumpsService>
@inject IStringLocalizer<DumpsService> L
@@ -36,115 +35,112 @@
@inject NavigationManager NavigationManager
@inject IWebHostEnvironment Host
@inject IJSRuntime JSRuntime
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Dump details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Dumper"]</FieldLabel>
<Validation Validator="@ValidateDumper">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Dumper">
<TextEdit @bind-Text="@_model.Dumper" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid dumper."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
</Field>
@if (_editing || _model.UserId != null)
@if(_editing || _model.UserId != null)
{
<Field>
<FieldLabel>@L["Dumper's user"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownUser">@L["Unknown (user)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownUser" @TValue="bool">@L["Unknown (user)"]</Check>
}
@if(!_editing ||
!_unknownUser)
{
<Select Disabled="!_editing" TValue="string" @bind-SelectedValue="@_model.UserId">
@foreach (var user in _users)
<Select @bind-SelectedValue="@_model.UserId" Disabled="!_editing" @TValue="string">
@foreach(var user in _users)
{
<SelectItem TValue="string" Value="@user.Id">@user.UserName</SelectItem>
}
<SelectItem @TValue="string" Value="@user.Id">@user.UserName</SelectItem>
}
</Select>
}
}
</Field>
}
@if (_editing || _model.DumpingGroup != null)
}
@if(_editing || _model.DumpingGroup != null)
{
<Field>
<FieldLabel>@L["Dumping group, or group whose guidelines where followed to make the dump"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownDumpingGroup">@L["Unknown (dumping group)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownDumpingGroup" @TValue="bool">@L["Unknown (dumping group)"]</Check>
}
@if(!_editing ||
!_unknownDumpingGroup)
{
<Validation Validator="@ValidateDumpingGroup">
<TextEdit Disabled="!_editing" @bind-Text="@_model.DumpingGroup">
<TextEdit @bind-Text="@_model.DumpingGroup" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid dumping group."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.DumpDate != null)
}
@if(_editing || _model.DumpDate != null)
{
<Field>
<FieldLabel>@L["Dump date"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownDumpDate">@L["Unknown (dump date)"]</Check>
}
@if (!_editing || !_unknownDumpDate)
<Check @bind-Checked="@_unknownDumpDate" @TValue="bool">@L["Unknown (dump date)"]</Check>
}
@if(!_editing ||
!_unknownDumpDate)
{
<Validation Validator="@ValidateDumpDate">
<DateEdit TValue="DateTime?" ReadOnly="!_editing" @bind-Date="@_model.DumpDate" >
<DateEdit @bind-Date="@_model.DumpDate" ReadOnly="!_editing" @TValue="DateTime?">
<Feedback>
<ValidationError>@L["Please enter a valid dump date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
}
}
</Field>
}
}
<Field>
<FieldLabel>@L["Media"]</FieldLabel>
<Select Disabled="!_editing" TValue="ulong" @bind-SelectedValue="@_model.MediaId">
@foreach (var media in _medias)
<Select @bind-SelectedValue="@_model.MediaId" Disabled="!_editing" @TValue="ulong">
@foreach(var media in _medias)
{
<SelectItem TValue="ulong" Value="@media.Id">@media.Title</SelectItem>
}
<SelectItem @TValue="ulong" Value="@media.Id">@media.Title</SelectItem>
}
</Select>
</Field>
@{
@{
// TODO: Dump hardware
}
}
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/dumps" class="btn btn-secondary">@L["Back to list"]</a>
<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>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -35,236 +35,234 @@
@inject NavigationManager NavigationManager
@inject ResolutionsService ResolutionsService
@inject ResolutionsByGpuService ResolutionsByGpuService
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Graphical processing unit details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
<p align="center">@L["Loading..."]</p>
return;
}
<div>
@if (_editing || _model.CompanyId != null)
@if(_editing || _model.CompanyId != null)
{
<Field>
<FieldLabel>@L["Company"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownCompany">@L["Unknown (company)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownCompany" @TValue="bool">@L["Unknown (company)"]</Check>
}
@if(!_editing ||
!_unknownCompany)
{
<Select Disabled="!_editing" TValue="int?" @bind-SelectedValue="@_model.CompanyId">
@foreach (var company in _companies)
<Select @bind-SelectedValue="@_model.CompanyId" Disabled="!_editing" @TValue="int?">
@foreach(var company in _companies)
{
<SelectItem TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
<SelectItem @TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
</Select>
}
}
</Field>
}
}
<Field>
<FieldLabel>@L["Name"]</FieldLabel>
<Validation Validator="@ValidateName">
<TextEdit Disabled="!_editing" @bind-Text="@_model.Name">
<TextEdit @bind-Text="@_model.Name" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid name."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
</Field>
@if (_editing || _model.ModelCode != null)
@if(_editing || _model.ModelCode != null)
{
<Field>
<FieldLabel>@L["Model code"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownModelCode">@L["Unknown (model code)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownModelCode" @TValue="bool">@L["Unknown (model code)"]</Check>
}
@if(!_editing ||
!_unknownModelCode)
{
<Validation Validator="@ValidateModelCode">
<TextEdit Disabled="!_editing" @bind-Text="@_model.ModelCode">
<TextEdit @bind-Text="@_model.ModelCode" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid model code."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Introduced.HasValue)
}
@if(_editing || _model.Introduced.HasValue)
{
<Field>
<FieldLabel>@L["Introduced"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" Disabled="_prototype" @bind-Checked="@_unknownIntroduced">@L["Unknown (introduction date)"]</Check>
<Check TValue="bool" Disabled="_unknownIntroduced" @bind-Checked="@_prototype">@L["Prototype"]</Check>
}
@if (!_editing ||
(!_prototype && !_unknownIntroduced))
<Check @bind-Checked="@_unknownIntroduced" Disabled="_prototype" @TValue="bool">@L["Unknown (introduction date)"]</Check>
<Check @bind-Checked="@_prototype" Disabled="_unknownIntroduced" @TValue="bool">@L["Prototype"]</Check>
}
@if(!_editing ||
!_prototype && !_unknownIntroduced)
{
<Validation Validator="@ValidateIntroduced">
<DateEdit Disabled="!_editing" TValue="DateTime?" @bind-Date="@_model.Introduced">
<DateEdit @bind-Date="@_model.Introduced" Disabled="!_editing" @TValue="DateTime?">
<Feedback>
<ValidationError>@L["Please enter an introduction date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Package != null)
}
@if(_editing || _model.Package != null)
{
<Field>
<FieldLabel>@L["Package"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownPackage">@L["Unknown (package)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownPackage" @TValue="bool">@L["Unknown (package)"]</Check>
}
@if(!_editing ||
!_unknownPackage)
{
<Validation Validator="@ValidatePackage">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Package">
<TextEdit @bind-Text="@_model.Package" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid package."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Process != null)
}
@if(_editing || _model.Process != null)
{
<Field>
<FieldLabel>@L["Process"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownProcess">@L["Unknown (process)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownProcess" @TValue="bool">@L["Unknown (process)"]</Check>
}
@if(!_editing ||
!_unknownProcess)
{
<Validation Validator="@ValidateProcess">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Process">
<TextEdit @bind-Text="@_model.Process" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid process."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.ProcessNm.HasValue)
}
@if(_editing || _model.ProcessNm.HasValue)
{
<Field>
<FieldLabel>@L["Process (nm)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownProcessNm">@L["Unknown (process size)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownProcessNm" @TValue="bool">@L["Unknown (process size)"]</Check>
}
@if(!_editing ||
!_unknownProcessNm)
{
<Validation Validator="@ValidateFloatBiggerThanOne">
<NumericEdit Disabled="!_editing" TValue="float?" Decimals="2" @bind-Value="@_model.ProcessNm">
<NumericEdit @bind-Value="@_model.ProcessNm" Decimals="2" Disabled="!_editing" @TValue="float?">
<Feedback>
<ValidationError>@L["Please enter a valid process size in nanometers."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.DieSize.HasValue)
}
@if(_editing || _model.DieSize.HasValue)
{
<Field>
<FieldLabel>@L["Die size (mm²)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownDieSize">@L["Unknown (die size)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownDieSize" @TValue="bool">@L["Unknown (die size)"]</Check>
}
@if(!_editing ||
!_unknownDieSize)
{
<Validation Validator="@ValidateFloatBiggerThanOne">
<NumericEdit Disabled="!_editing" TValue="float?" Decimals="2" @bind-Value="@_model.DieSize">
<NumericEdit @bind-Value="@_model.DieSize" Decimals="2" Disabled="!_editing" @TValue="float?">
<Feedback>
<ValidationError>@L["Please enter a valid die size in square millimeters."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Transistors.HasValue)
}
@if(_editing || _model.Transistors.HasValue)
{
<Field>
<FieldLabel>@L["Transistors"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownTransistors">@L["Unknown (transistors)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownTransistors" @TValue="bool">@L["Unknown (transistors)"]</Check>
}
@if(!_editing ||
!_unknownTransistors)
{
<Validation Validator="@ValidateLongBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="long?" Decimals="0" @bind-Value="@_model.Transistors">
<NumericEdit @bind-Value="@_model.Transistors" Decimals="0" Disabled="!_editing" @TValue="long?">
<Feedback>
<ValidationError>@L["Please enter a valid number of transistors."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
}
}
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/gpus" class="btn btn-secondary">@L["Back to list"]</a>
<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/gpus">@L["Back to list"]</a>
</div>
@if (!_editing)
@if(!_editing)
{
<hr />
<h3>@L["Resolutions supported by this graphical processing unit"]</h3>
<Button Color="Color.Success" Clicked="OnAddResolutionClick" Disabled="_addingResolution">@L["Add new (resolution by gpu)"]</Button>
@if (_addingResolution)
<Button Clicked="OnAddResolutionClick" Color="Color.Success" Disabled="_addingResolution">@L["Add new (resolution by gpu)"]</Button>
@if(_addingResolution)
{
<div>
<Field>
<FieldLabel>@L["Resolutions"]</FieldLabel>
<Select Disabled="_savingResolution" TValue="int?" @bind-SelectedValue="@_addingResolutionId">
@foreach (var resolution in _resolutions)
<Select @bind-SelectedValue="@_addingResolutionId" Disabled="_savingResolution" @TValue="int?">
@foreach(var resolution in _resolutions)
{
@if (_gpuResolutions.All(r => r.ResolutionId != resolution.Id))
@if(_gpuResolutions.All(r => r.ResolutionId != resolution.Id))
{
<SelectItem TValue="int?" Value="@resolution.Id">@resolution</SelectItem>
}
<SelectItem @TValue="int?" Value="@resolution.Id">@resolution</SelectItem>
}
}
</Select>
<Button Color="Color.Primary" Clicked="@CancelAddResolution" Disabled="@_savingResolution">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@ConfirmAddResolution" Disabled="@_savingResolution">@L["Add"]</Button>
<Button Clicked="@CancelAddResolution" Color="Color.Primary" Disabled="@_savingResolution">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddResolution" Color="Color.Success" Disabled="@_savingResolution">@L["Add"]</Button>
</Field>
</div>
}
@if (_gpuResolutions?.Count > 0)
@if(_gpuResolutions?.Count > 0)
{
<div>
<table class="table table-striped">
@@ -292,7 +290,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _gpuResolutions)
@foreach(var item in _gpuResolutions)
{
<tr>
<td>
@@ -314,7 +312,7 @@
@item.Resolution.Grayscale
</td>
<td>
<Button Color="Color.Danger" Clicked="() => {ShowResolutionDeleteModal(item.Id);}" Disabled="@_addingResolution">@L["Delete"]</Button>
<Button Clicked="() => {ShowResolutionDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingResolution">@L["Delete"]</Button>
</td>
</tr>
}
@@ -323,7 +321,7 @@
</div>
}
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
@@ -334,9 +332,8 @@
<Text>@_deleteText</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>
}
</Modal>}

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -33,23 +33,21 @@
@inject IStringLocalizer<InstructionSetsService> L
@attribute [Authorize(Roles = "UberAdmin, Admin")]
@inject NavigationManager NavigationManager
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
<h3>@L["Instruction set details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Name"]</FieldLabel>
<Validation Validator="@ValidateName">
<TextEdit Disabled="!_editing" @bind-Text="@_model.Name">
<TextEdit @bind-Text="@_model.Name" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid instruction set name."]</ValidationError>
</Feedback>
@@ -58,14 +56,14 @@
</Field>
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/instruction_sets" class="btn btn-secondary">@L["Back to list"]</a>
<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/instruction_sets">@L["Back to list"]</a>
</div>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -33,23 +33,21 @@
@inject IStringLocalizer<InstructionSetExtensionsService> L
@attribute [Authorize(Roles = "UberAdmin, Admin")]
@inject NavigationManager NavigationManager
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
<h3>@L["Instruction set extension details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Extension"]</FieldLabel>
<Validation Validator="@ValidateName">
<TextEdit Disabled="!_editing" @bind-Text="@_model.Extension">
<TextEdit @bind-Text="@_model.Extension" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid extension name."]</ValidationError>
</Feedback>
@@ -58,14 +56,14 @@
</Field>
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/instruction_set_extensions" class="btn btn-secondary">@L["Back to list"]</a>
<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/instruction_set_extensions">@L["Back to list"]</a>
</div>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -32,24 +32,22 @@
@inherits OwningComponentBase<LicensesService>
@inject IStringLocalizer<LicensesService> L
@inject NavigationManager NavigationManager
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["License details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Name"]</FieldLabel>
<Validation Validator="@ValidateName">
<TextEdit Disabled="!_editing" @bind-Text="@_model.Name">
<TextEdit @bind-Text="@_model.Name" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid name."]</ValidationError>
</Feedback>
@@ -59,7 +57,7 @@
<Field>
<FieldLabel>@L["SPDX identifier"]</FieldLabel>
<Validation Validator="@ValidateSpdx">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.SPDX">
<TextEdit @bind-Text="@_model.SPDX" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid SPDX identifier."]</ValidationError>
</Feedback>
@@ -68,64 +66,64 @@
</Field>
<Field>
<FieldLabel>@L["FSF approved"]</FieldLabel>
<Check TValue="bool" Disabled="!_editing" @bind-Checked="@_model.FsfApproved"/>
<Check @bind-Checked="@_model.FsfApproved" Disabled="!_editing" @TValue="bool" />
</Field>
<Field>
<FieldLabel>@L["OSI approved"]</FieldLabel>
<Check TValue="bool" Disabled="!_editing" @bind-Checked="@_model.OsiApproved"/>
<Check @bind-Checked="@_model.OsiApproved" Disabled="!_editing" @TValue="bool" />
</Field>
@if (_editing || _model.Link != null)
@if(_editing || _model.Link != null)
{
<Field>
<FieldLabel>@L["License text link"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownLink">@L["Unknown or none (text link)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownLink" @TValue="bool">@L["Unknown or none (text link)"]</Check>
}
@if(!_editing ||
!_unknownLink)
{
<Validation Validator="@ValidateLink">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Link">
<TextEdit @bind-Text="@_model.Link" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a license text link."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Text != null)
}
@if(_editing || _model.Text != null)
{
<Field>
<FieldLabel>@L["License text"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownText">@L["Unknown (license text)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownText" @TValue="bool">@L["Unknown (license text)"]</Check>
}
@if(!_editing ||
!_unknownText)
{
<Validation Validator="@ValidateText">
<MemoEdit Rows="200" Plaintext="true" ReadOnly="!_editing" @bind-Text="@_model.Text">
<MemoEdit @bind-Text="@_model.Text" Plaintext="true" ReadOnly="!_editing" @Rows="200">
<Feedback>
<ValidationError>@L["Please enter a valid license text."]</ValidationError>
</Feedback>
</MemoEdit>
</Validation>
}
}
</Field>
}
}
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/licenses" class="btn btn-secondary">@L["Back to list"]</a>
<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/licenses">@L["Back to list"]</a>
</div>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -28,8 +28,8 @@
@page "/admin/machines/details/{Id:int}"
@page "/admin/machines/edit/{Id:int}"
@page "/admin/machines/create"
@using Marechai.Database
@using Marechai.Database.Models
@using Marechai.Database
@inherits OwningComponentBase<MachinesService>
@inject IStringLocalizer<MachinesService> L
@inject CompaniesService CompaniesService
@@ -46,33 +46,31 @@
@inject ScreensByMachineService ScreensByMachineService
@inject ScreensService ScreensService
@inject MachinePhotosService MachinePhotosService
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Machine details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Company"]</FieldLabel>
<Select Disabled="!_editing" TValue="int" @bind-SelectedValue="@_model.CompanyId">
@foreach (var company in _companies)
<Select @bind-SelectedValue="@_model.CompanyId" Disabled="!_editing" @TValue="int">
@foreach(var company in _companies)
{
<SelectItem TValue="int" Value="@company.Id">@company.Name</SelectItem>
}
<SelectItem @TValue="int" Value="@company.Id">@company.Name</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Name"]</FieldLabel>
<Validation Validator="@ValidateName">
<TextEdit Disabled="!_editing" @bind-Text="@_model.Name">
<TextEdit @bind-Text="@_model.Name" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid name."]</ValidationError>
</Feedback>
@@ -81,111 +79,111 @@
</Field>
<Field>
<FieldLabel>@L["Type"]</FieldLabel>
<Select Disabled="!_editing" TValue="int" @bind-SelectedValue="@Type">
@foreach (int type in Enum.GetValues(typeof(MachineType)))
<Select @bind-SelectedValue="@Type" Disabled="!_editing" @TValue="int">
@foreach(int type in Enum.GetValues(typeof(MachineType)))
{
<SelectItem TValue="int" Value="@type">@(((MachineType)type).ToString())</SelectItem>
}
<SelectItem @TValue="int" Value="@type">@(((MachineType)type).ToString())</SelectItem>
}
</Select>
</Field>
@if (_editing || _model.Model != null)
@if(_editing || _model.Model != null)
{
<Field>
<FieldLabel>@L["Model code"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownModel">@L["Unknown (model)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownModel" @TValue="bool">@L["Unknown (model)"]</Check>
}
@if(!_editing ||
!_unknownModel)
{
<Validation Validator="@ValidateModel">
<TextEdit Disabled="!_editing" @bind-Text="@_model.Model">
<TextEdit @bind-Text="@_model.Model" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid model."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Introduced.HasValue)
}
@if(_editing || _model.Introduced.HasValue)
{
<Field>
<FieldLabel>@L["Introduced (public release)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" Disabled="_prototype" @bind-Checked="@_unknownIntroduced">@L["Unknown (introduction date)"]</Check>
<Check TValue="bool" Disabled="_unknownIntroduced" @bind-Checked="@_prototype">@L["Prototype"]</Check>
}
@if (!_editing ||
(!_prototype && !_unknownIntroduced))
<Check @bind-Checked="@_unknownIntroduced" Disabled="_prototype" @TValue="bool">@L["Unknown (introduction date)"]</Check>
<Check @bind-Checked="@_prototype" Disabled="_unknownIntroduced" @TValue="bool">@L["Prototype"]</Check>
}
@if(!_editing ||
!_prototype && !_unknownIntroduced)
{
<Validation Validator="@ValidateIntroduced">
<DateEdit Disabled="!_editing" TValue="DateTime?" @bind-Date="@_model.Introduced">
<DateEdit @bind-Date="@_model.Introduced" Disabled="!_editing" @TValue="DateTime?">
<Feedback>
<ValidationError>@L["Please enter an introduction date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.FamilyId != null)
}
@if(_editing || _model.FamilyId != null)
{
<Field>
<FieldLabel>@L["Family"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_noFamily">@L["No family"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_noFamily" @TValue="bool">@L["No family"]</Check>
}
@if(!_editing ||
!_noFamily)
{
<Select Disabled="!_editing" TValue="int?" @bind-SelectedValue="@_model.FamilyId">
@foreach (MachineFamilyViewModel family in _families)
<Select @bind-SelectedValue="@_model.FamilyId" Disabled="!_editing" @TValue="int?">
@foreach(var family in _families)
{
<SelectItem TValue="int?" Value="@family.Id">@family.Name</SelectItem>
}
<SelectItem @TValue="int?" Value="@family.Id">@family.Name</SelectItem>
}
</Select>
}
}
</Field>
}
}
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/machines" class="btn btn-secondary">@L["Back to list"]</a>
<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/machines">@L["Back to list"]</a>
</div>
@if (!_editing)
@if(!_editing)
{
<hr />
<h3>@L["Graphical processing units belonging to this machine"]</h3>
<Button Color="Color.Success" Clicked="OnAddGpuClick" Disabled="_addingGpu">@L["Add new (gpu by machine)"]</Button>
@if (_addingGpu)
<Button Clicked="OnAddGpuClick" Color="Color.Success" Disabled="_addingGpu">@L["Add new (gpu by machine)"]</Button>
@if(_addingGpu)
{
<div>
<Field>
<FieldLabel>@L["Graphical processing units"]</FieldLabel>
<Select Disabled="_savingGpu" TValue="int?" @bind-SelectedValue="@_addingGpuId">
@foreach (var gpu in _gpus)
<Select @bind-SelectedValue="@_addingGpuId" Disabled="_savingGpu" @TValue="int?">
@foreach(var gpu in _gpus)
{
<SelectItem TValue="int?" Value="@gpu.Id">@gpu.Company - @gpu.Name</SelectItem>
}
<SelectItem @TValue="int?" Value="@gpu.Id">@gpu.Company - @gpu.Name</SelectItem>
}
</Select>
<Button Color="Color.Primary" Clicked="@CancelAddGpu" Disabled="@_savingGpu">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@ConfirmAddGpu" Disabled="@_savingGpu">@L["Add"]</Button>
<Button Clicked="@CancelAddGpu" Color="Color.Primary" Disabled="@_savingGpu">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddGpu" Color="Color.Success" Disabled="@_savingGpu">@L["Add"]</Button>
</Field>
</div>
}
@if (_machineGpus?.Count > 0)
@if(_machineGpus?.Count > 0)
{
<div>
<table class="table table-striped">
@@ -201,7 +199,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _machineGpus)
@foreach(var item in _machineGpus)
{
<tr>
<td>
@@ -211,7 +209,7 @@
@item.Name
</td>
<td>
<Button Color="Color.Danger" Clicked="() => {ShowGpuDeleteModal(item.Id);}" Disabled="@_addingGpu">@L["Delete"]</Button>
<Button Clicked="() => {ShowGpuDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingGpu">@L["Delete"]</Button>
</td>
</tr>
}
@@ -222,24 +220,24 @@
<hr />
<h3>@L["Sound synthesizers belonging to this machine"]</h3>
<Button Color="Color.Success" Clicked="OnAddSoundClick" Disabled="_addingSound">@L["Add new (sound by machine)"]</Button>
@if (_addingSound)
<Button Clicked="OnAddSoundClick" Color="Color.Success" Disabled="_addingSound">@L["Add new (sound by machine)"]</Button>
@if(_addingSound)
{
<div>
<Field>
<FieldLabel>@L["Sound synthesizers"]</FieldLabel>
<Select Disabled="_savingSound" TValue="int?" @bind-SelectedValue="@_addingSoundId">
@foreach (var soundSynth in _soundSynths)
<Select @bind-SelectedValue="@_addingSoundId" Disabled="_savingSound" @TValue="int?">
@foreach(var soundSynth in _soundSynths)
{
<SelectItem TValue="int?" Value="@soundSynth.Id">@soundSynth.CompanyName - @soundSynth.Name</SelectItem>
}
<SelectItem @TValue="int?" Value="@soundSynth.Id">@soundSynth.CompanyName - @soundSynth.Name</SelectItem>
}
</Select>
<Button Color="Color.Primary" Clicked="@CancelAddSound" Disabled="@_savingSound">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@ConfirmAddSound" Disabled="@_savingSound">@L["Add"]</Button>
<Button Clicked="@CancelAddSound" Color="Color.Primary" Disabled="@_savingSound">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddSound" Color="Color.Success" Disabled="@_savingSound">@L["Add"]</Button>
</Field>
</div>
}
@if (_machineSound?.Count > 0)
@if(_machineSound?.Count > 0)
{
<div>
<table class="table table-striped">
@@ -255,7 +253,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _machineSound)
@foreach(var item in _machineSound)
{
<tr>
<td>
@@ -265,7 +263,7 @@
@item.Name
</td>
<td>
<Button Color="Color.Danger" Clicked="() => {ShowSoundDeleteModal(item.Id);}" Disabled="@_addingSound">@L["Delete"]</Button>
<Button Clicked="() => {ShowSoundDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingSound">@L["Delete"]</Button>
</td>
</tr>
}
@@ -276,38 +274,38 @@
<hr />
<h3>@L["Processors belonging to this machine"]</h3>
<Button Color="Color.Success" Clicked="OnAddCpuClick" Disabled="_addingCpu">@L["Add new (processor by machine)"]</Button>
@if (_addingCpu)
<Button Clicked="OnAddCpuClick" Color="Color.Success" Disabled="_addingCpu">@L["Add new (processor by machine)"]</Button>
@if(_addingCpu)
{
<div>
<Field>
<FieldLabel>@L["Processors"]</FieldLabel>
<Select Disabled="_savingCpu" TValue="int?" @bind-SelectedValue="@_addingCpuId">
@foreach (var cpu in _cpus)
<Select @bind-SelectedValue="@_addingCpuId" Disabled="_savingCpu" @TValue="int?">
@foreach(var cpu in _cpus)
{
<SelectItem TValue="int?" Value="@cpu.Id">@cpu.CompanyName - @cpu.Name</SelectItem>
}
<SelectItem @TValue="int?" Value="@cpu.Id">@cpu.CompanyName - @cpu.Name</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Nominal speed (MHz)"]</FieldLabel>
<Check TValue="bool" @bind-Checked="@_unknownProcessorSpeed">@L["Unknown (processor by machine speed)"]</Check>
@if (!_unknownProcessorSpeed)
<Check @bind-Checked="@_unknownProcessorSpeed" @TValue="bool">@L["Unknown (processor by machine speed)"]</Check>
@if(!_unknownProcessorSpeed)
{
<Validation Validator="@ValidateProcessorSpeed">
<NumericEdit TValue="float?" Decimals="3" @bind-Value="@_addingProcessorSpeed" >
<NumericEdit @bind-Value="@_addingProcessorSpeed" Decimals="3" @TValue="float?">
<Feedback>
<ValidationError>@L["Please enter a valid speed for this processor."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
<Button Color="Color.Primary" Clicked="@CancelAddCpu" Disabled="@_savingCpu">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@ConfirmAddCpu" Disabled="@_savingCpu">@L["Add"]</Button>
<Button Clicked="@CancelAddCpu" Color="Color.Primary" Disabled="@_savingCpu">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddCpu" Color="Color.Success" Disabled="@_savingCpu">@L["Add"]</Button>
</div>
}
@if (_machineCpus?.Count > 0)
@if(_machineCpus?.Count > 0)
{
<div>
<table class="table table-striped">
@@ -326,7 +324,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _machineCpus)
@foreach(var item in _machineCpus)
{
<tr>
<td>
@@ -339,7 +337,7 @@
@string.Format(L["{0:F3} MHz"], item.Speed)
</td>
<td>
<Button Color="Color.Danger" Clicked="() => {ShowCpuDeleteModal(item.Id);}" Disabled="@_addingCpu">@L["Delete"]</Button>
<Button Clicked="() => {ShowCpuDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingCpu">@L["Delete"]</Button>
</td>
</tr>
}
@@ -350,61 +348,61 @@
<hr />
<h3>@L["Memory belonging to this machine"]</h3>
<Button Color="Color.Success" Clicked="OnAddMemoryClick" Disabled="_addingMemory">@L["Add new (memory by machine)"]</Button>
@if (_addingMemory)
<Button Clicked="OnAddMemoryClick" Color="Color.Success" Disabled="_addingMemory">@L["Add new (memory by machine)"]</Button>
@if(_addingMemory)
{
<div>
<Field>
<FieldLabel>@L["Memory type"]</FieldLabel>
<Select TValue="int" @bind-SelectedValue="@_addingMemoryType">
@foreach (int type in Enum.GetValues(typeof(MemoryType)))
<Select @bind-SelectedValue="@_addingMemoryType" @TValue="int">
@foreach(int type in Enum.GetValues(typeof(MemoryType)))
{
<SelectItem TValue="int" Value="@type">@(((MemoryType)type).ToString())</SelectItem>
}
<SelectItem @TValue="int" Value="@type">@(((MemoryType)type).ToString())</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Memory usage"]</FieldLabel>
<Select TValue="int" @bind-SelectedValue="@_addingMemoryUsage">
@foreach (int usage in Enum.GetValues(typeof(MemoryUsage)))
<Select @bind-SelectedValue="@_addingMemoryUsage" @TValue="int">
@foreach(int usage in Enum.GetValues(typeof(MemoryUsage)))
{
<SelectItem TValue="int" Value="@usage">@(((MemoryUsage)usage).ToString())</SelectItem>
}
<SelectItem @TValue="int" Value="@usage">@(((MemoryUsage)usage).ToString())</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Nominal speed (Hz)"]</FieldLabel>
<Check TValue="bool" @bind-Checked="@_unknownMemorySpeed">@L["Unknown (memory by machine speed)"]</Check>
@if (!_unknownMemorySpeed)
<Check @bind-Checked="@_unknownMemorySpeed" @TValue="bool">@L["Unknown (memory by machine speed)"]</Check>
@if(!_unknownMemorySpeed)
{
<Validation Validator="@ValidateMemorySpeed">
<NumericEdit TValue="double?" Decimals="3" @bind-Value="@_addingMemorySpeed" >
<NumericEdit @bind-Value="@_addingMemorySpeed" Decimals="3" @TValue="double?">
<Feedback>
<ValidationError>@L["Please enter a valid speed for this memory."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
<Field>
<FieldLabel>@L["Memory size (bytes)"]</FieldLabel>
<Check TValue="bool" @bind-Checked="@_unknownMemorySize">@L["Unknown (memory by machine size)"]</Check>
@if (!_unknownMemorySize)
<Check @bind-Checked="@_unknownMemorySize" @TValue="bool">@L["Unknown (memory by machine size)"]</Check>
@if(!_unknownMemorySize)
{
<Validation Validator="@ValidateMemorySize">
<NumericEdit TValue="long?" Decimals="0" @bind-Value="@_addingMemorySize" >
<NumericEdit @bind-Value="@_addingMemorySize" Decimals="0" @TValue="long?">
<Feedback>
<ValidationError>@L["Please enter a valid size for this memory."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
<Button Color="Color.Primary" Clicked="@CancelAddMemory" Disabled="@_savingMemory">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@ConfirmAddMemory" Disabled="@_savingMemory">@L["Add"]</Button>
<Button Clicked="@CancelAddMemory" Color="Color.Primary" Disabled="@_savingMemory">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddMemory" Color="Color.Success" Disabled="@_savingMemory">@L["Add"]</Button>
</div>
}
@if (_machineMemories?.Count > 0)
@if(_machineMemories?.Count > 0)
{
<div>
<table class="table table-striped">
@@ -426,7 +424,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _machineMemories)
@foreach(var item in _machineMemories)
{
<tr>
<td>
@@ -436,7 +434,7 @@
@item.Usage
</td>
<td>
@if (item.Size.HasValue)
@if(item.Size.HasValue)
{
@string.Format(L["{0} bytes"], item.Size)
}
@@ -446,7 +444,7 @@
}
</td>
<td>
@if (item.Speed.HasValue)
@if(item.Speed.HasValue)
{
@string.Format(L["{0:F3} Hz"], item.Speed)
}
@@ -456,7 +454,7 @@
}
</td>
<td>
<Button Color="Color.Danger" Clicked="() => {ShowMemoryDeleteModal(item.Id);}" Disabled="@_addingMemory">@L["Delete"]</Button>
<Button Clicked="() => {ShowMemoryDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingMemory">@L["Delete"]</Button>
</td>
</tr>
}
@@ -467,47 +465,47 @@
<hr />
<h3>@L["Storage belonging to this machine"]</h3>
<Button Color="Color.Success" Clicked="OnAddStorageClick" Disabled="_addingStorage">@L["Add new (storage by machine)"]</Button>
@if (_addingStorage)
<Button Clicked="OnAddStorageClick" Color="Color.Success" Disabled="_addingStorage">@L["Add new (storage by machine)"]</Button>
@if(_addingStorage)
{
<div>
<Field>
<FieldLabel>@L["Storage type"]</FieldLabel>
<Select TValue="int" @bind-SelectedValue="@_addingStorageType">
@foreach (int type in Enum.GetValues(typeof(StorageType)))
<Select @bind-SelectedValue="@_addingStorageType" @TValue="int">
@foreach(int type in Enum.GetValues(typeof(StorageType)))
{
<SelectItem TValue="int" Value="@type">@(((StorageType)type).ToString())</SelectItem>
}
<SelectItem @TValue="int" Value="@type">@(((StorageType)type).ToString())</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Storage interface"]</FieldLabel>
<Select TValue="int" @bind-SelectedValue="@_addingStorageInterface">
@foreach (int usage in Enum.GetValues(typeof(StorageInterface)))
<Select @bind-SelectedValue="@_addingStorageInterface" @TValue="int">
@foreach(int usage in Enum.GetValues(typeof(StorageInterface)))
{
<SelectItem TValue="int" Value="@usage">@(((StorageInterface)usage).ToString())</SelectItem>
}
<SelectItem @TValue="int" Value="@usage">@(((StorageInterface)usage).ToString())</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Nominal capacity (bytes)"]</FieldLabel>
<Check TValue="bool" @bind-Checked="@_unknownStorageSize">@L["Unknown or empty (storage by machine nominal capacity)"]</Check>
@if (!_unknownStorageSize)
<Check @bind-Checked="@_unknownStorageSize" @TValue="bool">@L["Unknown or empty (storage by machine nominal capacity)"]</Check>
@if(!_unknownStorageSize)
{
<Validation Validator="@ValidateStorageSize">
<NumericEdit TValue="long?" Decimals="0" @bind-Value="@_addingStorageSize" >
<NumericEdit @bind-Value="@_addingStorageSize" Decimals="0" @TValue="long?">
<Feedback>
<ValidationError>@L["Please enter a valid size for this storage."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
<Button Color="Color.Primary" Clicked="@CancelAddStorage" Disabled="@_savingStorage">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@ConfirmAddStorage" Disabled="@_savingStorage">@L["Add"]</Button>
<Button Clicked="@CancelAddStorage" Color="Color.Primary" Disabled="@_savingStorage">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddStorage" Color="Color.Success" Disabled="@_savingStorage">@L["Add"]</Button>
</div>
}
@if (_machineStorage?.Count > 0)
@if(_machineStorage?.Count > 0)
{
<div>
<table class="table table-striped">
@@ -526,7 +524,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _machineStorage)
@foreach(var item in _machineStorage)
{
<tr>
<td>
@@ -536,7 +534,7 @@
@item.Interface
</td>
<td>
@if (item.Capacity.HasValue)
@if(item.Capacity.HasValue)
{
@string.Format(L["{0} bytes"], item.Capacity)
}
@@ -546,7 +544,7 @@
}
</td>
<td>
<Button Color="Color.Danger" Clicked="() => {ShowStorageDeleteModal(item.Id);}" Disabled="@_addingStorage">@L["Delete"]</Button>
<Button Clicked="() => {ShowStorageDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingStorage">@L["Delete"]</Button>
</td>
</tr>
}
@@ -557,27 +555,27 @@
<hr />
<h3>@L["Screens attached to this machine"]</h3>
<Button Color="Color.Success" Clicked="OnAddScreenClick" Disabled="_addingScreen">@L["Add new (screen by machine)"]</Button>
@if (_addingScreen)
<Button Clicked="OnAddScreenClick" Color="Color.Success" Disabled="_addingScreen">@L["Add new (screen by machine)"]</Button>
@if(_addingScreen)
{
<div>
<Field>
<FieldLabel>@L["Screens"]</FieldLabel>
<Select Disabled="_savingScreen" TValue="int?" @bind-SelectedValue="@_addingScreenId">
@foreach (var screen in _screens)
<Select @bind-SelectedValue="@_addingScreenId" Disabled="_savingScreen" @TValue="int?">
@foreach(var screen in _screens)
{
if (_machineScreens.All(s => s.ScreenId != screen.Id))
if(_machineScreens.All(s => s.ScreenId != screen.Id))
{
<SelectItem TValue="int?" Value="@screen.Id">@string.Format(L["{0}\" with a native resolution of {1}"],screen.Diagonal, screen.NativeResolution)</SelectItem>
}
<SelectItem @TValue="int?" Value="@screen.Id">@string.Format(L["{0}\" with a native resolution of {1}"], screen.Diagonal, screen.NativeResolution)</SelectItem>
}
}
</Select>
<Button Color="Color.Primary" Clicked="@CancelAddScreen" Disabled="@_savingScreen">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@ConfirmAddScreen" Disabled="@_savingScreen">@L["Add"]</Button>
<Button Clicked="@CancelAddScreen" Color="Color.Primary" Disabled="@_savingScreen">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddScreen" Color="Color.Success" Disabled="@_savingScreen">@L["Add"]</Button>
</Field>
</div>
}
@if (_machineScreens?.Count > 0)
@if(_machineScreens?.Count > 0)
{
<div>
<table class="table table-striped">
@@ -605,7 +603,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _machineScreens)
@foreach(var item in _machineScreens)
{
<tr>
<td>
@@ -627,7 +625,7 @@
@item.Screen.NativeResolution
</td>
<td>
<Button Color="Color.Danger" Clicked="() => {ShowScreenDeleteModal(item.Id);}" Disabled="@_addingScreen">@L["Delete"]</Button>
<Button Clicked="() => {ShowScreenDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingScreen">@L["Delete"]</Button>
</td>
</tr>
}
@@ -636,7 +634,7 @@
</div>
}
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
@@ -647,27 +645,28 @@
<Text>@_deleteText</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>
@if(_photos.Count > 0)
{
foreach (var photo in _photos)
foreach(var photo in _photos)
{
<div class="col-md-2">
<figure class="figure">
<picture>
<source type="image/avif" srcset="/assets/photos/machines/thumbs/avif/hd/@(photo).avif, /assets/photos/machines/thumbs/avif/1440p/@(photo).avif 2x, /assets/photos/machines/thumbs/avif/4k/@(photo).avif 3x">
<source type="image/heic" srcset="/assets/photos/machines/thumbs/heif/hd/@(photo).heic, /assets/photos/machines/thumbs/heif/1440p/@(photo).heic 2x, /assets/photos/machines/thumbs/heif/4k/@(photo).heic 3x">
<source type="image/webp" srcset="/assets/photos/machines/thumbs/webp/hd/@(photo).webp, /assets/photos/machines/thumbs/webp/1440p/@(photo).webp 2x, /assets/photos/machines/thumbs/webp/4k/@(photo).webp 3x">
<source type="image/jp2" srcset="/assets/photos/machines/thumbs/jp2k/hd/@(photo).jp2, /assets/photos/machines/thumbs/jp2k/1440p/@(photo).jp2 2x, /assets/photos/machines/thumbs/jp2k/4k/@(photo).jp2 3x">
<img class="figure-img img-fluid rounded" srcset="/assets/photos/machines/thumbs/jpeg/hd/@(photo).jpg, /assets/photos/machines/thumbs/jpeg/1440p/@(photo).jpg 2x, /assets/photos/machines/thumbs/jpeg/4k/@(photo).jpg 3x" src="/assets/photos/machines/thumbs/jpeg/hd/@(photo).jpg" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
<source srcset="/assets/photos/machines/thumbs/avif/hd/@(photo).avif, /assets/photos/machines/thumbs/avif/1440p/@(photo).avif 2x, /assets/photos/machines/thumbs/avif/4k/@(photo).avif 3x" type="image/avif">
<source srcset="/assets/photos/machines/thumbs/heif/hd/@(photo).heic, /assets/photos/machines/thumbs/heif/1440p/@(photo).heic 2x, /assets/photos/machines/thumbs/heif/4k/@(photo).heic 3x" type="image/heic">
<source srcset="/assets/photos/machines/thumbs/webp/hd/@(photo).webp, /assets/photos/machines/thumbs/webp/1440p/@(photo).webp 2x, /assets/photos/machines/thumbs/webp/4k/@(photo).webp 3x" type="image/webp">
<source srcset="/assets/photos/machines/thumbs/jp2k/hd/@(photo).jp2, /assets/photos/machines/thumbs/jp2k/1440p/@(photo).jp2 2x, /assets/photos/machines/thumbs/jp2k/4k/@(photo).jp2 3x" type="image/jp2">
<img alt="" class="figure-img img-fluid rounded" height="auto" src="/assets/photos/machines/thumbs/jpeg/hd/@(photo).jpg" srcset="/assets/photos/machines/thumbs/jpeg/hd/@(photo).jpg, /assets/photos/machines/thumbs/jpeg/1440p/@(photo).jpg 2x, /assets/photos/machines/thumbs/jpeg/4k/@(photo).jpg 3x" style="max-height: 256px; max-width: 256px" width="auto" />
</picture>
<figcaption class="figure-caption">
<a href="/admin/machines/photo/details/@photo" target="_blank">@L["Details"]</a></figcaption>
<a href="/admin/machines/photo/details/@photo" target="_blank">@L["Details"]</a>
</figcaption>
</figure>
</div>
}

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -33,53 +33,51 @@
@inject IStringLocalizer<MachineFamiliesService> L
@inject CompaniesService CompaniesService
@inject NavigationManager NavigationManager
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Machine family details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Company"]</FieldLabel>
<Select Disabled="!_editing" TValue="int" @bind-SelectedValue="@_model.CompanyId">
@foreach (var company in _companies)
<Select @bind-SelectedValue="@_model.CompanyId" Disabled="!_editing" @TValue="int">
@foreach(var company in _companies)
{
<SelectItem TValue="int" Value="@company.Id">@company.Name</SelectItem>
}
<SelectItem @TValue="int" Value="@company.Id">@company.Name</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Name"]</FieldLabel>
<Validation Validator="@ValidateName">
<TextEdit Disabled="!_editing" @bind-Text="@_model.Name">
<TextEdit @bind-Text="@_model.Name" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid name."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
@if (_editing)
@if(_editing)
{
<FieldHelp>@L["Must not contain \"family\" or \"series\". Different regional names should be separated with /. Different numbers should be separated with comma."]</FieldHelp>
}
}
</Field>
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/machine_families" class="btn btn-secondary">@L["Back to list"]</a>
<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/machine_families">@L["Back to list"]</a>
</div>

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -28,7 +28,6 @@
@page "/admin/magazines/details/{Id:long}"
@page "/admin/magazines/edit/{Id:long}"
@page "/admin/magazines/create"
@using Marechai.Database
@using Marechai.Database.Models
@inherits OwningComponentBase<MagazinesService>
@inject IStringLocalizer<MagazinesService> L
@@ -39,158 +38,155 @@
@inject NavigationManager NavigationManager
@inject IWebHostEnvironment Host
@inject IJSRuntime JSRuntime
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Magazine details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Title using latin script"]</FieldLabel>
<Validation Validator="@ValidateTitle">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Title">
<TextEdit @bind-Text="@_model.Title" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid title."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
</Field>
@if (_editing || _model.NativeTitle != null)
@if(_editing || _model.NativeTitle != null)
{
<Field>
<FieldLabel>@L["Native title, that is, title using native script (cyrillic, chinese, etc)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownNativeTitle">@L["Unknown (native title)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownNativeTitle" @TValue="bool">@L["Unknown (native title)"]</Check>
}
@if(!_editing ||
!_unknownNativeTitle)
{
<Validation Validator="@ValidateNativeTitle">
<TextEdit Disabled="!_editing" @bind-Text="@_model.NativeTitle">
<TextEdit @bind-Text="@_model.NativeTitle" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid native title."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.FirstPublication != null)
}
@if(_editing || _model.FirstPublication != null)
{
<Field>
<FieldLabel>@L["First publication"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownFirstPublication">@L["Unknown (first publication date)"]</Check>
}
@if (!_editing || !_unknownFirstPublication)
<Check @bind-Checked="@_unknownFirstPublication" @TValue="bool">@L["Unknown (first publication date)"]</Check>
}
@if(!_editing ||
!_unknownFirstPublication)
{
<Validation Validator="@ValidateFirstPublication">
<DateEdit TValue="DateTime?" ReadOnly="!_editing" @bind-Date="@_model.FirstPublication" >
<DateEdit @bind-Date="@_model.FirstPublication" ReadOnly="!_editing" @TValue="DateTime?">
<Feedback>
<ValidationError>@L["Please enter a valid first publication date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.CountryId != null)
}
@if(_editing || _model.CountryId != null)
{
<Field>
<FieldLabel>@L["Country of publication"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownCountry">@L["Unknown (country of publication)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownCountry" @TValue="bool">@L["Unknown (country of publication)"]</Check>
}
@if(!_editing ||
!_unknownCountry)
{
<Select Disabled="!_editing" TValue="short?" @bind-SelectedValue="@_model.CountryId">
@foreach (var country in _countries)
<Select @bind-SelectedValue="@_model.CountryId" Disabled="!_editing" @TValue="short?">
@foreach(var country in _countries)
{
<SelectItem TValue="short?" Value="@country.Id">@country.Name</SelectItem>
}
<SelectItem @TValue="short?" Value="@country.Id">@country.Name</SelectItem>
}
</Select>
}
}
</Field>
}
@if (_editing || _model.Issn != null)
}
@if(_editing || _model.Issn != null)
{
<Field>
<FieldLabel>@L["ISSN"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownIssn">@L["Unknown (ISSN)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownIssn" @TValue="bool">@L["Unknown (ISSN)"]</Check>
}
@if(!_editing ||
!_unknownIssn)
{
<Validation Validator="@ValidateIssn">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Issn">
<TextEdit @bind-Text="@_model.Issn" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid ISSN."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
}
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/magazines" class="btn btn-secondary">@L["Back to list"]</a>
<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/magazines">@L["Back to list"]</a>
</div>
@if (!_editing)
@if(!_editing)
{
<hr />
<h3>@L["Companies involved in this magazine"]</h3>
<Button Color="Color.Success" Clicked="OnAddCompanyClick" Disabled="_addingCompany">@L["Add new (company)"]</Button>
@if (_addingCompany)
<Button Clicked="OnAddCompanyClick" Color="Color.Success" Disabled="_addingCompany">@L["Add new (company)"]</Button>
@if(_addingCompany)
{
<div>
<Field>
<FieldLabel>@L["Company"]</FieldLabel>
<Select Disabled="_savingCompany" TValue="int?" @bind-SelectedValue="@_addingCompanyId">
@foreach (var company in _companies)
<Select @bind-SelectedValue="@_addingCompanyId" Disabled="_savingCompany" @TValue="int?">
@foreach(var company in _companies)
{
<SelectItem TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
<SelectItem @TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Role"]</FieldLabel>
<Select Disabled="!_editing" TValue="string" @bind-SelectedValue="@_addingCompanyRoleId">
@foreach (var role in _roles)
<Select @bind-SelectedValue="@_addingCompanyRoleId" Disabled="!_editing" @TValue="string">
@foreach(var role in _roles)
{
<SelectItem TValue="string" Value="@role.Id">@role.Name</SelectItem>
}
<SelectItem @TValue="string" Value="@role.Id">@role.Name</SelectItem>
}
</Select>
</Field>
<Button Color="Color.Primary" Clicked="@CancelAddCompany" Disabled="@_savingCompany">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@ConfirmAddCompany" Disabled="@_savingCompany">@L["Add"]</Button>
<Button Clicked="@CancelAddCompany" Color="Color.Primary" Disabled="@_savingCompany">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddCompany" Color="Color.Success" Disabled="@_savingCompany">@L["Add"]</Button>
</div>
}
@if (_magazineCompanies?.Count > 0)
@if(_magazineCompanies?.Count > 0)
{
<div>
<table class="table table-striped">
@@ -206,7 +202,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _magazineCompanies)
@foreach(var item in _magazineCompanies)
{
<tr>
<td>
@@ -216,7 +212,7 @@
@item.Role
</td>
<td>
<Button Color="Color.Danger" Clicked="() => {ShowCompanyDeleteModal(item.Id);}" Disabled="@_addingCompany">@L["Delete"]</Button>
<Button Clicked="() => {ShowCompanyDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingCompany">@L["Delete"]</Button>
</td>
</tr>
}
@@ -225,7 +221,7 @@
</div>
}
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
@@ -236,9 +232,8 @@
<Text>@_deleteText</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>
}
</Modal>}

File diff suppressed because it is too large Load Diff

View File

@@ -743,7 +743,7 @@ namespace Marechai.Pages.Admin.Details
{
await outFs.WriteAsync(buffer, 0, count);
double progress = ((double)fs.Position * 100) / fs.Length;
double progress = (double)fs.Position * 100 / fs.Length;
if(!(progress > lastProgress + 0.01))
continue;

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -33,227 +33,226 @@
@inject IStringLocalizer<PeopleService> L
@inject Iso31661NumericService CountriesService
@inject NavigationManager NavigationManager
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Person details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
@if (_editing || _model.Name != null)
@if(_editing || _model.Name != null)
{
<Field>
<FieldLabel>@L["Name"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownName">@L["Unknown (name)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownName" @TValue="bool">@L["Unknown (name)"]</Check>
}
@if(!_editing ||
!_unknownName)
{
<Validation Validator="@ValidateName">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Name">
<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)
}
@if(_editing || _model.Surname != null)
{
<Field>
<FieldLabel>@L["Surname"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownSurname">@L["Unknown (surname)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownSurname" @TValue="bool">@L["Unknown (surname)"]</Check>
}
@if(!_editing ||
!_unknownSurname)
{
<Validation Validator="@ValidateSurname">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Surname">
<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)
}
@if(_editing || _model.Alias != null)
{
<Field>
<FieldLabel>@L["Alias"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownAlias">@L["Unknown (alias)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownAlias" @TValue="bool">@L["Unknown (alias)"]</Check>
}
@if(!_editing ||
!_unknownAlias)
{
<Validation Validator="@ValidateAlias">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Alias">
<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)
}
@if(_editing || _model.DisplayName != null)
{
<Field>
<FieldLabel>@L["Display name"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownDisplayName">@L["Unknown (display name)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownDisplayName" @TValue="bool">@L["Unknown (display name)"]</Check>
}
@if(!_editing ||
!_unknownDisplayName)
{
<Validation Validator="@ValidateDisplayName">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.DisplayName">
<TextEdit @bind-Text="@_model.DisplayName" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid display name."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.CountryOfBirthId != null)
}
@if(_editing || _model.CountryOfBirthId != null)
{
<Field>
<FieldLabel>@L["Country of birth"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownCountry">@L["Unknown (country of birth)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownCountry" @TValue="bool">@L["Unknown (country of birth)"]</Check>
}
@if(!_editing ||
!_unknownCountry)
{
<Select Disabled="!_editing" TValue="short?" @bind-SelectedValue="@_model.CountryOfBirthId">
@foreach (var country in _countries)
<Select @bind-SelectedValue="@_model.CountryOfBirthId" Disabled="!_editing" @TValue="short?">
@foreach(var country in _countries)
{
<SelectItem TValue="short?" Value="@country.Id">@country.Name</SelectItem>
}
<SelectItem @TValue="short?" Value="@country.Id">@country.Name</SelectItem>
}
</Select>
}
}
</Field>
}
}
<Field>
<FieldLabel>@L["Birth date"]</FieldLabel>
<Validation Validator="@ValidateBirthDate">
<DateEdit TValue="DateTime" ReadOnly="!_editing" @bind-Date="@_model.BirthDate" >
<DateEdit @bind-Date="@_model.BirthDate" ReadOnly="!_editing" @TValue="DateTime">
<Feedback>
<ValidationError>@L["Please enter a valid birth date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
</Field>
@if (_editing || _model.DeathDate != null)
@if(_editing || _model.DeathDate != null)
{
<Field>
<FieldLabel>@L["Date of death"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownDeathDate">@L["Unknown (death date)"]</Check>
}
@if (!_editing || !_unknownDeathDate)
<Check @bind-Checked="@_unknownDeathDate" @TValue="bool">@L["Unknown (death date)"]</Check>
}
@if(!_editing ||
!_unknownDeathDate)
{
<Validation Validator="@ValidateDeathDate">
<DateEdit TValue="DateTime?" ReadOnly="!_editing" @bind-Date="@_model.DeathDate" >
<DateEdit @bind-Date="@_model.DeathDate" ReadOnly="!_editing" @TValue="DateTime?">
<Feedback>
<ValidationError>@L["Please enter a valid death date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Webpage != null)
}
@if(_editing || _model.Webpage != null)
{
<Field>
<FieldLabel>@L["Webpage"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownWebpage">@L["Unknown (webpage)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownWebpage" @TValue="bool">@L["Unknown (webpage)"]</Check>
}
@if(!_editing ||
!_unknownWebpage)
{
<Validation Validator="@ValidateWebpage">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Webpage">
<TextEdit @bind-Text="@_model.Webpage" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid webpage."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Twitter != null)
}
@if(_editing || _model.Twitter != null)
{
<Field>
<FieldLabel>@L["Twitter"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownTwitter">@L["Unknown (twitter)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownTwitter" @TValue="bool">@L["Unknown (twitter)"]</Check>
}
@if(!_editing ||
!_unknownTwitter)
{
<Validation Validator="@ValidateTwitter">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Twitter">
<TextEdit @bind-Text="@_model.Twitter" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid Twitter handle."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Facebook != null)
}
@if(_editing || _model.Facebook != null)
{
<Field>
<FieldLabel>@L["Facebook"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownFacebook">@L["Unknown (facebook)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownFacebook" @TValue="bool">@L["Unknown (facebook)"]</Check>
}
@if(!_editing ||
!_unknownFacebook)
{
<Validation Validator="@ValidateFacebook">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Facebook">
<TextEdit @bind-Text="@_model.Facebook" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid Facebook user name."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
}
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/people" class="btn btn-secondary">@L["Back to list"]</a>
<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/people">@L["Back to list"]</a>
</div>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -36,579 +36,553 @@
@inject NavigationManager NavigationManager
@inject InstructionSetExtensionsByProcessorService InstructionSetExtensionsByProcessorService
@inject InstructionSetExtensionsService InstructionSetExtensionsService
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Processor details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
@if (_editing || _model.CompanyId != null)
{
@if(_editing || _model.CompanyId != null)
{
<Field>
<FieldLabel>@L["Company"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownCompany">@L["Unknown (company)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownCompany" @TValue="bool">@L["Unknown (company)"]</Check>
}
@if(!_editing ||
!_unknownCompany)
{
<Select Disabled="!_editing" TValue="int?" @bind-SelectedValue="@_model.CompanyId">
@foreach (var company in _companies)
<Select @bind-SelectedValue="@_model.CompanyId" Disabled="!_editing" @TValue="int?">
@foreach(var company in _companies)
{
<SelectItem TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
<SelectItem @TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
</Select>
}
</Field>
}
<Field>
}
</Field>}
<Field>
<FieldLabel>@L["Name"]</FieldLabel>
<Validation Validator="@ValidateName">
<TextEdit Disabled="!_editing" @bind-Text="@_model.Name">
<TextEdit @bind-Text="@_model.Name" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid name."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
</Field>
@if (_editing || _model.ModelCode != null)
{
</Field>
@if(_editing || _model.ModelCode != null)
{
<Field>
<FieldLabel>@L["Model code"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownModelCode">@L["Unknown (model code)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownModelCode" @TValue="bool">@L["Unknown (model code)"]</Check>
}
@if(!_editing ||
!_unknownModelCode)
{
<Validation Validator="@ValidateModelCode">
<TextEdit Disabled="!_editing" @bind-Text="@_model.ModelCode">
<TextEdit @bind-Text="@_model.ModelCode" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid model code."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.Introduced.HasValue)
{
}
</Field>}
@if(_editing || _model.Introduced.HasValue)
{
<Field>
<FieldLabel>@L["Introduced"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" Disabled="_prototype" @bind-Checked="@_unknownIntroduced">@L["Unknown (introduction date)"]</Check>
<Check TValue="bool" Disabled="_unknownIntroduced" @bind-Checked="@_prototype">@L["Prototype"]</Check>
}
@if (!_editing ||
(!_prototype && !_unknownIntroduced))
<Check @bind-Checked="@_unknownIntroduced" Disabled="_prototype" @TValue="bool">@L["Unknown (introduction date)"]</Check>
<Check @bind-Checked="@_prototype" Disabled="_unknownIntroduced" @TValue="bool">@L["Prototype"]</Check>
}
@if(!_editing ||
!_prototype && !_unknownIntroduced)
{
<Validation Validator="@ValidateIntroduced">
<DateEdit Disabled="!_editing" TValue="DateTime?" @bind-Date="@_model.Introduced">
<DateEdit @bind-Date="@_model.Introduced" Disabled="!_editing" @TValue="DateTime?">
<Feedback>
<ValidationError>@L["Please enter an introduction date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.InstructionSetId != null)
{
}
</Field>}
@if(_editing || _model.InstructionSetId != null)
{
<Field>
<FieldLabel>@L["Instruction set"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownInstructionSet">@L["Unknown (instruction set)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownInstructionSet" @TValue="bool">@L["Unknown (instruction set)"]</Check>
}
@if(!_editing ||
!_unknownInstructionSet)
{
<Select Disabled="!_editing" TValue="int?" @bind-SelectedValue="@_model.InstructionSetId">
@foreach (var instructionSet in _instructionSets)
<Select @bind-SelectedValue="@_model.InstructionSetId" Disabled="!_editing" @TValue="int?">
@foreach(var instructionSet in _instructionSets)
{
<SelectItem TValue="int?" Value="@instructionSet.Id">@instructionSet.Name</SelectItem>
}
<SelectItem @TValue="int?" Value="@instructionSet.Id">@instructionSet.Name</SelectItem>
}
</Select>
}
</Field>
}
@if (_editing || _model.Speed.HasValue)
{
}
</Field>}
@if(_editing || _model.Speed.HasValue)
{
<Field>
<FieldLabel>@L["Nominal speed (MHz)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownSpeed">@L["Unknown (nominal speed)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownSpeed" @TValue="bool">@L["Unknown (nominal speed)"]</Check>
}
@if(!_editing ||
!_unknownSpeed)
{
<Validation Validator="@ValidateDoubleBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="double?" Decimals="3" @bind-Value="@_model.Speed">
<NumericEdit @bind-Value="@_model.Speed" Decimals="3" Disabled="!_editing" @TValue="double?">
<Feedback>
<ValidationError>@L["Please enter a valid nominal speed."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.Package != null)
{
}
</Field>}
@if(_editing || _model.Package != null)
{
<Field>
<FieldLabel>@L["Package"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownPackage">@L["Unknown (package)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownPackage" @TValue="bool">@L["Unknown (package)"]</Check>
}
@if(!_editing ||
!_unknownPackage)
{
<Validation Validator="@ValidatePackage">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Package">
<TextEdit @bind-Text="@_model.Package" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid package."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.Gprs.HasValue)
{
}
</Field>}
@if(_editing || _model.Gprs.HasValue)
{
<Field>
<FieldLabel>@L["General Purpose Registers"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownGprs">@L["Unknown (general purpose registers)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownGprs" @TValue="bool">@L["Unknown (general purpose registers)"]</Check>
}
@if(!_editing ||
!_unknownGprs)
{
<Validation Validator="@ValidateIntegerBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.Gprs">
<NumericEdit @bind-Value="@_model.Gprs" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid number of general purpose registers."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.GprSize.HasValue)
{
}
</Field>}
@if(_editing || _model.GprSize.HasValue)
{
<Field>
<FieldLabel>@L["General Purpose Register size"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownGprSize">@L["Unknown (general purpose register size)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownGprSize" @TValue="bool">@L["Unknown (general purpose register size)"]</Check>
}
@if(!_editing ||
!_unknownGprSize)
{
<Validation Validator="@ValidateIntegerBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.GprSize">
<NumericEdit @bind-Value="@_model.GprSize" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid general purpose register size."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.Fprs.HasValue)
{
}
</Field>}
@if(_editing || _model.Fprs.HasValue)
{
<Field>
<FieldLabel>@L["Floating Point Registers"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownFprs">@L["Unknown (floating point registers)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownFprs" @TValue="bool">@L["Unknown (floating point registers)"]</Check>
}
@if(!_editing ||
!_unknownFprs)
{
<Validation Validator="@ValidateIntegerBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.Fprs">
<NumericEdit @bind-Value="@_model.Fprs" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid number of floating point registers."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
@if (_editing)
}
@if(_editing)
{
<FieldHelp>@L["If set to zero, but with a size, indicates floating point instructions use the general purpose registers."]</FieldHelp>
}
</Field>
}
@if (_editing || _model.FprSize.HasValue)
{
}
</Field>}
@if(_editing || _model.FprSize.HasValue)
{
<Field>
<FieldLabel>@L["Floating Point Register size"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownFprSize">@L["Unknown (floating point register size)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownFprSize" @TValue="bool">@L["Unknown (floating point register size)"]</Check>
}
@if(!_editing ||
!_unknownFprSize)
{
<Validation Validator="@ValidateIntegerBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.FprSize">
<NumericEdit @bind-Value="@_model.FprSize" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid floating point register size."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.SimdRegisters.HasValue)
{
}
</Field>}
@if(_editing || _model.SimdRegisters.HasValue)
{
<Field>
<FieldLabel>@L["SIMD Registers"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownSimdRegisters">@L["Unknown (simd registers)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownSimdRegisters" @TValue="bool">@L["Unknown (simd registers)"]</Check>
}
@if(!_editing ||
!_unknownSimdRegisters)
{
<Validation Validator="@ValidateIntegerBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.SimdRegisters">
<NumericEdit @bind-Value="@_model.SimdRegisters" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid number of SIMD registers."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
@if (_editing)
}
@if(_editing)
{
<FieldHelp>@L["If set to zero, but with a size, indicates SIMD instructions use the floating point registers. If they are also set to zero with a size, it means SIMD instructions use the general purpose registers."]</FieldHelp>
}
</Field>
}
@if (_editing || _model.SimdSize.HasValue)
{
}
</Field>}
@if(_editing || _model.SimdSize.HasValue)
{
<Field>
<FieldLabel>@L["SIMD Register size"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownSimdSize">@L["Unknown (simd register size)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownSimdSize" @TValue="bool">@L["Unknown (simd register size)"]</Check>
}
@if(!_editing ||
!_unknownSimdSize)
{
<Validation Validator="@ValidateIntegerBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.SimdSize">
<NumericEdit @bind-Value="@_model.SimdSize" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid SIMD register size."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.Cores.HasValue)
{
}
</Field>}
@if(_editing || _model.Cores.HasValue)
{
<Field>
<FieldLabel>@L["Cores"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownCores">@L["Unknown (cores)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownCores" @TValue="bool">@L["Unknown (cores)"]</Check>
}
@if(!_editing ||
!_unknownCores)
{
<Validation Validator="@ValidateIntegerBiggerThanOne">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.Cores">
<NumericEdit @bind-Value="@_model.Cores" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid number of cores."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.ThreadsPerCore.HasValue)
{
}
</Field>}
@if(_editing || _model.ThreadsPerCore.HasValue)
{
<Field>
<FieldLabel>@L["Threads per core"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownThreadsPerCore">@L["Unknown (threads per core)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownThreadsPerCore" @TValue="bool">@L["Unknown (threads per core)"]</Check>
}
@if(!_editing ||
!_unknownThreadsPerCore)
{
<Validation Validator="@ValidateIntegerBiggerThanOne">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.ThreadsPerCore">
<NumericEdit @bind-Value="@_model.ThreadsPerCore" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid number of threads per core."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.Process != null)
{
}
</Field>}
@if(_editing || _model.Process != null)
{
<Field>
<FieldLabel>@L["Process"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownProcess">@L["Unknown (process)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownProcess" @TValue="bool">@L["Unknown (process)"]</Check>
}
@if(!_editing ||
!_unknownProcess)
{
<Validation Validator="@ValidateProcess">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Process">
<TextEdit @bind-Text="@_model.Process" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid process."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.ProcessNm.HasValue)
{
}
</Field>}
@if(_editing || _model.ProcessNm.HasValue)
{
<Field>
<FieldLabel>@L["Process (nm)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownProcessNm">@L["Unknown (process size)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownProcessNm" @TValue="bool">@L["Unknown (process size)"]</Check>
}
@if(!_editing ||
!_unknownProcessNm)
{
<Validation Validator="@ValidateFloatBiggerThanOne">
<NumericEdit Disabled="!_editing" TValue="float?" Decimals="2" @bind-Value="@_model.ProcessNm">
<NumericEdit @bind-Value="@_model.ProcessNm" Decimals="2" Disabled="!_editing" @TValue="float?">
<Feedback>
<ValidationError>@L["Please enter a valid process size in nanometers."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.DieSize.HasValue)
{
}
</Field>}
@if(_editing || _model.DieSize.HasValue)
{
<Field>
<FieldLabel>@L["Die size (mm²)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownDieSize">@L["Unknown (die size)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownDieSize" @TValue="bool">@L["Unknown (die size)"]</Check>
}
@if(!_editing ||
!_unknownDieSize)
{
<Validation Validator="@ValidateFloatBiggerThanOne">
<NumericEdit Disabled="!_editing" TValue="float?" Decimals="2" @bind-Value="@_model.DieSize">
<NumericEdit @bind-Value="@_model.DieSize" Decimals="2" Disabled="!_editing" @TValue="float?">
<Feedback>
<ValidationError>@L["Please enter a valid die size in square millimeters."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.Transistors.HasValue)
{
}
</Field>}
@if(_editing || _model.Transistors.HasValue)
{
<Field>
<FieldLabel>@L["Transistors"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownTransistors">@L["Unknown (transistors)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownTransistors" @TValue="bool">@L["Unknown (transistors)"]</Check>
}
@if(!_editing ||
!_unknownTransistors)
{
<Validation Validator="@ValidateLongBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="long?" Decimals="0" @bind-Value="@_model.Transistors">
<NumericEdit @bind-Value="@_model.Transistors" Decimals="0" Disabled="!_editing" @TValue="long?">
<Feedback>
<ValidationError>@L["Please enter a valid number of transistors."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.DataBus.HasValue)
{
}
</Field>}
@if(_editing || _model.DataBus.HasValue)
{
<Field>
<FieldLabel>@L["Data bus size"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownDataBus">@L["Unknown (data bus size)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownDataBus" @TValue="bool">@L["Unknown (data bus size)"]</Check>
}
@if(!_editing ||
!_unknownDataBus)
{
<Validation Validator="@ValidateIntegerBiggerThanOne">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.DataBus">
<NumericEdit @bind-Value="@_model.DataBus" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid data bus size in bits."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.AddrBus.HasValue)
{
}
</Field>}
@if(_editing || _model.AddrBus.HasValue)
{
<Field>
<FieldLabel>@L["Address bus size"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownAddressBus">@L["Unknown (address bus size)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownAddressBus" @TValue="bool">@L["Unknown (address bus size)"]</Check>
}
@if(!_editing ||
!_unknownAddressBus)
{
<Validation Validator="@ValidateIntegerBiggerThanOne">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.AddrBus">
<NumericEdit @bind-Value="@_model.AddrBus" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid address bus size in bits."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.L1Instruction.HasValue)
{
}
</Field>}
@if(_editing || _model.L1Instruction.HasValue)
{
<Field>
<FieldLabel>@L["L1 instruction cache (KiB)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownL1Instruction">@L["Unknown (L1 instruction cache)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownL1Instruction" @TValue="bool">@L["Unknown (L1 instruction cache)"]</Check>
}
@if(!_editing ||
!_unknownL1Instruction)
{
<Validation Validator="@ValidateFloatBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="float?" Decimals="3" @bind-Value="@_model.L1Instruction">
<NumericEdit @bind-Value="@_model.L1Instruction" Decimals="3" Disabled="!_editing" @TValue="float?">
<Feedback>
<ValidationError>@L["Please enter a valid L1 instruction cache size in kibibytes."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.L1Data.HasValue)
{
}
</Field>}
@if(_editing || _model.L1Data.HasValue)
{
<Field>
<FieldLabel>@L["L1 data cache (KiB)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownL1Data">@L["Unknown (L1 data cache)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownL1Data" @TValue="bool">@L["Unknown (L1 data cache)"]</Check>
}
@if(!_editing ||
!_unknownL1Data)
{
<Validation Validator="@ValidateFloatBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="float?" Decimals="3" @bind-Value="@_model.L1Data">
<NumericEdit @bind-Value="@_model.L1Data" Decimals="3" Disabled="!_editing" @TValue="float?">
<Feedback>
<ValidationError>@L["Please enter a valid L1 data cache size in kibibytes."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.L2.HasValue)
{
}
</Field>}
@if(_editing || _model.L2.HasValue)
{
<Field>
<FieldLabel>@L["L2 cache (KiB)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownL2">@L["Unknown (L2 cache)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownL2" @TValue="bool">@L["Unknown (L2 cache)"]</Check>
}
@if(!_editing ||
!_unknownL2)
{
<Validation Validator="@ValidateFloatBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="float?" Decimals="3" @bind-Value="@_model.L2">
<NumericEdit @bind-Value="@_model.L2" Decimals="3" Disabled="!_editing" @TValue="float?">
<Feedback>
<ValidationError>@L["Please enter a valid L2 cache size in kibibytes."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.L3.HasValue)
{
}
</Field>}
@if(_editing || _model.L3.HasValue)
{
<Field>
<FieldLabel>@L["L3 cache (KiB)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownL3">@L["Unknown (L3 cache)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownL3" @TValue="bool">@L["Unknown (L3 cache)"]</Check>
}
@if(!_editing ||
!_unknownL3)
{
<Validation Validator="@ValidateFloatBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="float?" Decimals="3" @bind-Value="@_model.L3">
<NumericEdit @bind-Value="@_model.L3" Decimals="3" Disabled="!_editing" @TValue="float?">
<Feedback>
<ValidationError>@L["Please enter a valid L3 cache size in kibibytes."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
}
</Field>}
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/processors" class="btn btn-secondary">@L["Back to list"]</a>
<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/processors">@L["Back to list"]</a>
</div>
@if (!_editing)
@if(!_editing)
{
<hr />
<h3>@L["Instruction set extensions implemented by this processor"]</h3>
<Button Color="Color.Success" Clicked="OnAddExtensionClick" Disabled="_addingExtension">@L["Add new (instruction set extension)"]</Button>
@if (_addingExtension)
<Button Clicked="OnAddExtensionClick" Color="Color.Success" Disabled="_addingExtension">@L["Add new (instruction set extension)"]</Button>
@if(_addingExtension)
{
<div>
<Field>
<FieldLabel>@L["Instruction set extensions"]</FieldLabel>
<Select Disabled="_savingExtension" TValue="int?" @bind-SelectedValue="@_addingExtensionId">
@foreach (var extension in _instructionSetExtensions)
<Select @bind-SelectedValue="@_addingExtensionId" Disabled="_savingExtension" @TValue="int?">
@foreach(var extension in _instructionSetExtensions)
{
if (_processorExtensions.All(s => s.ExtensionId != extension.Id))
if(_processorExtensions.All(s => s.ExtensionId != extension.Id))
{
<SelectItem TValue="int?" Value="@extension.Id">@extension.Extension</SelectItem>
}
<SelectItem @TValue="int?" Value="@extension.Id">@extension.Extension</SelectItem>
}
}
</Select>
<Button Color="Color.Primary" Clicked="@CancelAddExtension" Disabled="@_savingExtension">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@ConfirmAddExtension" Disabled="@_savingExtension">@L["Add"]</Button>
<Button Clicked="@CancelAddExtension" Color="Color.Primary" Disabled="@_savingExtension">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddExtension" Color="Color.Success" Disabled="@_savingExtension">@L["Add"]</Button>
</Field>
</div>
}
@if (_processorExtensions?.Count > 0)
@if(_processorExtensions?.Count > 0)
{
<div>
<table class="table table-striped">
@@ -621,14 +595,14 @@
</tr>
</thead>
<tbody>
@foreach (var item in _processorExtensions)
@foreach(var item in _processorExtensions)
{
<tr>
<td>
@item.Extension
</td>
<td>
<Button Color="Color.Danger" Clicked="() => {ShowExtensionDeleteModal(item.Id);}" Disabled="@_addingExtension">@L["Delete"]</Button>
<Button Clicked="() => {ShowExtensionDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingExtension">@L["Delete"]</Button>
</td>
</tr>
}
@@ -637,7 +611,7 @@
</div>
}
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
@@ -648,9 +622,8 @@
<Text>@_deleteText</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>
}
</Modal>}

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -32,24 +32,22 @@
@inherits OwningComponentBase<ResolutionsService>
@inject IStringLocalizer<ResolutionsService> L
@inject NavigationManager NavigationManager
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Resolution details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Width (pixels or characters)"]</FieldLabel>
<Validation Validator="@ValidateIntegerBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="int" @bind-Value="@_model.Width" >
<NumericEdit @bind-Value="@_model.Width" Disabled="!_editing" @TValue="int">
<Feedback>
<ValidationError>@L["Please enter a valid width in pixels or characters."]</ValidationError>
</Feedback>
@@ -59,71 +57,71 @@
<Field>
<FieldLabel>@L["Height (pixels or characters)"]</FieldLabel>
<Validation Validator="@ValidateIntegerBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="int" @bind-Value="@_model.Height" >
<NumericEdit @bind-Value="@_model.Height" Disabled="!_editing" @TValue="int">
<Feedback>
<ValidationError>@L["Please enter a valid height in pixels or characters."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
</Field>
@if (_editing || _model.Colors.HasValue)
@if(_editing || _model.Colors.HasValue)
{
<Field>
<FieldLabel>@L["Colors"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownColors">@L["Unknown (colors)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownColors" @TValue="bool">@L["Unknown (colors)"]</Check>
}
@if(!_editing ||
!_unknownColors)
{
<Validation Validator="@ValidateLongBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="long?" Decimals="0" @bind-Value="@_model.Colors" >
<NumericEdit @bind-Value="@_model.Colors" Decimals="0" Disabled="!_editing" @TValue="long?">
<Feedback>
<ValidationError>@L["Please enter a valid number of colors."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Palette.HasValue)
}
@if(_editing || _model.Palette.HasValue)
{
<Field>
<FieldLabel>@L["Colors in palette"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownPalette">@L["Unknown (colors in palette)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownPalette" @TValue="bool">@L["Unknown (colors in palette)"]</Check>
}
@if(!_editing ||
!_unknownPalette)
{
<Validation Validator="@ValidateLongBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="long?" Decimals="0" @bind-Value="@_model.Palette" >
<NumericEdit @bind-Value="@_model.Palette" Decimals="0" Disabled="!_editing" @TValue="long?">
<Feedback>
<ValidationError>@L["Please enter a valid number of colors in palette."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
}
}
<Field>
<Check Disabled="!_editing" TValue="bool" @bind-Checked="@_model.Chars">@L["Resolution is character based (text only)."]</Check>
<Check @bind-Checked="@_model.Chars" Disabled="!_editing" @TValue="bool">@L["Resolution is character based (text only)."]</Check>
</Field>
<Field>
<Check Disabled="!_editing" TValue="bool" @bind-Checked="@_model.Grayscale">@L["Resolution only has gray colors."]</Check>
<Check @bind-Checked="@_model.Grayscale" Disabled="!_editing" @TValue="bool">@L["Resolution only has gray colors."]</Check>
</Field>
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/resolutions" class="btn btn-secondary">@L["Back to list"]</a>
<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/resolutions">@L["Back to list"]</a>
</div>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -34,162 +34,160 @@
@inject ResolutionsService ResolutionsService
@inject NavigationManager NavigationManager
@inject ResolutionsByScreenService ResolutionsByScreenService
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Screen details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
@if (_editing || _model.Width.HasValue)
@if(_editing || _model.Width.HasValue)
{
<Field>
<FieldLabel>@L["Width (mm)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownWidth">@L["Unknown (width)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownWidth" @TValue="bool">@L["Unknown (width)"]</Check>
}
@if(!_editing ||
!_unknownWidth)
{
<Validation Validator="@ValidateDoubleBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="double?" Decimals="2" @bind-Value="@_model.Width" >
<NumericEdit @bind-Value="@_model.Width" Decimals="2" Disabled="!_editing" @TValue="double?">
<Feedback>
<ValidationError>@L["Please enter a valid width in millimeters."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Height.HasValue)
}
@if(_editing || _model.Height.HasValue)
{
<Field>
<FieldLabel>@L["Height (mm)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownHeight">@L["Unknown (height)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownHeight" @TValue="bool">@L["Unknown (height)"]</Check>
}
@if(!_editing ||
!_unknownHeight)
{
<Validation Validator="@ValidateDoubleBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="double?" Decimals="2" @bind-Value="@_model.Height" >
<NumericEdit @bind-Value="@_model.Height" Decimals="2" Disabled="!_editing" @TValue="double?">
<Feedback>
<ValidationError>@L["Please enter a valid height in millimeters."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
}
}
<Field>
<FieldLabel>@L["Diagonal (inches)"]</FieldLabel>
<Validation Validator="@ValidateDoubleBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="double" Decimals="2" @bind-Value="@_model.Diagonal" >
<NumericEdit @bind-Value="@_model.Diagonal" Decimals="2" Disabled="!_editing" @TValue="double">
<Feedback>
<ValidationError>@L["Please enter a correct diagonal size in inches."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
</Field>
@if (_editing || _model.EffectiveColors.HasValue)
@if(_editing || _model.EffectiveColors.HasValue)
{
<Field>
<FieldLabel>@L["Effective colors"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownColors">@L["Unknown (effective colors)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownColors" @TValue="bool">@L["Unknown (effective colors)"]</Check>
}
@if(!_editing ||
!_unknownColors)
{
<Validation Validator="@ValidateLongBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="long?" Decimals="0" @bind-Value="@_model.EffectiveColors" >
<NumericEdit @bind-Value="@_model.EffectiveColors" Decimals="0" Disabled="!_editing" @TValue="long?">
<Feedback>
<ValidationError>@L["Please enter a number of effective colors."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Type != null)
}
@if(_editing || _model.Type != null)
{
<Field>
<FieldLabel>@L["Type"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownType">@L["Unknown (type)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownType" @TValue="bool">@L["Unknown (type)"]</Check>
}
@if(!_editing ||
!_unknownType)
{
<Validation Validator="@ValidateType">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Type">
<TextEdit @bind-Text="@_model.Type" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid screen type."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
}
<Field>
<FieldLabel>@L["Native resolution"]</FieldLabel>
<Select Disabled="!_editing" TValue="int" @bind-SelectedValue="@_model.NativeResolutionId">
@foreach (var resolution in _resolutions)
<Select @bind-SelectedValue="@_model.NativeResolutionId" Disabled="!_editing" @TValue="int">
@foreach(var resolution in _resolutions)
{
<SelectItem TValue="int" Value="@resolution.Id">@resolution.ToString()</SelectItem>
}
<SelectItem @TValue="int" Value="@resolution.Id">@resolution.ToString()</SelectItem>
}
</Select>
</Field>
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/screens" class="btn btn-secondary">@L["Back to list"]</a>
<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/screens">@L["Back to list"]</a>
</div>
@if (!_editing)
@if(!_editing)
{
<hr />
<h3>@L["Resolutions supported by this screen"]</h3>
<Button Color="Color.Success" Clicked="OnAddResolutionClick" Disabled="_addingResolution">@L["Add new (resolution by screen)"]</Button>
@if (_addingResolution)
<Button Clicked="OnAddResolutionClick" Color="Color.Success" Disabled="_addingResolution">@L["Add new (resolution by screen)"]</Button>
@if(_addingResolution)
{
<div>
<Field>
<FieldLabel>@L["Resolutions"]</FieldLabel>
<Select Disabled="_savingResolution" TValue="int?" @bind-SelectedValue="@_addingResolutionId">
@foreach (var resolution in _resolutions)
<Select @bind-SelectedValue="@_addingResolutionId" Disabled="_savingResolution" @TValue="int?">
@foreach(var resolution in _resolutions)
{
@if (resolution.Id != _model.NativeResolutionId &&
@if(resolution.Id != _model.NativeResolutionId &&
_screenResolutions.All(r => r.ResolutionId != resolution.Id))
{
<SelectItem TValue="int?" Value="@resolution.Id">@resolution</SelectItem>
}
<SelectItem @TValue="int?" Value="@resolution.Id">@resolution</SelectItem>
}
}
</Select>
<Button Color="Color.Primary" Clicked="@CancelAddResolution" Disabled="@_savingResolution">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@ConfirmAddResolution" Disabled="@_savingResolution">@L["Add"]</Button>
<Button Clicked="@CancelAddResolution" Color="Color.Primary" Disabled="@_savingResolution">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddResolution" Color="Color.Success" Disabled="@_savingResolution">@L["Add"]</Button>
</Field>
</div>
}
@if (_screenResolutions?.Count > 0)
@if(_screenResolutions?.Count > 0)
{
<div>
<table class="table table-striped">
@@ -217,7 +215,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _screenResolutions)
@foreach(var item in _screenResolutions)
{
<tr>
<td>
@@ -239,7 +237,7 @@
@item.Resolution.Grayscale
</td>
<td>
<Button Color="Color.Danger" Clicked="() => {ShowResolutionDeleteModal(item.Id);}" Disabled="@_addingResolution">@L["Delete"]</Button>
<Button Clicked="() => {ShowResolutionDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingResolution">@L["Delete"]</Button>
</td>
</tr>
}
@@ -248,7 +246,7 @@
</div>
}
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
@@ -259,9 +257,8 @@
<Text>@_deleteText</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>
}
</Modal>}

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -28,7 +28,6 @@
@page "/admin/software_families/details/{Id:long}"
@page "/admin/software_families/edit/{Id:long}"
@page "/admin/software_families/create"
@using Marechai.Database
@using Marechai.Database.Models
@inherits OwningComponentBase<SoftwareFamiliesService>
@inject IStringLocalizer<SoftwareFamiliesService> L
@@ -38,116 +37,113 @@
@inject NavigationManager NavigationManager
@inject IWebHostEnvironment Host
@inject IJSRuntime JSRuntime
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Software family details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Name"]</FieldLabel>
<Validation Validator="@ValidateName">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Name">
<TextEdit @bind-Text="@_model.Name" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid name."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
</Field>
@if (_editing || _model.Introduced != null)
@if(_editing || _model.Introduced != null)
{
<Field>
<FieldLabel>@L["Introduced"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownIntroduced">@L["Unknown (introduction date)"]</Check>
}
@if (!_editing || !_unknownIntroduced)
<Check @bind-Checked="@_unknownIntroduced" @TValue="bool">@L["Unknown (introduction date)"]</Check>
}
@if(!_editing ||
!_unknownIntroduced)
{
<Validation Validator="@ValidateIntroduced">
<DateEdit TValue="DateTime?" ReadOnly="!_editing" @bind-Date="@_model.Introduced" >
<DateEdit @bind-Date="@_model.Introduced" ReadOnly="!_editing" @TValue="DateTime?">
<Feedback>
<ValidationError>@L["Please enter a valid introduction date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.ParentId != null)
}
@if(_editing || _model.ParentId != null)
{
<Field>
<FieldLabel>@L["Parent software family"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownParent">@L["Unknown or none (parent software family)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownParent" @TValue="bool">@L["Unknown or none (parent software family)"]</Check>
}
@if(!_editing ||
!_unknownParent)
{
<Select Disabled="!_editing" TValue="ulong?" @bind-SelectedValue="@_model.ParentId">
@foreach (var family in _softwareFamilies)
<Select @bind-SelectedValue="@_model.ParentId" Disabled="!_editing" @TValue="ulong?">
@foreach(var family in _softwareFamilies)
{
<SelectItem TValue="ulong?" Value="@family.Id">@family.Name</SelectItem>
}
<SelectItem @TValue="ulong?" Value="@family.Id">@family.Name</SelectItem>
}
</Select>
}
}
</Field>
}
}
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/software_families" class="btn btn-secondary">@L["Back to list"]</a>
<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/software_families">@L["Back to list"]</a>
</div>
@if (!_editing)
@if(!_editing)
{
<hr />
<h3>@L["Companies involved in this software family"]</h3>
<Button Color="Color.Success" Clicked="OnAddCompanyClick" Disabled="_addingCompany">@L["Add new (company)"]</Button>
@if (_addingCompany)
<Button Clicked="OnAddCompanyClick" Color="Color.Success" Disabled="_addingCompany">@L["Add new (company)"]</Button>
@if(_addingCompany)
{
<div>
<Field>
<FieldLabel>@L["Company"]</FieldLabel>
<Select Disabled="_savingCompany" TValue="int?" @bind-SelectedValue="@_addingCompanyId">
@foreach (var company in _companies)
<Select @bind-SelectedValue="@_addingCompanyId" Disabled="_savingCompany" @TValue="int?">
@foreach(var company in _companies)
{
<SelectItem TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
<SelectItem @TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Role"]</FieldLabel>
<Select Disabled="!_editing" TValue="string" @bind-SelectedValue="@_addingCompanyRoleId">
@foreach (var role in _roles)
<Select @bind-SelectedValue="@_addingCompanyRoleId" Disabled="!_editing" @TValue="string">
@foreach(var role in _roles)
{
<SelectItem TValue="string" Value="@role.Id">@role.Name</SelectItem>
}
<SelectItem @TValue="string" Value="@role.Id">@role.Name</SelectItem>
}
</Select>
</Field>
<Button Color="Color.Primary" Clicked="@CancelAddCompany" Disabled="@_savingCompany">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@ConfirmAddCompany" Disabled="@_savingCompany">@L["Add"]</Button>
<Button Clicked="@CancelAddCompany" Color="Color.Primary" Disabled="@_savingCompany">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddCompany" Color="Color.Success" Disabled="@_savingCompany">@L["Add"]</Button>
</div>
}
@if (_softwareFamilyCompanies?.Count > 0)
@if(_softwareFamilyCompanies?.Count > 0)
{
<div>
<table class="table table-striped">
@@ -163,7 +159,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _softwareFamilyCompanies)
@foreach(var item in _softwareFamilyCompanies)
{
<tr>
<td>
@@ -173,7 +169,7 @@
@item.Role
</td>
<td>
<Button Color="Color.Danger" Clicked="() => {ShowCompanyDeleteModal(item.Id);}" Disabled="@_addingCompany">@L["Delete"]</Button>
<Button Clicked="() => {ShowCompanyDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingCompany">@L["Delete"]</Button>
</td>
</tr>
}
@@ -182,7 +178,7 @@
</div>
}
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
@@ -193,9 +189,8 @@
<Text>@_deleteText</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>
}
</Modal>}

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -28,8 +28,8 @@
@page "/admin/software_variants/details/{Id:long}"
@page "/admin/software_variants/edit/{Id:long}"
@page "/admin/software_variants/create"
@using Marechai.Database
@using Marechai.Database.Models
@using Marechai.Database
@inherits OwningComponentBase<SoftwareVariantsService>
@inject IStringLocalizer<SoftwareVariantsService> L
@inject SoftwareVersionsService SoftwareVersionsService
@@ -40,317 +40,303 @@
@inject NavigationManager NavigationManager
@inject IWebHostEnvironment Host
@inject IJSRuntime JSRuntime
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Software variant details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<Field>
<FieldLabel>@L["Software version"]</FieldLabel>
<Select Disabled="!_editing" TValue="ulong" @bind-SelectedValue="@_model.SoftwareVersionId">
@foreach (var version in _softwareVersions)
<Select @bind-SelectedValue="@_model.SoftwareVersionId" Disabled="!_editing" @TValue="ulong">
@foreach(var version in _softwareVersions)
{
<SelectItem TValue="ulong" Value="@version.Id">@version.Name ?? @version.Version</SelectItem>
<SelectItem @TValue="ulong" Value="@version.Id">@version.Name ?? @version.Version</SelectItem>
}
</Select>
</Field>
@if (_editing || _model.Name != null)
{
</Field>
@if(_editing || _model.Name != null)
{
<Field>
<FieldLabel>@L["Name, if different from software version name"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownName">@L["Unknown (name)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownName" @TValue="bool">@L["Unknown (name)"]</Check>
}
@if(!_editing ||
!_unknownName)
{
<Validation Validator="@ValidateName">
<TextEdit Disabled="!_editing" @bind-Text="@_model.Name">
<TextEdit @bind-Text="@_model.Name" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid name."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.Version != null)
{
}
</Field>}
@if(_editing || _model.Version != null)
{
<Field>
<FieldLabel>@L["Version, if different from software version's"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownVersion">@L["Unknown (version)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownVersion" @TValue="bool">@L["Unknown (version)"]</Check>
}
@if(!_editing ||
!_unknownVersion)
{
<Validation Validator="@ValidateVersion">
<TextEdit Disabled="!_editing" @bind-Text="@_model.Version">
<TextEdit @bind-Text="@_model.Version" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid version."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.Introduced != null)
{
}
</Field>}
@if(_editing || _model.Introduced != null)
{
<Field>
<FieldLabel>@L["Introduced"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownIntroduced">@L["Unknown (introduction date)"]</Check>
}
@if (!_editing || !_unknownIntroduced)
<Check @bind-Checked="@_unknownIntroduced" @TValue="bool">@L["Unknown (introduction date)"]</Check>
}
@if(!_editing ||
!_unknownIntroduced)
{
<Validation Validator="@ValidateIntroduced">
<DateEdit TValue="DateTime?" ReadOnly="!_editing" @bind-Date="@_model.Introduced" >
<DateEdit @bind-Date="@_model.Introduced" ReadOnly="!_editing" @TValue="DateTime?">
<Feedback>
<ValidationError>@L["Please enter a valid introduction date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.ParentId != null)
{
}
</Field>}
@if(_editing || _model.ParentId != null)
{
<Field>
<FieldLabel>@L["Parent"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownParent">@L["Unknown or none (parent variant)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownParent" @TValue="bool">@L["Unknown or none (parent variant)"]</Check>
}
@if(!_editing ||
!_unknownParent)
{
<Select Disabled="!_editing" TValue="ulong?" @bind-SelectedValue="@_model.ParentId">
@foreach (var variant in _softwareVariants)
<Select @bind-SelectedValue="@_model.ParentId" Disabled="!_editing" @TValue="ulong?">
@foreach(var variant in _softwareVariants)
{
<SelectItem TValue="ulong?" Value="@variant.Id">@variant.Name ?? @variant.Version</SelectItem>
}
<SelectItem @TValue="ulong?" Value="@variant.Id">@variant.Name ?? @variant.Version</SelectItem>
}
</Select>
}
</Field>
}
@if (_editing || _model.MinimumMemory.HasValue)
{
}
</Field>}
@if(_editing || _model.MinimumMemory.HasValue)
{
<Field>
<FieldLabel>@L["Minimum memory (bytes)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownMinimumMemory">@L["Unknown (minimum memory)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownMinimumMemory" @TValue="bool">@L["Unknown (minimum memory)"]</Check>
}
@if(!_editing ||
!_unknownMinimumMemory)
{
<Validation Validator="@ValidateUnsignedLongBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="ulong?" Decimals="0" @bind-Value="@_model.MinimumMemory">
<NumericEdit @bind-Value="@_model.MinimumMemory" Decimals="0" Disabled="!_editing" @TValue="ulong?">
<Feedback>
<ValidationError>@L["Please enter the minimum memory size in bytes."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.RecommendedMemory.HasValue)
{
}
</Field>}
@if(_editing || _model.RecommendedMemory.HasValue)
{
<Field>
<FieldLabel>@L["Recommended memory (bytes)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownRecommendedMemory">@L["Unknown (recommended memory)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownRecommendedMemory" @TValue="bool">@L["Unknown (recommended memory)"]</Check>
}
@if(!_editing ||
!_unknownRecommendedMemory)
{
<Validation Validator="@ValidateUnsignedLongBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="ulong?" Decimals="0" @bind-Value="@_model.RecommendedMemory">
<NumericEdit @bind-Value="@_model.RecommendedMemory" Decimals="0" Disabled="!_editing" @TValue="ulong?">
<Feedback>
<ValidationError>@L["Please enter the recommended memory size in bytes."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.RequiredStorage.HasValue)
{
}
</Field>}
@if(_editing || _model.RequiredStorage.HasValue)
{
<Field>
<FieldLabel>@L["Required storage (bytes)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownRequiredStorage">@L["Unknown (required storage)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownRequiredStorage" @TValue="bool">@L["Unknown (required storage)"]</Check>
}
@if(!_editing ||
!_unknownRequiredStorage)
{
<Validation Validator="@ValidateUnsignedLongBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="ulong?" Decimals="0" @bind-Value="@_model.RequiredStorage">
<NumericEdit @bind-Value="@_model.RequiredStorage" Decimals="0" Disabled="!_editing" @TValue="ulong?">
<Feedback>
<ValidationError>@L["Please enter the required storage size in bytes."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.PartNumber != null)
{
}
</Field>}
@if(_editing || _model.PartNumber != null)
{
<Field>
<FieldLabel>@L["Part number"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownPartNumber">@L["Unknown (part number)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownPartNumber" @TValue="bool">@L["Unknown (part number)"]</Check>
}
@if(!_editing ||
!_unknownPartNumber)
{
<Validation Validator="@ValidatePartNumber">
<TextEdit Disabled="!_editing" @bind-Text="@_model.PartNumber">
<TextEdit @bind-Text="@_model.PartNumber" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid part number."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.SerialNumber != null)
{
}
</Field>}
@if(_editing || _model.SerialNumber != null)
{
<Field>
<FieldLabel>@L["Serial number"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownSerialNumber">@L["Unknown (serial number)"]</Check>
}
<Check @bind-Checked="@_unknownSerialNumber" @TValue="bool">@L["Unknown (serial number)"]</Check>
}
@if(_editing)
{
@L["Serial number is NOT the serial number used to install the software, but a serial number some software manufacturers use as SKU."]
}
@if (!_editing ||
@if(!_editing ||
!_unknownSerialNumber)
{
<Validation Validator="@ValidateSerialNumber">
<TextEdit Disabled="!_editing" @bind-Text="@_model.SerialNumber">
<TextEdit @bind-Text="@_model.SerialNumber" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid serial number."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.ProductCode != null)
{
}
</Field>}
@if(_editing || _model.ProductCode != null)
{
<Field>
<FieldLabel>@L["Product code"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownProductCode">@L["Unknown (product code)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownProductCode" @TValue="bool">@L["Unknown (product code)"]</Check>
}
@if(!_editing ||
!_unknownProductCode)
{
<Validation Validator="@ValidateProductCode">
<TextEdit Disabled="!_editing" @bind-Text="@_model.ProductCode">
<TextEdit @bind-Text="@_model.ProductCode" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid product code."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
@if (_editing || _model.CatalogueNumber != null)
{
}
</Field>}
@if(_editing || _model.CatalogueNumber != null)
{
<Field>
<FieldLabel>@L["Catalogue number"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownCatalogueNumber">@L["Unknown (catalogue number)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownCatalogueNumber" @TValue="bool">@L["Unknown (catalogue number)"]</Check>
}
@if(!_editing ||
!_unknownCatalogueNumber)
{
<Validation Validator="@ValidateCatalogueNumber">
<TextEdit Disabled="!_editing" @bind-Text="@_model.CatalogueNumber">
<TextEdit @bind-Text="@_model.CatalogueNumber" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid catalogue number."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
</Field>
}
<Field>
}
</Field>}
<Field>
<FieldLabel>@L["Distribution mode"]</FieldLabel>
<Select Disabled="!_editing" TValue="uint" @bind-SelectedValue="@Distribution">
@foreach (uint mode in Enum.GetValues(typeof(DistributionMode)))
<Select @bind-SelectedValue="@Distribution" Disabled="!_editing" @TValue="uint">
@foreach(uint mode in Enum.GetValues(typeof(DistributionMode)))
{
<SelectItem TValue="uint" Value="@mode">@(((DistributionMode)mode).ToString())</SelectItem>
}
<SelectItem @TValue="uint" Value="@mode">@(((DistributionMode)mode).ToString())</SelectItem>
}
</Select>
</Field>
</Field>
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/software_variants" class="btn btn-secondary">@L["Back to list"]</a>
<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/software_variants">@L["Back to list"]</a>
</div>
@if (!_editing)
@if(!_editing)
{
<hr />
<h3>@L["Companies involved in this software variant"]</h3>
<Button Color="Color.Success" Clicked="OnAddCompanyClick" Disabled="_addingCompany">@L["Add new (company)"]</Button>
@if (_addingCompany)
<Button Clicked="OnAddCompanyClick" Color="Color.Success" Disabled="_addingCompany">@L["Add new (company)"]</Button>
@if(_addingCompany)
{
<div>
<Field>
<FieldLabel>@L["Company"]</FieldLabel>
<Select Disabled="_savingCompany" TValue="int?" @bind-SelectedValue="@_addingCompanyId">
@foreach (var company in _companies)
<Select @bind-SelectedValue="@_addingCompanyId" Disabled="_savingCompany" @TValue="int?">
@foreach(var company in _companies)
{
<SelectItem TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
<SelectItem @TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Role"]</FieldLabel>
<Select Disabled="!_editing" TValue="string" @bind-SelectedValue="@_addingCompanyRoleId">
@foreach (var role in _roles)
<Select @bind-SelectedValue="@_addingCompanyRoleId" Disabled="!_editing" @TValue="string">
@foreach(var role in _roles)
{
<SelectItem TValue="string" Value="@role.Id">@role.Name</SelectItem>
}
<SelectItem @TValue="string" Value="@role.Id">@role.Name</SelectItem>
}
</Select>
</Field>
<Button Color="Color.Primary" Clicked="@CancelAddCompany" Disabled="@_savingCompany">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@ConfirmAddCompany" Disabled="@_savingCompany">@L["Add"]</Button>
<Button Clicked="@CancelAddCompany" Color="Color.Primary" Disabled="@_savingCompany">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddCompany" Color="Color.Success" Disabled="@_savingCompany">@L["Add"]</Button>
</div>
}
@if (_softwareVariantCompanies?.Count > 0)
@if(_softwareVariantCompanies?.Count > 0)
{
<div>
<table class="table table-striped">
@@ -366,7 +352,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _softwareVariantCompanies)
@foreach(var item in _softwareVariantCompanies)
{
<tr>
<td>
@@ -376,7 +362,7 @@
@item.Role
</td>
<td>
<Button Color="Color.Danger" Clicked="() => {ShowCompanyDeleteModal(item.Id);}" Disabled="@_addingCompany">@L["Delete"]</Button>
<Button Clicked="() => {ShowCompanyDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingCompany">@L["Delete"]</Button>
</td>
</tr>
}
@@ -385,7 +371,7 @@
</div>
}
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
@@ -396,9 +382,8 @@
<Text>@_deleteText</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>
}
</Modal>}

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -28,7 +28,6 @@
@page "/admin/software_versions/details/{Id:long}"
@page "/admin/software_versions/edit/{Id:long}"
@page "/admin/software_versions/create"
@using Marechai.Database
@using Marechai.Database.Models
@inherits OwningComponentBase<SoftwareVersionsService>
@inject IStringLocalizer<SoftwareVersionsService> L
@@ -40,187 +39,184 @@
@inject NavigationManager NavigationManager
@inject IWebHostEnvironment Host
@inject IJSRuntime JSRuntime
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Software version details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
<Field>
<FieldLabel>@L["Software family"]</FieldLabel>
<Select Disabled="!_editing" TValue="ulong" @bind-SelectedValue="@_model.FamilyId">
@foreach (var family in _softwareFamilies)
<Select @bind-SelectedValue="@_model.FamilyId" Disabled="!_editing" @TValue="ulong">
@foreach(var family in _softwareFamilies)
{
<SelectItem TValue="ulong" Value="@family.Id">@family.Name</SelectItem>
}
<SelectItem @TValue="ulong" Value="@family.Id">@family.Name</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Version"]</FieldLabel>
<Validation Validator="@ValidateVersion">
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Version">
<TextEdit @bind-Text="@_model.Version" ReadOnly="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid version."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
</Field>
@if (_editing || _model.Name != null)
@if(_editing || _model.Name != null)
{
<Field>
<FieldLabel>@L["Name, if different from family name"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownName">@L["Unknown (name)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownName" @TValue="bool">@L["Unknown (name)"]</Check>
}
@if(!_editing ||
!_unknownName)
{
<Validation Validator="@ValidateName">
<TextEdit Disabled="!_editing" @bind-Text="@_model.Name">
<TextEdit @bind-Text="@_model.Name" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid name."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Codename != null)
}
@if(_editing || _model.Codename != null)
{
<Field>
<FieldLabel>@L["Codename"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownCodename">@L["Unknown (codename)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownCodename" @TValue="bool">@L["Unknown (codename)"]</Check>
}
@if(!_editing ||
!_unknownCodename)
{
<Validation Validator="@ValidateCodename">
<TextEdit Disabled="!_editing" @bind-Text="@_model.Codename">
<TextEdit @bind-Text="@_model.Codename" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid codename."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Introduced != null)
}
@if(_editing || _model.Introduced != null)
{
<Field>
<FieldLabel>@L["Introduced"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownIntroduced">@L["Unknown (introduction date)"]</Check>
}
@if (!_editing || !_unknownIntroduced)
<Check @bind-Checked="@_unknownIntroduced" @TValue="bool">@L["Unknown (introduction date)"]</Check>
}
@if(!_editing ||
!_unknownIntroduced)
{
<Validation Validator="@ValidateIntroduced">
<DateEdit TValue="DateTime?" ReadOnly="!_editing" @bind-Date="@_model.Introduced" >
<DateEdit @bind-Date="@_model.Introduced" ReadOnly="!_editing" @TValue="DateTime?">
<Feedback>
<ValidationError>@L["Please enter a valid introduction date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.LicenseId != null)
}
@if(_editing || _model.LicenseId != null)
{
<Field>
<FieldLabel>@L["License"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownLicense">@L["Unknown (license)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownLicense" @TValue="bool">@L["Unknown (license)"]</Check>
}
@if(!_editing ||
!_unknownLicense)
{
<Select Disabled="!_editing" TValue="int?" @bind-SelectedValue="@_model.LicenseId">
@foreach (var license in _licenses)
<Select @bind-SelectedValue="@_model.LicenseId" Disabled="!_editing" @TValue="int?">
@foreach(var license in _licenses)
{
<SelectItem TValue="int?" Value="@license.Id">@license.Name</SelectItem>
}
<SelectItem @TValue="int?" Value="@license.Id">@license.Name</SelectItem>
}
</Select>
}
}
</Field>
}
@if (_editing || _model.PreviousId != null)
}
@if(_editing || _model.PreviousId != null)
{
<Field>
<FieldLabel>@L["Previous"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownPrevious">@L["Unknown or none (previous version)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownPrevious" @TValue="bool">@L["Unknown or none (previous version)"]</Check>
}
@if(!_editing ||
!_unknownPrevious)
{
<Select Disabled="!_editing" TValue="ulong?" @bind-SelectedValue="@_model.PreviousId">
@foreach (var version in _softwareVersions)
<Select @bind-SelectedValue="@_model.PreviousId" Disabled="!_editing" @TValue="ulong?">
@foreach(var version in _softwareVersions)
{
<SelectItem TValue="ulong?" Value="@version.Id">@version.Name ?? @version.Version</SelectItem>
}
<SelectItem @TValue="ulong?" Value="@version.Id">@version.Name ?? @version.Version</SelectItem>
}
</Select>
}
}
</Field>
}
}
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/software_versions" class="btn btn-secondary">@L["Back to list"]</a>
<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/software_versions">@L["Back to list"]</a>
</div>
@if (!_editing)
@if(!_editing)
{
<hr />
<h3>@L["Companies involved in this software version"]</h3>
<Button Color="Color.Success" Clicked="OnAddCompanyClick" Disabled="_addingCompany">@L["Add new (company)"]</Button>
@if (_addingCompany)
<Button Clicked="OnAddCompanyClick" Color="Color.Success" Disabled="_addingCompany">@L["Add new (company)"]</Button>
@if(_addingCompany)
{
<div>
<Field>
<FieldLabel>@L["Company"]</FieldLabel>
<Select Disabled="_savingCompany" TValue="int?" @bind-SelectedValue="@_addingCompanyId">
@foreach (var company in _companies)
<Select @bind-SelectedValue="@_addingCompanyId" Disabled="_savingCompany" @TValue="int?">
@foreach(var company in _companies)
{
<SelectItem TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
<SelectItem @TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
</Select>
</Field>
<Field>
<FieldLabel>@L["Role"]</FieldLabel>
<Select Disabled="!_editing" TValue="string" @bind-SelectedValue="@_addingCompanyRoleId">
@foreach (var role in _roles)
<Select @bind-SelectedValue="@_addingCompanyRoleId" Disabled="!_editing" @TValue="string">
@foreach(var role in _roles)
{
<SelectItem TValue="string" Value="@role.Id">@role.Name</SelectItem>
}
<SelectItem @TValue="string" Value="@role.Id">@role.Name</SelectItem>
}
</Select>
</Field>
<Button Color="Color.Primary" Clicked="@CancelAddCompany" Disabled="@_savingCompany">@L["Cancel"]</Button>
<Button Color="Color.Success" Clicked="@ConfirmAddCompany" Disabled="@_savingCompany">@L["Add"]</Button>
<Button Clicked="@CancelAddCompany" Color="Color.Primary" Disabled="@_savingCompany">@L["Cancel"]</Button>
<Button Clicked="@ConfirmAddCompany" Color="Color.Success" Disabled="@_savingCompany">@L["Add"]</Button>
</div>
}
@if (_softwareVersionCompanies?.Count > 0)
@if(_softwareVersionCompanies?.Count > 0)
{
<div>
<table class="table table-striped">
@@ -236,7 +232,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _softwareVersionCompanies)
@foreach(var item in _softwareVersionCompanies)
{
<tr>
<td>
@@ -246,7 +242,7 @@
@item.Role
</td>
<td>
<Button Color="Color.Danger" Clicked="() => {ShowCompanyDeleteModal(item.Id);}" Disabled="@_addingCompany">@L["Delete"]</Button>
<Button Clicked="() => {ShowCompanyDeleteModal(item.Id);}" Color="Color.Danger" Disabled="@_addingCompany">@L["Delete"]</Button>
</td>
</tr>
}
@@ -255,7 +251,7 @@
</div>
}
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
@@ -266,9 +262,8 @@
<Text>@_deleteText</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>
}
</Modal>}

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -33,229 +33,227 @@
@inject IStringLocalizer<SoundSynthsService> L
@inject CompaniesService CompaniesService
@inject NavigationManager NavigationManager
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Sound synthesizer details"]</h3>
<hr />
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<div>
@if (_editing || _model.CompanyId != null)
@if(_editing || _model.CompanyId != null)
{
<Field>
<FieldLabel>@L["Company"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownCompany">@L["Unknown (company)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownCompany" @TValue="bool">@L["Unknown (company)"]</Check>
}
@if(!_editing ||
!_unknownCompany)
{
<Select Disabled="!_editing" TValue="int?" @bind-SelectedValue="@_model.CompanyId">
@foreach (var company in _companies)
<Select @bind-SelectedValue="@_model.CompanyId" Disabled="!_editing" @TValue="int?">
@foreach(var company in _companies)
{
<SelectItem TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
<SelectItem @TValue="int?" Value="@company.Id">@company.Name</SelectItem>
}
</Select>
}
}
</Field>
}
}
<Field>
<FieldLabel>@L["Name"]</FieldLabel>
<Validation Validator="@ValidateName">
<TextEdit Disabled="!_editing" @bind-Text="@_model.Name">
<TextEdit @bind-Text="@_model.Name" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid name."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
</Field>
@if (_editing || _model.ModelCode != null)
@if(_editing || _model.ModelCode != null)
{
<Field>
<FieldLabel>@L["Model code"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownModelCode">@L["Unknown (model code)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownModelCode" @TValue="bool">@L["Unknown (model code)"]</Check>
}
@if(!_editing ||
!_unknownModelCode)
{
<Validation Validator="@ValidateModelCode">
<TextEdit Disabled="!_editing" @bind-Text="@_model.ModelCode">
<TextEdit @bind-Text="@_model.ModelCode" Disabled="!_editing">
<Feedback>
<ValidationError>@L["Please enter a valid model code."]</ValidationError>
</Feedback>
</TextEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Introduced.HasValue)
}
@if(_editing || _model.Introduced.HasValue)
{
<Field>
<FieldLabel>@L["Introduced"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" Disabled="_prototype" @bind-Checked="@_unknownIntroduced">@L["Unknown (introduction date)"]</Check>
<Check TValue="bool" Disabled="_unknownIntroduced" @bind-Checked="@_prototype">@L["Prototype"]</Check>
}
@if (!_editing ||
(!_prototype && !_unknownIntroduced))
<Check @bind-Checked="@_unknownIntroduced" Disabled="_prototype" @TValue="bool">@L["Unknown (introduction date)"]</Check>
<Check @bind-Checked="@_prototype" Disabled="_unknownIntroduced" @TValue="bool">@L["Prototype"]</Check>
}
@if(!_editing ||
!_prototype && !_unknownIntroduced)
{
<Validation Validator="@ValidateIntroduced">
<DateEdit Disabled="!_editing" TValue="DateTime?" @bind-Date="@_model.Introduced">
<DateEdit @bind-Date="@_model.Introduced" Disabled="!_editing" @TValue="DateTime?">
<Feedback>
<ValidationError>@L["Please enter an introduction date."]</ValidationError>
</Feedback>
</DateEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Voices.HasValue)
}
@if(_editing || _model.Voices.HasValue)
{
<Field>
<FieldLabel>@L["Digitized voices"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownVoices">@L["Unknown (voices)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownVoices" @TValue="bool">@L["Unknown (voices)"]</Check>
}
@if(!_editing ||
!_unknownVoices)
{
<Validation Validator="@ValidateIntegerBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.Voices" >
<NumericEdit @bind-Value="@_model.Voices" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid number of voices."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Frequency.HasValue)
}
@if(_editing || _model.Frequency.HasValue)
{
<Field>
<FieldLabel>@L["Sample rate (Hz)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownSampleRate">@L["Unknown (sample rate)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownSampleRate" @TValue="bool">@L["Unknown (sample rate)"]</Check>
}
@if(!_editing ||
!_unknownSampleRate)
{
<Validation Validator="@ValidateDoubleBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="double?" Decimals="0" @bind-Value="@_model.Frequency" >
<NumericEdit @bind-Value="@_model.Frequency" Decimals="0" Disabled="!_editing" @TValue="double?">
<Feedback>
<ValidationError>@L["Please enter a valid sample rate."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Depth.HasValue)
}
@if(_editing || _model.Depth.HasValue)
{
<Field>
<FieldLabel>@L["Sample resolution (bits)"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownSampleResolution">@L["Unknown (sample resolution)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownSampleResolution" @TValue="bool">@L["Unknown (sample resolution)"]</Check>
}
@if(!_editing ||
!_unknownSampleResolution)
{
<Validation Validator="@ValidateIntegerBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.Depth" >
<NumericEdit @bind-Value="@_model.Depth" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid number of bits for sample resolution."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.SquareWave.HasValue)
}
@if(_editing || _model.SquareWave.HasValue)
{
<Field>
<FieldLabel>@L["Square wave channels"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownSquareWaveChannels">@L["Unknown (square wave channels)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownSquareWaveChannels" @TValue="bool">@L["Unknown (square wave channels)"]</Check>
}
@if(!_editing ||
!_unknownSquareWaveChannels)
{
<Validation Validator="@ValidateIntegerBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.SquareWave" >
<NumericEdit @bind-Value="@_model.SquareWave" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid number of square wave channels."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.WhiteNoise.HasValue)
}
@if(_editing || _model.WhiteNoise.HasValue)
{
<Field>
<FieldLabel>@L["White noise channels"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownWhiteNoiseChannels">@L["Unknown (white noise channels)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownWhiteNoiseChannels" @TValue="bool">@L["Unknown (white noise channels)"]</Check>
}
@if(!_editing ||
!_unknownWhiteNoiseChannels)
{
<Validation Validator="@ValidateIntegerBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.WhiteNoise" >
<NumericEdit @bind-Value="@_model.WhiteNoise" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid number of white noise channels."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
}
@if (_editing || _model.Type.HasValue)
}
@if(_editing || _model.Type.HasValue)
{
<Field>
<FieldLabel>@L["Type"]</FieldLabel>
@if (_editing)
@if(_editing)
{
<Check TValue="bool" @bind-Checked="@_unknownType">@L["Unknown (type)"]</Check>
}
@if (!_editing ||
<Check @bind-Checked="@_unknownType" @TValue="bool">@L["Unknown (type)"]</Check>
}
@if(!_editing ||
!_unknownType)
{
<Validation Validator="@ValidateIntegerBiggerThanZero">
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.Type" >
<NumericEdit @bind-Value="@_model.Type" Decimals="0" Disabled="!_editing" @TValue="int?">
<Feedback>
<ValidationError>@L["Please enter a valid sound synthesizer type."]</ValidationError>
</Feedback>
</NumericEdit>
</Validation>
}
}
</Field>
}
}
</div>
<div>
@if (!_editing)
@if(!_editing)
{
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
}
<Button Clicked="@OnEditClicked" Color="Color.Primary">@L["Edit"]</Button>
}
else
{
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
}
<a href="/admin/sound_synths" class="btn btn-secondary">@L["Back to list"]</a>
<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/sound_synths">@L["Back to list"]</a>
</div>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<DocumentCompaniesService>
@inject IStringLocalizer<DocumentCompaniesService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Document companies"]</h3>
@if (_companies is null)
@if(_companies is null)
{
<p>@L["Loading..."]</p>
@@ -55,7 +55,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _companies)
@foreach(var item in _companies)
{
<tr>
<td>
@@ -69,26 +69,25 @@
<td>
<a class="btn btn-primary" href="/admin/document_companies/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/document_companies/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete company"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete the company {0}?"], _currentCompany?.Name)</Text>
<Text>@string.Format(L["Are you sure you want to delete the company {0}?"], _currentCompany?.Name)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<DocumentPeopleService>
@inject IStringLocalizer<DocumentPeopleService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Document companies"]</h3>
@if (_people is null)
@if(_people is null)
{
<p>@L["Loading..."]</p>
@@ -55,7 +55,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _people)
@foreach(var item in _people)
{
<tr>
<td>
@@ -69,26 +69,25 @@
<td>
<a class="btn btn-primary" href="/admin/document_people/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/document_people/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete person"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete {0}?"], _person?.Name)</Text>
<Text>@string.Format(L["Are you sure you want to delete {0}?"], _person?.Name)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<DocumentsService>
@inject IStringLocalizer<DocumentsService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Documents"]</h3>
@if (_documents is null)
@if(_documents is null)
{
<p>@L["Loading..."]</p>
@@ -61,7 +61,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _documents)
@foreach(var item in _documents)
{
<tr>
<td>
@@ -79,26 +79,25 @@
<td>
<a class="btn btn-primary" href="/admin/documents/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/documents/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete document"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete the document {0}?"], _currentDocument?.Title)</Text>
<Text>@string.Format(L["Are you sure you want to delete the document {0}?"], _currentDocument?.Title)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<DumpsService>
@inject IStringLocalizer<DumpsService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Dumps"]</h3>
@if (_dumps is null)
@if(_dumps is null)
{
<p>@L["Loading..."]</p>
@@ -64,7 +64,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _dumps)
@foreach(var item in _dumps)
{
<tr>
<td>
@@ -85,26 +85,25 @@
<td>
<a class="btn btn-primary" href="/admin/dumps/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/dumps/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete dump"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete the dump made by {0} on {1} for media titled {2}?"], _currentDump?.Dumper, _currentDump?.DumpDate.ToString() ?? L["Unknown (dump date)"], _currentDump?.MediaTitle)</Text>
<Text>@string.Format(L["Are you sure you want to delete the dump made by {0} on {1} for media titled {2}?"], _currentDump?.Dumper, _currentDump?.DumpDate.ToString() ?? L["Unknown (dump date)"], _currentDump?.MediaTitle)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<GpusService>
@inject IStringLocalizer<GpusService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Graphics Processing Units"]</h3>
@if (_gpus is null)
@if(_gpus is null)
{
<p>@L["Loading..."]</p>
@@ -61,7 +61,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _gpus)
@foreach(var item in _gpus)
{
<tr>
<td>
@@ -79,26 +79,25 @@
<td>
<a class="btn btn-primary" href="/admin/gpus/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/gpus/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete GPU"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete {0} {1}?"], _gpu?.Company, _gpu?.Name)</Text>
<Text>@string.Format(L["Are you sure you want to delete {0} {1}?"], _gpu?.Company, _gpu?.Name)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<InstructionSetExtensionsService>
@inject IStringLocalizer<InstructionSetExtensionsService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Instruction set extensions"]</h3>
@if (_extensions is null)
@if(_extensions is null)
{
<p>@L["Loading..."]</p>
@@ -52,7 +52,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _extensions)
@foreach(var item in _extensions)
{
<tr>
<td>
@@ -61,26 +61,25 @@
<td>
<a class="btn btn-primary" href="/admin/instruction_set_extensions/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/instruction_set_extensions/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete extension"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete {0}?"], _extension?.Extension)</Text>
<Text>@string.Format(L["Are you sure you want to delete {0}?"], _extension?.Extension)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<InstructionSetsService>
@inject IStringLocalizer<InstructionSetsService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Instruction sets"]</h3>
@if (_instructionSets is null)
@if(_instructionSets is null)
{
<p>@L["Loading..."]</p>
@@ -52,7 +52,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _instructionSets)
@foreach(var item in _instructionSets)
{
<tr>
<td>
@@ -61,26 +61,25 @@
<td>
<a class="btn btn-primary" href="/admin/instruction_sets/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/instruction_sets/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete instruction set"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete {0}?"], _instructionSet?.Name)</Text>
<Text>@string.Format(L["Are you sure you want to delete {0}?"], _instructionSet?.Name)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<LicensesService>
@inject IStringLocalizer<LicensesService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Licenses"]</h3>
@if (_licenses is null)
@if(_licenses is null)
{
<p>@L["Loading..."]</p>
@@ -64,7 +64,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _licenses)
@foreach(var item in _licenses)
{
<tr>
<td>
@@ -80,7 +80,7 @@
@item.OsiApproved
</td>
<td>
@if (item.Link != null)
@if(item.Link != null)
{
<a href="@item.Link" target="_blank">
@L["Link"]
@@ -90,26 +90,25 @@
<td>
<a class="btn btn-primary" href="/admin/licenses/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/licenses/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete license"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete {0}?"], _license?.Name)</Text>
<Text>@string.Format(L["Are you sure you want to delete {0}?"], _license?.Name)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<MachineFamiliesService>
@inject IStringLocalizer<MachineFamiliesService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Machine families"]</h3>
@if (_machineFamilies is null)
@if(_machineFamilies is null)
{
<p>@L["Loading..."]</p>
@@ -55,7 +55,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _machineFamilies)
@foreach(var item in _machineFamilies)
{
<tr>
<td>
@@ -67,26 +67,25 @@
<td>
<a class="btn btn-primary" href="/admin/machine_families/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/machine_families/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete machine family"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete {0} {1}?"], _machineFamily?.Company, _machineFamily?.Name)</Text>
<Text>@string.Format(L["Are you sure you want to delete {0} {1}?"], _machineFamily?.Company, _machineFamily?.Name)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<MachinesService>
@inject IStringLocalizer<MachinesService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Machines"]</h3>
@if (_machines is null)
@if(_machines is null)
{
<p>@L["Loading..."]</p>
@@ -67,7 +67,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _machines)
@foreach(var item in _machines)
{
<tr>
<td>
@@ -91,26 +91,25 @@
<td>
<a class="btn btn-primary" href="/admin/machines/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/machines/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete machine"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete {0} {1}?"], _machine?.Company, _machine?.Name)</Text>
<Text>@string.Format(L["Are you sure you want to delete {0} {1}?"], _machine?.Company, _machine?.Name)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<MagazineIssuesService>
@inject IStringLocalizer<MagazineIssuesService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Magazine issues"]</h3>
@if (_magazineIssues is null)
@if(_magazineIssues is null)
{
<p>@L["Loading..."]</p>
@@ -58,7 +58,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _magazineIssues)
@foreach(var item in _magazineIssues)
{
<tr>
<td>
@@ -73,26 +73,25 @@
<td>
<a class="btn btn-primary" href="/admin/magazine_issues/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/magazine_issues/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete magazine issue"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete the magazine issue published on {0} for magazine {1} with caption {2}?"], _currentMagazineIssue?.Published,_currentMagazineIssue?.MagazineTitle,_currentMagazineIssue?.Caption)</Text>
<Text>@string.Format(L["Are you sure you want to delete the magazine issue published on {0} for magazine {1} with caption {2}?"], _currentMagazineIssue?.Published, _currentMagazineIssue?.MagazineTitle, _currentMagazineIssue?.Caption)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<MagazinesService>
@inject IStringLocalizer<MagazinesService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Magazines"]</h3>
@if (_magazines is null)
@if(_magazines is null)
{
<p>@L["Loading..."]</p>
@@ -64,7 +64,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _magazines)
@foreach(var item in _magazines)
{
<tr>
<td>
@@ -85,26 +85,25 @@
<td>
<a class="btn btn-primary" href="/admin/magazines/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/magazines/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete magazine"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete the magazine {0}?"], _currentMagazine?.Title)</Text>
<Text>@string.Format(L["Are you sure you want to delete the magazine {0}?"], _currentMagazine?.Title)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<NewsService>
@inject IStringLocalizer<NewsService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["News"]</h3>
@if (_news is null)
@if(_news is null)
{
<p>@L["Loading..."]</p>
@@ -55,7 +55,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _news)
@foreach(var item in _news)
{
<tr>
<td>
@@ -68,26 +68,25 @@
@item.AffectedId
</td>
<td>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete news"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete the news type {0} from {1} that affect artifact ID {2}?"], _currentNews?.Type, _currentNews?.Timestamp, _currentNews?.AffectedId)</Text>
<Text>@string.Format(L["Are you sure you want to delete the news type {0} from {1} that affect artifact ID {2}?"], _currentNews?.Type, _currentNews?.Timestamp, _currentNews?.AffectedId)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<PeopleService>
@inject IStringLocalizer<PeopleService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["People"]</h3>
@if (_people is null)
@if(_people is null)
{
<p>@L["Loading..."]</p>
@@ -70,7 +70,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _people)
@foreach(var item in _people)
{
<tr>
<td>
@@ -89,13 +89,13 @@
@item.Webpage
</td>
<td>
@if (item.Twitter != null)
@if(item.Twitter != null)
{
<a href="https://twitter.com/@item.Twitter">@item.Twitter</a>
}
</td>
<td>
@if (item.Facebook != null)
@if(item.Facebook != null)
{
<a href="https://www.facebook.com/@item.Facebook">@item.Facebook</a>
}
@@ -103,26 +103,25 @@
<td>
<a class="btn btn-primary" href="/admin/people/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/edit/details/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete person"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete {0}?"], _person?.FullName)</Text>
<Text>@string.Format(L["Are you sure you want to delete {0}?"], _person?.FullName)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<ProcessorsService>
@inject IStringLocalizer<ProcessorsService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Processors"]</h3>
@if (_processors is null)
@if(_processors is null)
{
<p>@L["Loading..."]</p>
@@ -64,7 +64,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _processors)
@foreach(var item in _processors)
{
<tr>
<td>
@@ -85,26 +85,25 @@
<td>
<a class="btn btn-primary" href="/admin/processors/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/processors/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete processor"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete {0}?"], _processor?.Name)</Text>
<Text>@string.Format(L["Are you sure you want to delete {0}?"], _processor?.Name)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<ResolutionsService>
@inject IStringLocalizer<ResolutionsService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Resolutions"]</h3>
@if (_resolutions is null)
@if(_resolutions is null)
{
<p>@L["Loading..."]</p>
@@ -67,7 +67,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _resolutions)
@foreach(var item in _resolutions)
{
<tr>
<td>
@@ -91,26 +91,25 @@
<td>
<a class="btn btn-primary" href="/admin/resolutions/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/resolutions/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete resolution"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(L["Are you sure you want to delete resolution {0}?"], _resolution)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<ScreensService>
@inject IStringLocalizer<ScreensService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Screens"]</h3>
@if (_screens is null)
@if(_screens is null)
{
<p>@L["Loading..."]</p>
@@ -61,7 +61,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _screens)
@foreach(var item in _screens)
{
<tr>
<td>
@@ -79,26 +79,25 @@
<td>
<a class="btn btn-primary" href="/admin/screens/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/screens/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete screen"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete screen of {0}\" size with a resolution of {1} and type {2}?"], _screen?.Diagonal, _screen?.NativeResolution, _screen?.Type)</Text>
<Text>@string.Format(L["Are you sure you want to delete screen of {0}\" size with a resolution of {1} and type {2}?"], _screen?.Diagonal, _screen?.NativeResolution, _screen?.Type)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<SoftwareFamiliesService>
@inject IStringLocalizer<SoftwareFamiliesService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Software families"]</h3>
@if (_softwareFamilies is null)
@if(_softwareFamilies is null)
{
<p>@L["Loading..."]</p>
@@ -58,7 +58,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _softwareFamilies)
@foreach(var item in _softwareFamilies)
{
<tr>
<td>
@@ -73,26 +73,25 @@
<td>
<a class="btn btn-primary" href="/admin/software_families/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/software_families/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete software family"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete the software family {0}?"], _currentSoftwareFamily?.Name)</Text>
<Text>@string.Format(L["Are you sure you want to delete the software family {0}?"], _currentSoftwareFamily?.Name)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<SoftwareVariantsService>
@inject IStringLocalizer<SoftwareVariantsService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Software variants"]</h3>
@if (_softwareVariants is null)
@if(_softwareVariants is null)
{
<p>@L["Loading..."]</p>
@@ -64,7 +64,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _softwareVariants)
@foreach(var item in _softwareVariants)
{
<tr>
<td>
@@ -85,26 +85,25 @@
<td>
<a class="btn btn-primary" href="/admin/software_variants/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/software_variants/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete software variant"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete the software variant {0}?"], _currentSoftwareVariant?.Name ?? _currentSoftwareVariant?.Version)</Text>
<Text>@string.Format(L["Are you sure you want to delete the software variant {0}?"], _currentSoftwareVariant?.Name ?? _currentSoftwareVariant?.Version)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<SoftwareVersionsService>
@inject IStringLocalizer<SoftwareVersionsService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Software versions"]</h3>
@if (_softwareVersions is null)
@if(_softwareVersions is null)
{
<p>@L["Loading..."]</p>
@@ -64,7 +64,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _softwareVersions)
@foreach(var item in _softwareVersions)
{
<tr>
<td>
@@ -85,26 +85,25 @@
<td>
<a class="btn btn-primary" href="/admin/software_versions/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/software_versions/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete software version"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete the software version {0}?"], _currentSoftwareVersion?.Name ?? _currentSoftwareVersion?.Version)</Text>
<Text>@string.Format(L["Are you sure you want to delete the software version {0}?"], _currentSoftwareVersion?.Name ?? _currentSoftwareVersion?.Version)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,11 +29,11 @@
@using Marechai.Database.Models
@inherits OwningComponentBase<SoundSynthsService>
@inject IStringLocalizer<SoundSynthsService> L
@inject Microsoft.AspNetCore.Identity.UserManager<ApplicationUser> UserManager
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Sound synthesizers"]</h3>
@if (_soundSynths is null)
@if(_soundSynths is null)
{
<p>@L["Loading..."]</p>
@@ -64,7 +64,7 @@
</tr>
</thead>
<tbody>
@foreach (var item in _soundSynths)
@foreach(var item in _soundSynths)
{
<tr>
<td>
@@ -85,26 +85,25 @@
<td>
<a class="btn btn-primary" href="/admin/sound_synths/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/sound_synths/edit/@item.Id">@L["Edit"]</a>
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
</td>
</tr>
}
</tbody>
</table>
<Modal @ref="_frmDelete" IsCentered="true" Closing="@ModalClosing">
<ModalBackdrop/>
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete sound synthesizer"]</ModalTitle>
<CloseButton Clicked="@HideModal"/>
<CloseButton Clicked="@HideModal" />
</ModalHeader>
<ModalBody>
<Text>@string.Format(@L["Are you sure you want to delete {0} {1}?"], _soundSynth?.CompanyName, _soundSynth?.Name)</Text>
<Text>@string.Format(L["Are you sure you want to delete {0} {1}?"], _soundSynth?.CompanyName, _soundSynth?.Name)</Text>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@HideModal" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Color="Color.Danger" Clicked="@ConfirmDelete" Disabled="@_deleteInProgress">@L["Delete"]</Button>
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -32,60 +32,61 @@
@inject IStringLocalizer<CompaniesService> L
@inject IWebHostEnvironment Host
@if (_companies is null)
@if(_companies is null)
{
<p align="center">@L["Loading..."]</p>
return;
}
@if (CountryId.HasValue)
@if(CountryId.HasValue)
{
<p align="center">
<b>@string.Format(L["Companies founded in {0}."], L[_countryName])</b>
@if (File.Exists(Path.Combine(Host.WebRootPath, "assets/flags/countries", $"{CountryId:D3}.svg")))
@if(File.Exists(Path.Combine(Host.WebRootPath, "assets/flags/countries", $"{CountryId:D3}.svg")))
{
<picture>
<source type="image/svg+xml" srcset="/assets/flags/countries/@($"{CountryId:D3}").svg">
<source type="image/webp" srcset="/assets/flags/countries/webp/1x/@($"{CountryId:D3}").webp,
<source srcset="/assets/flags/countries/@($"{CountryId:D3}").svg" type="image/svg+xml">
<source srcset="/assets/flags/countries/webp/1x/@($"{CountryId:D3}").webp,
/assets/flags/countries/webp/1x/@($"{CountryId:D3}").webp 2x,
/assets/flags/countries/webp/1x/@($"{CountryId:D3}").webp 3x">
<img srcset="/assets/flags/countries/png/1x/@($"{CountryId:D3}").png,
/assets/flags/countries/webp/1x/@($"{CountryId:D3}").webp 3x" type="image/webp">
<img alt="" height="32" src="/assets/flags/countries/png/1x/@($"{CountryId:D3}").png" srcset="/assets/flags/countries/png/1x/@($"{CountryId:D3}").png,
/assets/flags/countries/png/1x/@($"{CountryId:D3}").png 2x,
/assets/flags/countries/png/1x/@($"{CountryId:D3}").webp 3x" src="/assets/flags/countries/png/1x/@($"{CountryId:D3}").png" alt="" height="32" />
/assets/flags/countries/png/1x/@($"{CountryId:D3}").webp 3x" />
</picture>
}
</p>
}
@if (_character.HasValue)
@if(_character.HasValue)
{
<p align="center">
<b>@string.Format(L["Companies which name starts with {0}."], _character)</b>
</p>
}
@if (_companies.Any())
@if(_companies.Any())
{
<div class="container">
<span class="align-content-center">@string.Format(L["{0} companies found in the database."], _companies.Count())</span>
<hr/>
<hr />
<table>
@foreach (var company in _companies)
@foreach(var company in _companies)
{
<tr>
<td class="text-right">
<a href="/company/@company.Id">
@if (company.LastLogo != null && File.Exists(Path.Combine(Host.WebRootPath, "assets/logos", company.LastLogo + ".svg")))
@if(company.LastLogo != null &&
File.Exists(Path.Combine(Host.WebRootPath, "assets/logos", company.LastLogo + ".svg")))
{
<picture>
<source type="image/svg+xml" srcset="/assets/logos/@(company.LastLogo).svg">
<source type="image/webp" srcset="/assets/logos/thumbs/webp/1x/@(company.LastLogo).webp,
<source srcset="/assets/logos/@(company.LastLogo).svg" type="image/svg+xml">
<source srcset="/assets/logos/thumbs/webp/1x/@(company.LastLogo).webp,
/assets/logos/thumbs/webp/2x/@(company.LastLogo).webp 2x,
/assets/logos/thumbs/webp/3x/@(company.LastLogo).webp 3x">
<img srcset="/assets/logos/thumbs/png/1x/@(company.LastLogo).png,
/assets/logos/thumbs/webp/3x/@(company.LastLogo).webp 3x" type="image/webp">
<img alt="" height="auto" src="/assets/logos/thumbs/png/1x/@(company.LastLogo).png" srcset="/assets/logos/thumbs/png/1x/@(company.LastLogo).png,
/assets/logos/thumbs/png/2x/@(company.LastLogo).png 2x,
/assets/logos/thumbs/png/3x/@(company.LastLogo).png 3x" src="/assets/logos/thumbs/png/1x/@(company.LastLogo).png" alt="" height="auto" width="auto" style="max-height: 32px; max-width: 128px" />
/assets/logos/thumbs/png/3x/@(company.LastLogo).png 3x" style="max-height: 32px; max-width: 128px" width="auto" />
</picture>
}
</a>

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -26,62 +26,60 @@
}
@page "/company/{Id:int}"
@using Marechai.Database.Models
@using Marechai.Database
@using Marechai.Database
@inherits OwningComponentBase<CompaniesService>
@inject IStringLocalizer<CompaniesService> L
@inject CompanyLogosService CompanyLogosService
@inject IWebHostEnvironment Host
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
@if (_company is null)
@if(_company is null)
{
<p align="center">@L["Company not found."]</p>
return;
}
<div class="container-fluid">
<p align=center>
@if (_company.LastLogo != null &&
<p align="center">
@if(_company.LastLogo != null &&
File.Exists(Path.Combine(Host.WebRootPath, "assets/logos", _company.LastLogo + ".svg")))
{
<picture>
<source type="image/svg+xml" srcset="/assets/logos/@(_company.LastLogo).svg">
<source type="image/webp" srcset="/assets/logos/webp/1x/@(_company.LastLogo).webp,
<source srcset="/assets/logos/@(_company.LastLogo).svg" type="image/svg+xml">
<source srcset="/assets/logos/webp/1x/@(_company.LastLogo).webp,
/assets/logos/webp/2x/@(_company.LastLogo).webp 2x,
/assets/logos/webp/3x/@(_company.LastLogo).webp 3x">
<img srcset="/assets/logos/png/1x/@(_company.LastLogo).png,
/assets/logos/webp/3x/@(_company.LastLogo).webp 3x" type="image/webp">
<img alt="" height="auto" src="/assets/logos/png/1x/@(_company.LastLogo).png" srcset="/assets/logos/png/1x/@(_company.LastLogo).png,
/assets/logos/png/2x/@(_company.LastLogo).png 2x,
/assets/logos/png/3x/@(_company.LastLogo).png 3x" src="/assets/logos/png/1x/@(_company.LastLogo).png" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
/assets/logos/png/3x/@(_company.LastLogo).png 3x" style="max-height: 256px; max-width: 256px" width="auto" />
</picture>
}
</p>
<div class="row">
@if (_logos != null &&
@if(_logos != null &&
_logos.Count > 1)
{
<div class="col-3">
<Carousel @bind-SelectedSlide="@_selectedSlide" ShowIndicators="true" ShowControls="true">
<Carousel @bind-SelectedSlide="@_selectedSlide" ShowControls="true" ShowIndicators="true">
@foreach(var logo in _logos.Where(logo => File.Exists(Path.Combine(Host.WebRootPath, "assets/logos", logo.Guid + ".svg"))))
{
<CarouselSlide Name="@logo.Guid.ToString()">
<div style="width: 256px; height: 256px; margin: auto;">
<picture>
<source type="image/svg+xml" srcset="/assets/logos/@(logo.Guid).svg">
<source type="image/webp" srcset="/assets/logos/webp/1x/@(logo.Guid).webp,
<source srcset="/assets/logos/@(logo.Guid).svg" type="image/svg+xml">
<source srcset="/assets/logos/webp/1x/@(logo.Guid).webp,
/assets/logos/webp/1x/@(logo.Guid).webp 2x,
/assets/logos/webp/1x/@(logo.Guid).webp 3x">
<img class="d-block w-100" srcset="/assets/logos/png/1x/@(logo.Guid).png,
/assets/logos/webp/1x/@(logo.Guid).webp 3x" type="image/webp">
<img alt="" class="d-block w-100" height="auto" src="/assets/logos/png/1x/@(logo.Guid).png" srcset="/assets/logos/png/1x/@(logo.Guid).png,
/assets/logos/png/1x/@(logo.Guid).png 2x,
/assets/logos/png/1x/@(logo.Guid).webp 3x" src="/assets/logos/png/1x/@(logo.Guid).png" alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" />
/assets/logos/png/1x/@(logo.Guid).webp 3x" style="max-height: 256px; max-width: 256px" width="auto" />
</picture>
</div>
@if(logo.Year.HasValue)
@@ -89,19 +87,19 @@
<div style="text-align: center;">@(string.Format(L["in use since {0}"], logo.Year))</div>
}
</CarouselSlide>
}
}
</Carousel>
</div>
}
<div class="col-6">
<table class="table">
<tr>
<th colspan="2" class="text-center">
<table class="table">
<tr>
<th class="text-center" colspan="2">
<b>@_company.Name</b>
</th>
</tr>
@if (_company.Founded.HasValue)
{
</tr>
@if(_company.Founded.HasValue)
{
<tr>
<th class="text-right">@L["Founded"]</th>
@if(_company.FoundedMonthIsUnknown)
@@ -117,30 +115,30 @@
<td>@_company.Founded.Value.ToLongDateString().</td>
}
</tr>
}
@if(!string.IsNullOrEmpty(_company.LegalName))
{
}
@if(!string.IsNullOrEmpty(_company.LegalName))
{
<tr>
<th class="text-right">@L["Legal name"]</th>
<td>@_company.LegalName</td>
</tr>
}
<tr>
}
<tr>
<th class="text-right">@L["Country"]</th>
<td>
@if (_company.Country != null)
@if(_company.Country != null)
{
<a href="/companies/country/@_company.CountryId">
@if (File.Exists(Path.Combine(Host.WebRootPath, "assets/flags/countries", $"{_company.CountryId:D3}.svg")))
@if(File.Exists(Path.Combine(Host.WebRootPath, "assets/flags/countries", $"{_company.CountryId:D3}.svg")))
{
<picture>
<source type="image/svg+xml" srcset="/assets/flags/countries/@($"{_company.CountryId:D3}").svg">
<source type="image/webp" srcset="/assets/flags/countries/webp/1x/@($"{_company.CountryId:D3}").webp,
<source srcset="/assets/flags/countries/@($"{_company.CountryId:D3}").svg" type="image/svg+xml">
<source srcset="/assets/flags/countries/webp/1x/@($"{_company.CountryId:D3}").webp,
/assets/flags/countries/webp/1x/@($"{_company.CountryId:D3}").webp 2x,
/assets/flags/countries/webp/1x/@($"{_company.CountryId:D3}").webp 3x">
<img srcset="/assets/flags/countries/png/1x/@($"{_company.CountryId:D3}").png,
/assets/flags/countries/webp/1x/@($"{_company.CountryId:D3}").webp 3x" type="image/webp">
<img alt="" height="32" src="/assets/flags/countries/png/1x/@($"{_company.CountryId:D3}").png" srcset="/assets/flags/countries/png/1x/@($"{_company.CountryId:D3}").png,
/assets/flags/countries/png/1x/@($"{_company.CountryId:D3}").png 2x,
/assets/flags/countries/png/1x/@($"{_company.CountryId:D3}").webp 3x" src="/assets/flags/countries/png/1x/@($"{_company.CountryId:D3}").png" alt="" height="32" />
/assets/flags/countries/png/1x/@($"{_company.CountryId:D3}").webp 3x" />
</picture>
}
@L[_company.Country]
@@ -151,10 +149,10 @@
@L["Unknown (country)"]
}
</td>
</tr>
<tr>
</tr>
<tr>
<th class="text-right">@L["Status"]</th>
@switch (_company.Status)
@switch(_company.Status)
{
case CompanyStatus.Unknown:
<td>@L["Current company status is unknown."]</td>
@@ -163,13 +161,14 @@
<td>@L["Company is active."]</td>
break;
case CompanyStatus.Sold:
if (_company.Sold != null)
if(_company.Sold != null)
{
if (_soldTo != null)
if(_soldTo != null)
{
<td>
<a href="/company/@_soldTo.Id">
@string.Format(L["Company sold to {0} on {1}."], _soldTo.Name, _company.SoldMonthIsUnknown ? $"{_company.Sold.Value.Year}" : _company.SoldDayIsUnknown ? $"{_company.Sold.Value:Y}" : _company.SoldMonthIsUnknown ? $"{_company.Sold.Value.Year}" : _company.SoldDayIsUnknown ? $"{_company.Sold.Value:Y}" : _company.Sold.Value.ToLongDateString())</a>
@string.Format(L["Company sold to {0} on {1}."], _soldTo.Name, _company.SoldMonthIsUnknown ? $"{_company.Sold.Value.Year}" : _company.SoldDayIsUnknown ? $"{_company.Sold.Value:Y}" : _company.SoldMonthIsUnknown ? $"{_company.Sold.Value.Year}" : _company.SoldDayIsUnknown ? $"{_company.Sold.Value:Y}" : _company.Sold.Value.ToLongDateString())
</a>
</td>
}
else
@@ -179,11 +178,12 @@
}
else
{
if (_soldTo != null)
if(_soldTo != null)
{
<td>
<a href="/company/@_soldTo.Id">
@string.Format(L["Company sold to {0} on an unknown date."], _soldTo.Name)</a>
@string.Format(L["Company sold to {0} on an unknown date."], _soldTo.Name)
</a>
</td>
}
else
@@ -193,9 +193,9 @@
}
break;
case CompanyStatus.Merged:
if (_company.Sold != null)
if(_company.Sold != null)
{
if (_soldTo != null)
if(_soldTo != null)
{
<td>
<a href="/company/@_soldTo.Id">@string.Format(L["Company merged on {0} to form {1}."], _company.SoldMonthIsUnknown ? $"{_company.Sold.Value.Year}" : _company.SoldDayIsUnknown ? $"{_company.Sold.Value:Y}" : _company.Sold.Value.ToLongDateString(), _soldTo.Name)</a>
@@ -208,7 +208,7 @@
}
else
{
if (_soldTo != null)
if(_soldTo != null)
{
<td>
<a href="/company/@_soldTo.Id">@string.Format(L["Company merged on an unknown date to form {0}."], _soldTo.Name)</a>
@@ -221,7 +221,7 @@
}
break;
case CompanyStatus.Bankrupt:
if (_company.Sold != null)
if(_company.Sold != null)
{
<td>@string.Format(L["Company declared bankruptcy on {0}."], _company.SoldMonthIsUnknown ? $"{_company.Sold.Value.Year}" : _company.SoldDayIsUnknown ? $"{_company.Sold.Value:Y}" : _company.Sold.Value.ToLongDateString())</td>
}
@@ -231,7 +231,7 @@
}
break;
case CompanyStatus.Defunct:
if (_company.Sold != null)
if(_company.Sold != null)
{
<td>@string.Format(L["Company ceased operations on {0}."], _company.SoldMonthIsUnknown ? $"{_company.Sold.Value.Year}" : _company.SoldDayIsUnknown ? $"{_company.Sold.Value:Y}" : _company.Sold.Value.ToLongDateString())</td>
}
@@ -241,9 +241,9 @@
}
break;
case CompanyStatus.Renamed:
if (_company.Sold != null)
if(_company.Sold != null)
{
if (_soldTo != null)
if(_soldTo != null)
{
<td>
<a href="/company/@_soldTo.Id">@string.Format(L["Company renamed to {0} on {1}."], _soldTo.Name, _company.SoldMonthIsUnknown ? $"{_company.Sold.Value.Year}" : _company.SoldDayIsUnknown ? $"{_company.Sold.Value:Y}" : _company.Sold.Value.ToLongDateString())</a>
@@ -256,11 +256,12 @@
}
else
{
if (_soldTo != null)
if(_soldTo != null)
{
<td>
<a href="/company/@_soldTo.Id">
@string.Format(L["Company renamed to {0} on an unknown date."], _soldTo.Name)</a>
@string.Format(L["Company renamed to {0} on an unknown date."], _soldTo.Name)
</a>
</td>
}
else
@@ -272,43 +273,46 @@
default:
throw new ArgumentOutOfRangeException();
}
</tr>
<tr>
</tr>
<tr>
<th class="text-right">@L["Address"]</th>
<td>
@_company.Address<br>
@if (_company.City != _company.Province)
@_company.Address
<br>
@if(_company.City != _company.Province)
{
@_company.City<br>
@_company.City
<br>
}
@_company.PostalCode @_company.Province</td>
</tr>
@if (!string.IsNullOrEmpty(_company.Website) ||
@_company.PostalCode @_company.Province
</td>
</tr>
@if(!string.IsNullOrEmpty(_company.Website) ||
!string.IsNullOrEmpty(_company.Twitter) ||
!string.IsNullOrEmpty(_company.Facebook))
{
{
<tr>
<th class="text-right">@L["Links"]</th>
<td>
@if (!string.IsNullOrEmpty(_company.Website))
@if(!string.IsNullOrEmpty(_company.Website))
{
<a href="@_company.Website">@L["Website"]</a>
<br />
}
@if (!string.IsNullOrEmpty(_company.Twitter))
@if(!string.IsNullOrEmpty(_company.Twitter))
{
<a href="https://www.twitter.com/@_company.Twitter">Twitter</a>
<br />
}
@if (!string.IsNullOrEmpty(_company.Facebook))
@if(!string.IsNullOrEmpty(_company.Facebook))
{
<a href="https://www.facebook.com/@_company.Facebook">Facebook</a>
<br />
}
</td>
</tr>
}
</table>
}
</table>
</div>
</div>
@{
@@ -316,21 +320,22 @@
}
<div class="row" id="itemsAccordion">
<div class="card">
@if (_computers.Count > 0)
@if(_computers.Count > 0)
{
<div class="card-header" id="headingComputers">
<h5 class="mb-0">
<button aria-controls="collapseComputers" aria-expanded="false" class="btn btn-info" data-target="#collapseComputers" data-toggle="collapse" @onclick="@CollapseComputers">
@((MarkupString)string.Format(@L["<ok>{0}</ok> computers known."], _computers.Count).Replace("<ok>", "<span class=\"badge badge-success\">").Replace("</ok>","</span>"))
@((MarkupString)string.Format(L["<ok>{0}</ok> computers known."], _computers.Count).Replace("<ok>", "<span class=\"badge badge-success\">").Replace("</ok>", "</span>"))
</button>
</h5>
</div>
<div aria-labelledby="headingComputers" class="@(ComputersCollapsed ? "collapse" : "")" data-parent="#itemsAccordion" id="collapseComputers">
<div class="card-body">
@foreach (var computer in _computers)
@foreach(var computer in _computers)
{
<a href="/machine/@computer.Id">
@computer.Name</a>
@computer.Name
</a>
<br />
}
</div>
@@ -341,26 +346,27 @@
<div class="card-header" id="headingComputers">
<h5 class="mb-0">
<button class="btn btn-info">
@((MarkupString)L["<red>No</red> computers known."].ToString().Replace("<red>", "<span class=\"badge badge-danger\">").Replace("</red>","</span>"))
@((MarkupString)L["<red>No</red> computers known."].ToString().Replace("<red>", "<span class=\"badge badge-danger\">").Replace("</red>", "</span>"))
</button>
</h5>
</div>
}
@if (_consoles.Count > 0)
@if(_consoles.Count > 0)
{
<div class="card-header" id="headingConsoles">
<h5 class="mb-0">
<button aria-controls="collapseConsoles" aria-expanded="false" class="btn btn-info" data-target="#collapseConsoles" data-toggle="collapse" @onclick="@CollapseConsoles">
@((MarkupString)string.Format(@L["<ok>{0}</ok> videogame consoles known."], _consoles.Count).Replace("<ok>", "<span class=\"badge badge-success\">").Replace("</ok>","</span>"))
@((MarkupString)string.Format(L["<ok>{0}</ok> videogame consoles known."], _consoles.Count).Replace("<ok>", "<span class=\"badge badge-success\">").Replace("</ok>", "</span>"))
</button>
</h5>
</div>
<div aria-labelledby="headingConsoles" class="@(ConsolesCollapsed ? "collapse" : "")" data-parent="#itemsAccordion" id="collapseConsoles">
<div class="card-body">
@foreach (var console in _consoles)
@foreach(var console in _consoles)
{
<a href="/machine/@console.Id">
@console.Name</a>
@console.Name
</a>
<br />
}
</div>
@@ -371,22 +377,21 @@
<div class="card-header" id="headingComputers">
<h5 class="mb-0">
<button class="btn btn-info">
@((MarkupString)L["<red>No</red> videogame consoles known."].ToString().Replace("<red>", "<span class=\"badge badge-danger\">").Replace("</red>","</span>"))
@((MarkupString)L["<red>No</red> videogame consoles known."].ToString().Replace("<red>", "<span class=\"badge badge-danger\">").Replace("</red>", "</span>"))
</button>
</h5>
</div>
}
</div>
</div>
@if (_description != null)
@if(_description != null)
{
<hr/>
<hr />
<div class="container">
@((MarkupString)_description)
</div>
}
</div>
<style>
.carousel-indicators {
position: absolute;

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,13 +29,12 @@
@inherits OwningComponentBase<ComputersService>
@inject IStringLocalizer<ComputersService> L
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<p>
@L["Here you can consult our database."]
<br />
@@ -225,7 +224,7 @@
@L["Search by year"]
<br>
@{ var counter = 0; }
@for (int i = _minYear; i <= _maxYear; i++)
@for(var i = _minYear; i <= _maxYear; i++)
{
{
counter++;
@@ -233,7 +232,7 @@
<a href="/computers/year/@i">
@i
</a>
if (counter % 8 == 0)
if(counter % 8 == 0)
{
<br />
}

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -31,46 +31,46 @@
@inherits OwningComponentBase<ComputersService>
@inject IStringLocalizer<ComputersService> L
@if (_computers is null)
@if(_computers is null)
{
<p align="center">@L["Loading..."]</p>
return;
}
<p>@L["Search results:"]</p>
<p align="center">
@if (_character.HasValue)
@if(_character.HasValue)
{
<b>@string.Format(L["Computers starting with {0}"], _character)</b>
<br />
}
else if (Year.HasValue)
else if(Year.HasValue)
{
<b>@string.Format(L["Computers introduced in {0}"], Year)</b>
<br />
}
@if (_computers?.Count > 0)
@if(_computers?.Count > 0)
{
<p>
@string.Format(L["{0} computers found in the database."], _computers.Count)
<br />
@foreach (var computer in _computers)
@foreach(var computer in _computers)
{
<a href="/machine/@computer.Id">
@computer.Company @computer.Name</a>
@computer.Company @computer.Name
</a>
<br />
}
</p>
}
else
{
@if (_character.HasValue)
@if(_character.HasValue)
{
<p>@L["There are no computers found in the database that start with this letter."]</p>
}
else if (Year.HasValue)
else if(Year.HasValue)
{
<p>@L["There are no computers found introduced this year."]</p>
}

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -29,13 +29,12 @@
@inherits OwningComponentBase<ConsolesService>
@inject IStringLocalizer<ConsolesService> L
@if (!_loaded)
@if(!_loaded)
{
<p align="center">@L["Loading..."]</p>
return;
}
<p>
@L["Here you can consult our database."]
<br />
@@ -225,7 +224,7 @@
@L["Search by year"]
<br>
@{ var counter = 0; }
@for (int i = _minYear; i <= _maxYear; i++)
@for(var i = _minYear; i <= _maxYear; i++)
{
{
counter++;
@@ -233,7 +232,7 @@
<a href="/consoles/year/@i">
@i
</a>
if (counter % 8 == 0)
if(counter % 8 == 0)
{
<br />
}

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -31,46 +31,46 @@
@inherits OwningComponentBase<ConsolesService>
@inject IStringLocalizer<ConsolesService> L
@if (_consoles is null)
@if(_consoles is null)
{
<p align="center">@L["Loading..."]</p>
return;
}
<p>@L["Search results:"]</p>
<p align="center">
@if (_character.HasValue)
@if(_character.HasValue)
{
<b>@string.Format(L["Videogame consoles starting with {0}"], _character)</b>
<br />
}
else if (Year.HasValue)
else if(Year.HasValue)
{
<b>@string.Format(L["Videogame consoles introduced in {0}"], Year)</b>
<br />
}
@if (_consoles?.Count > 0)
@if(_consoles?.Count > 0)
{
<p>
@string.Format(L["{0} videogame consoles found in the database."], _consoles.Count)
<br />
@foreach (var console in _consoles)
@foreach(var console in _consoles)
{
<a href="/machine/@console.Id">
@console.Company @console.Name</a>
@console.Company @console.Name
</a>
<br />
}
</p>
}
else
{
@if (_character.HasValue)
@if(_character.HasValue)
{
<p>@L["There are no videogame consoles found in the database that start with this letter."]</p>
}
else if (Year.HasValue)
else if(Year.HasValue)
{
<p>@L["There are no videogame consoles found introduced this year."]</p>
}

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//

Some files were not shown because too many files have changed in this diff Show More