@page
@model EmailModel
@{
    ViewData["Title"] = "Manage Email";
    ViewData["ActivePage"] = ManageNavPages.Email;
}

<partial name="_StatusMessage" for="StatusMessage" />
<div class="container">
    <div class="row">
        <div class="col-md-6">
            <form id="email-form" method="post">
                <div asp-validation-summary="All" class="text-danger" role="alert"></div>
                @if (Model.IsEmailConfirmed)
                {
                    <div class="form-floating mb-3 input-group">
                        <input asp-for="Email" class="form-control" placeholder="Please enter your email." disabled />
                        <div class="input-group-text">
                            <span class="text-success font-weight-bold align-middle">✓</span>
                        </div>
                        <label asp-for="Email" class="form-label"></label>
                    </div>
                }
                else
                {
                    <div class="form-floating mb-3">
                        <input asp-for="Email" class="form-control" placeholder="Please enter your email." disabled />
                        <label asp-for="Email" class="form-label"></label>
                        <button id="email-verification" type="submit" asp-page-handler="SendVerificationEmail" class="btn btn-link">Send verification email</button>
                    </div>
                }
                <div class="form-floating mb-3">
                    <input asp-for="Input.NewEmail" class="form-control" autocomplete="email" aria-required="true" placeholder="Please enter new email." />
                    <label asp-for="Input.NewEmail" class="form-label"></label>
                    <span asp-validation-for="Input.NewEmail" class="text-danger"></span>
                </div>
                <button id="change-email-button" type="submit" asp-page-handler="ChangeEmail" class="w-100 btn btn-primary">변경하기</button>
            </form>
        </div>
    </div>
</div>
@section Scripts {
    <partial name="_ValidationScriptsPartial" />
}
