Got most of admin panel working. Data issues fixed
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
@using System.Text.Encodings.Web
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using Microsoft.AspNetCore.WebUtilities
|
||||
@using OpenArchival.Blazor.Data
|
||||
@using MyAppName.WebApp.Components.Account
|
||||
@using OpenArchival.DataAccess
|
||||
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject IEmailSender<ApplicationUser> EmailSender
|
||||
@@ -14,43 +15,44 @@
|
||||
|
||||
<PageTitle>Manage email</PageTitle>
|
||||
|
||||
<MudText Typo="Typo.h6" GutterBottom="true">Manage email</MudText>
|
||||
<h3>Manage email</h3>
|
||||
|
||||
<StatusMessage Message="@message" />
|
||||
|
||||
<form @onsubmit="OnSendEmailVerificationAsync" @formname="send-verification" id="send-verification-form" method="post">
|
||||
<AntiforgeryToken />
|
||||
</form>
|
||||
<EditForm Model="Input" FormName="change-email" OnValidSubmit="OnValidSubmitAsync" method="post">
|
||||
<DataAnnotationsValidator />
|
||||
|
||||
<MudGrid>
|
||||
|
||||
@if (isEmailConfirmed)
|
||||
{
|
||||
<MudItem md="12">
|
||||
<MudTextField Value="@email" Label="Email" Placeholder="Please enter your email." Disabled="true" AdornmentIcon="Icons.Material.Filled.Check" AdornmentColor="Color.Success" />
|
||||
</MudItem>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudItem md="12">
|
||||
<MudTextField Value="@email" Label="Email" Placeholder="Please enter your email." Disabled="true" />
|
||||
</MudItem>
|
||||
<MudItem md="12">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true" FormAction="FormAction.Submit">Send verification email</MudButton>
|
||||
</MudItem>
|
||||
}
|
||||
|
||||
<MudItem md="12">
|
||||
<MudTextField @bind-Value="@Input.NewEmail" For="@(() => Input.NewEmail)" UserAttributes="@(new() { { "autocomplete", "email" }, { "aria-required", "true" } } )" Label="New Email" HelperText="Please enter new email." />
|
||||
</MudItem>
|
||||
|
||||
<MudItem md="12">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true" FormAction="FormAction.Submit">Change email</MudButton>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</EditForm>
|
||||
<StatusMessage Message="@message"/>
|
||||
<div class="row">
|
||||
<div class="col-xl-6">
|
||||
<form @onsubmit="OnSendEmailVerificationAsync" @formname="send-verification" id="send-verification-form" method="post">
|
||||
<AntiforgeryToken />
|
||||
</form>
|
||||
<EditForm Model="Input" FormName="change-email" OnValidSubmit="OnValidSubmitAsync" method="post">
|
||||
<DataAnnotationsValidator />
|
||||
<ValidationSummary class="text-danger" role="alert" />
|
||||
@if (isEmailConfirmed)
|
||||
{
|
||||
<div class="form-floating mb-3 input-group">
|
||||
<input type="text" value="@email" id="email" class="form-control" placeholder="Enter your email" disabled />
|
||||
<div class="input-group-append">
|
||||
<span class="h-100 input-group-text text-success font-weight-bold">✓</span>
|
||||
</div>
|
||||
<label for="email" class="form-label">Email</label>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="form-floating mb-3">
|
||||
<input type="text" value="@email" id="email" class="form-control" placeholder="Enter your email" disabled />
|
||||
<label for="email" class="form-label">Email</label>
|
||||
<button type="submit" class="btn btn-link" form="send-verification-form">Send verification email</button>
|
||||
</div>
|
||||
}
|
||||
<div class="form-floating mb-3">
|
||||
<InputText @bind-Value="Input.NewEmail" id="Input.NewEmail" class="form-control" autocomplete="email" aria-required="true" placeholder="Enter a new email" />
|
||||
<label for="Input.NewEmail" class="form-label">New email</label>
|
||||
<ValidationMessage For="() => Input.NewEmail" class="text-danger" />
|
||||
</div>
|
||||
<button type="submit" class="w-100 btn btn-lg btn-primary">Change email</button>
|
||||
</EditForm>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private string? message;
|
||||
|
||||
Reference in New Issue
Block a user