commit
acda6bba74
|
@ -5,6 +5,7 @@
|
||||||
@inject IStringLocalizer<Index> Localizer
|
@inject IStringLocalizer<Index> Localizer
|
||||||
@inject IStringLocalizer<SharedResources> SharedLocalizer
|
@inject IStringLocalizer<SharedResources> SharedLocalizer
|
||||||
|
|
||||||
|
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="Username" class="control-label">@SharedLocalizer["Username"] </label>
|
<label for="Username" class="control-label">@SharedLocalizer["Username"] </label>
|
||||||
|
@ -12,17 +13,20 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="Password" class="control-label">@SharedLocalizer["Password"] </label>
|
<label for="Password" class="control-label">@SharedLocalizer["Password"] </label>
|
||||||
<input type="password" class="form-control" placeholder="Password" @bind="@_password" id="Password" />
|
<input type="password" class="form-control" placeholder="Password" @bind="@_password" id="Password" required />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="Confirm" class="control-label">@Localizer["Password.Confirm"] </label>
|
<label for="Confirm" class="control-label">@Localizer["Password.Confirm"] </label>
|
||||||
<input type="password" class="form-control" placeholder="Password" @bind="@_confirm" id="Confirm" />
|
<input type="password" class="form-control" placeholder="Password" @bind="@_confirm" id="Confirm" required />
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-primary" @onclick="Reset">@Localizer["Password.Reset"]</button>
|
<button type="button" class="btn btn-primary" @onclick="Reset">@Localizer["Password.Reset"]</button>
|
||||||
<button type="button" class="btn btn-secondary" @onclick="Cancel">@SharedLocalizer["Cancel"]</button>
|
<button type="button" class="btn btn-secondary" @onclick="Cancel">@SharedLocalizer["Cancel"]</button>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
private ElementReference form;
|
||||||
|
private bool validated = false;
|
||||||
private string _username = string.Empty;
|
private string _username = string.Empty;
|
||||||
private string _password = string.Empty;
|
private string _password = string.Empty;
|
||||||
private string _confirm = string.Empty;
|
private string _confirm = string.Empty;
|
||||||
|
@ -42,6 +46,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task Reset()
|
private async Task Reset()
|
||||||
|
{
|
||||||
|
validated = true;
|
||||||
|
var interop = new Interop(JSRuntime);
|
||||||
|
if (await interop.FormValid(form))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -84,6 +92,11 @@
|
||||||
AddModuleMessage(Localizer["Error.Password.Reset"], MessageType.Error);
|
AddModuleMessage(Localizer["Error.Password.Reset"], MessageType.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void Cancel()
|
private void Cancel()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user