@page
@using BlogCore.Utilidades
@model RegisterModel
@{
    ViewData["Title"] = "Registro de usuarios";
}

<h1>@ViewData["Title"]</h1>

<div class="row">
    <div class="col-md-6">
        <form id="registerForm" asp-route-returnUrl="@Model.ReturnUrl" method="post">
            <h2>Registrar nuevo usuario.</h2>
            <hr />
            <div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div>

            <!-- Rol -->
            @if (User.IsInRole(CNT.Admin))
            {
                <div class="form-group row">
                    <div class="col-6"><h4>Seleccionar Rol de Usuario</h4></div>
                <div class="col-5">
                    <input type="radio" name="radUsuarioRole" value="@CNT.Admin" />@CNT.Admin
                    <input type="radio" name="radUsuarioRole" value="@CNT.Usuario" />@CNT.Usuario
                </div>"
            </div>
            }
            <br />
            <br />

            <!-- Nombre -->
            <div class="form-floating mb-3">
                <input asp-for="Input.Nombre" class="form-control" aria-required="true" placeholder="John Doe" />
                <label asp-for="Input.Nombre"></label>
                <span asp-validation-for="Input.Nombre" class="text-danger"></span>
            </div>

            <!-- Dirección -->
            <div class="form-floating mb-3">
                <input asp-for="Input.Direccion" class="form-control" aria-required="true" placeholder="Badiguarato # 315" />
                <label asp-for="Input.Direccion"></label>
                <span asp-validation-for="Input.Direccion" class="text-danger"></span>
            </div>

            <!-- Ciudad -->
            <div class="form-floating mb-3">
                <input asp-for="Input.Ciudad" class="form-control" aria-required="true" placeholder="En algún lugar..." />
                <label asp-for="Input.Ciudad"></label>
                <span asp-validation-for="Input.Ciudad" class="text-danger"></span>
            </div>

            <!-- Pais -->
            <div class="form-floating mb-3">
                <input asp-for="Input.Pais" class="form-control" aria-required="true" placeholder="... de un gran país" />
                <label asp-for="Input.Pais"></label>
                <span asp-validation-for="Input.Pais" class="text-danger"></span>
            </div>

            <!-- PhoneNumber -->
            <div class="form-floating mb-3">
                <input asp-for="Input.PhoneNumber" class="form-control" aria-required="true" placeholder="0123456789" />
                <label asp-for="Input.PhoneNumber"></label>
                <span asp-validation-for="Input.PhoneNumber" class="text-danger"></span>
            </div>

            <div class="form-floating mb-3">
                <input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" placeholder="name@example.com" />
                <label asp-for="Input.Email">Email</label>
                <span asp-validation-for="Input.Email" class="text-danger"></span>
            </div>
            <div class="form-floating mb-3">
                <input asp-for="Input.Password" class="form-control" autocomplete="new-password" aria-required="true" placeholder="password" />
                <label asp-for="Input.Password">Password</label>
                <span asp-validation-for="Input.Password" class="text-danger"></span>
            </div>
            <div class="form-floating mb-3">
                <input asp-for="Input.ConfirmPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="password" />
                <label asp-for="Input.ConfirmPassword">Confirm Password</label>
                <span asp-validation-for="Input.ConfirmPassword" class="text-danger"></span>
            </div>
            <button id="registerSubmit" type="submit" class="w-100 btn btn-lg btn-primary">Registrar Usuario</button>
        </form>
    </div>
    @*<div class="col-md-6 col-md-offset-2">
        <section>
            <h3>Use another service to register.</h3>
            <hr />
            @{
                if ((Model.ExternalLogins?.Count ?? 0) == 0)
                {
                    <div>
                        <p>
                            There are no external authentication services configured. See this <a href="https://go.microsoft.com/fwlink/?LinkID=532715">article
                            about setting up this ASP.NET application to support logging in via external services</a>.
                        </p>
                    </div>
                }
                else
                {
                    <form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="form-horizontal">
                        <div>
                            <p>
                                @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>
                                }
                            </p>
                        </div>
                    </form>
                }
            }
        </section>
    </div>*@
</div>

@section Scripts {
    <partial name="_ValidationScriptsPartial" />
}
