Skip to content

Commit

Permalink
Some cleanup and made register page
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarmisuper committed Nov 9, 2023
1 parent 2280301 commit 6f4847c
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 53 deletions.
82 changes: 40 additions & 42 deletions ChatRPG/Areas/Identity/Pages/Account/Login.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,46 @@
@{
ViewData["Title"] = "Log in";
}
<div class="pt-4 pb-4" style="background-color: #232323; color: white">
<h1 class="text-center" style="color: white">@ViewData["Title"]</h1>
<div class="row d-flex align-items-center justify-content-center">
<div class="col-md-8">
<section>
<form id="account" method="post">
<hr />
<div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div>
<div class="form-floating mb-3">
<input asp-for="Input.Username" class="form-control" autocomplete="username" aria-required="true" placeholder="username" />
<label asp-for="Input.Username" class="form-label" style="color: black">Username</label>
<span asp-validation-for="Input.Username" class="text-danger"></span>
</div>
<div class="form-floating mb-3">
<input asp-for="Input.Password" class="form-control" autocomplete="current-password" aria-required="true" placeholder="password" />
<label asp-for="Input.Password" class="form-label" style="color: black">Password</label>
<span asp-validation-for="Input.Password" class="text-danger"></span>
</div>
<div class="checkbox mb-3">
<label asp-for="Input.RememberMe" class="form-label">
<input class="form-check-input" asp-for="Input.RememberMe" />
@Html.DisplayNameFor(m => m.Input.RememberMe)
</label>
</div>
<div>
<button id="login-submit" type="submit" class="w-100 btn btn-lg" style="background-color: #4eb758; color: black; border-color: black">Log in</button>
</div>
<div>
<p>
<a id="forgot-password" asp-page="./ForgotPassword">Forgot your password?</a>
</p>
<p>
Not a member yet? Create an account
<a asp-page="./Register" asp-route-returnUrl="@Model.ReturnUrl">here</a>
</p>
<!--<p>
<a id="resend-confirmation" asp-page="./ResendEmailConfirmation">Resend email confirmation</a>
</p>-->
</div>
</form>
</section>
</div>
<h1 class="text-center">@ViewData["Title"]</h1>
<div class="row d-flex justify-content-center">
<div class="col-md-8">
<section>
<form id="account" method="post">
<hr />
<div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div>
<div class="form-floating mb-3">
<input asp-for="Input.Username" class="form-control" autocomplete="username" aria-required="true" placeholder="username" />
<label asp-for="Input.Username" class="form-label" style="color: black">Username</label>
<span asp-validation-for="Input.Username" class="text-danger"></span>
</div>
<div class="form-floating mb-3">
<input asp-for="Input.Password" class="form-control" autocomplete="current-password" aria-required="true" placeholder="password" />
<label asp-for="Input.Password" class="form-label" style="color: black">Password</label>
<span asp-validation-for="Input.Password" class="text-danger"></span>
</div>
<div class="checkbox mb-3">
<label asp-for="Input.RememberMe" class="form-label">
<input class="form-check-input" asp-for="Input.RememberMe" />
@Html.DisplayNameFor(m => m.Input.RememberMe)
</label>
</div>
<div>
<button id="login-submit" type="submit" class="w-100 btn btn-lg" style="background-color: #4eb758; color: black; border-color: black">Log in</button>
</div>
<div>
<p>
<a id="forgot-password" asp-page="./ForgotPassword">Forgot your password?</a>
</p>
<p>
Not a member yet? Create an account
<a asp-page="./Register" asp-route-returnUrl="@Model.ReturnUrl">here</a>
</p>
<!--<p>
<a id="resend-confirmation" asp-page="./ResendEmailConfirmation">Resend email confirmation</a>
</p>-->
</div>
</form>
</section>
</div>
</div>
@section Scripts {
Expand Down
16 changes: 8 additions & 8 deletions ChatRPG/Areas/Identity/Pages/Account/Register.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@
ViewData["Title"] = "Register";
}

<h1>@ViewData["Title"]</h1>
<h1 class="text-center">@ViewData["Title"]</h1>

<div class="row">
<div class="col-md-4">
<div class="row d-flex justify-content-center">
<div class="col-md-8">
<form id="registerForm" asp-route-returnUrl="@Model.ReturnUrl" method="post">
<hr />
<div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div>
<div class="form-floating mb-3">
<input asp-for="Input.Username" class="form-control" autocomplete="username" aria-required="true" placeholder="username" />
<label asp-for="Input.Username">Username</label>
<label asp-for="Input.Username" style="color: black">Username</label>
<span asp-validation-for="Input.Username" class="text-danger"></span>
</div>
<div class="form-floating mb-3">
<input asp-for="Input.Email" class="form-control" autocomplete="email" aria-required="true" placeholder="name@example.com" />
<label asp-for="Input.Email">Email</label>
<label asp-for="Input.Email" style="color: black">Email</label>
<span asp-validation-for="Input.Email" class="text-danger"></span>
</div>
<div class="form-floating mb-3">
<input asp-for="Input.ConfirmEmail" class="form-control" autocomplete="email" aria-required="true" placeholder="name@example.com" />
<label asp-for="Input.ConfirmEmail">Confirm Email</label>
<label asp-for="Input.ConfirmEmail" style="color: black">Confirm Email</label>
<span asp-validation-for="Input.ConfirmEmail" 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>
<label asp-for="Input.Password" style="color: black">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>
<label asp-for="Input.ConfirmPassword" style="color: black">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" style="background-color: #4eb758; color: black; border-color: black">Register</button>
Expand Down
4 changes: 2 additions & 2 deletions ChatRPG/Areas/Identity/Pages/Shared/_LoginPartial.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
@if (SignInManager.IsSignedIn(User))
{
<li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity?.Name!</a>
<a class="nav-link text-light" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity?.Name!</a>
</li>
<li class="nav-item">
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="/" method="post">
<button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
<button type="submit" class="nav-link btn btn-link text-light">Logout</button>
</form>
</li>
}
Expand Down
2 changes: 1 addition & 1 deletion ChatRPG/Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</header>

<div class="container mt-5 h-75 d-flex align-items-center">
<main role="main" class="flex-grow-1">
<main role="main" class="pt-4 pb-4 flex-grow-1" style="background-color: #232323; color: white">
@RenderBody()
</main>
</div>
Expand Down

0 comments on commit 6f4847c

Please sign in to comment.