ildar-shaymukhametov_grandnode-refactorings/Grand.Web/Views/Customer/Login.cshtml
@model LoginModel
@inject IWebHelper webHelper
@inject IPageHeadBuilder pagebuilder
@{
    Layout = "_ColumnsOneClean";

    //title
    pagebuilder.AddTitleParts(T("PageTitle.Login").Text);

    //register URL with return URL (if specified)
    var registerUrl = Url.RouteUrl("Register", new { returnUrl = this.Context.Request.Query["returnUrl"] });
}
<div class="page login-page">
    <partial name="_ExternalAuthentication.Errors" />
    <div class="mb-2">
        <div class="row flex-md-row justify-content-center text-center my-3">
            @* login main block *@
            <div class="col-sm-8 col-12">
                <div class="card p-3 bg-light">
                    <form asp-route="Login" asp-route-returnurl="@Context.Request.Query["ReturnUrl"]" method="post">
                        <h5 class="card-header"><strong>@T("Account.Login.ReturningCustomer")</strong></h5>
                        <div class="card-body">
                            <div class="row">
                                <div asp-validation-summary="ModelOnly" class="message-error w-100 text-center">@T("Account.Login.Unsuccessful")</div>
                                <div class="col-12 form-group mb-0">
                                    @if (Model.UsernamesEnabled)
                                    {
                                        <div class="form-group row">
                                            <div class="col-lg-3 col-12 d-flex align-items-start justify-content-sm-start">
                                                <label asp-for="Username" class="h5 m-0">@T("Account.Login.Fields.UserName"):</label>
                                            </div>
                                            <div class="col-lg-9 col-12">
                                                <input asp-for="Username" class="form-control username" autofocus="autofocus" />
                                                <span asp-validation-for="Username"></span>
                                            </div>
                                        </div>
                                    }
                                    else
                                    {
                                        <div class="form-group row">
                                            <div class="col-lg-3 col-12 d-flex align-items-start justify-content-start">
                                                <label asp-for="Email" class="h5 m-0">@T("Account.Login.Fields.Email"):</label>
                                            </div>
                                            <div class="col-lg-9 col-12">
                                                <input asp-for="Email" class="form-control email" autofocus="autofocus" />
                                                <span asp-validation-for="Email"></span>
                                            </div>
                                        </div>
                                    }
                                    <div class="form-group row">
                                        <div class="col-lg-3 col-12 d-flex align-items-center justify-content-start">
                                            <label asp-for="Password" class="h5 m-0">@T("Account.Login.Fields.Password"):</label>
                                        </div>
                                        <div class="col-lg-9 col-12">
                                            <input asp-for="Password" class="form-control password" />
                                            <span asp-validation-for="Password"></span>
                                        </div>
                                    </div>
                                    <div class="inputs d-flex flex-sm-row flex-column justify-content-center">
                                        <label class="custom-control custom-checkbox">
                                            <input class="custom-control-input" asp-for="RememberMe" />
                                            <input class="custom-control-label" name="RememberMe" type="hidden" value="false">
                                            <span class="custom-control-label"></span>
                                            <span class="custom-control-description">@T("Account.Login.Fields.RememberMe")</span>
                                        </label>
                                        <span class="ml-3 forgot-password">
                                            <a asp-route="PasswordRecovery">@T("Account.Login.ForgotPassword")</a>
                                        </span>
                                    </div>
                                    @if (Model.DisplayCaptcha)
                                    {
                                        <div class="captcha-box">
                                            <captcha />
                                        </div>
                                    }
                                </div>
                            </div>
                        </div>
                        <div class="card-footer px-0">
                            <div class="buttons">
                                <input class="btn btn-info login-button px-5" type="submit" value="@T("Account.Login.LoginButton")" />
                            </div>
                        </div>
                    </form>
                    <div class="external-authentication">
                        @await Component.InvokeAsync("ExternalMethods")
                    </div>
                </div>
            </div>
            @if (Model.CheckoutAsGuest)
            {
                <div class="col-sm-8 col-12 new-wrapper checkout-as-guest-or-register-block mt-2">
                    <h5 class="pt-1">
                        <strong>@T("Account.Login.CheckoutAsGuestOrRegister")</strong>
                    </h5>
                    <div class="buttons mt-1 areYouGuest">
                        <input type="button" class="btn btn-secondary checkout-as-guest-button" onclick="location.href='@Url.RouteUrl("Checkout")'" value="@T("Account.Login.CheckoutAsGuest")" />
                        <input type="button" class="btn btn-secondary register-button" onclick="location.href='@registerUrl'" value="@T("Account.Register")" />
                    </div>
                </div>
            }
            else
            {
                <div class="col-sm-8 col-12">
                    <div class="card-body register-block">
                        <h5>
                            <strong>
                                @T("Account.Login.NewCustomer")</strong></h5>
                                <div class="d-inline-flex align-items-center justify-content-center w-100">
                                    <a class="btn btn-info register-button px-5" href="@registerUrl">
                                        @T("Account.Register")
                                    </a>
                                </div>
                    </div>
                </div>
            }
        </div>
    </div>
</div>
