Skip to content

Commit

Permalink
Added register.
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelcanosantana committed Nov 26, 2023
1 parent 8d0274d commit 0844e70
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Layout/NavBar.razor
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
@if(UserService.GetLoggedUser() == null)
{
<li class="nav-item">
<NavLink class="nav-link" href="counter">
<NavLink class="nav-link" href="register">
Crear Cuenta de Afiliado
</NavLink>
</li>
Expand Down
4 changes: 3 additions & 1 deletion Model/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ public class User
{
private String id;
private String name;
private String surnames;
private String email;
private String password;

public User(String name, String email, String password)
public User(String name, String surnames, String email, String password)
{
id = Guid.NewGuid().ToString();
this.name = name;
this.surnames = surnames;
this.email = email;
this.password = password;
}
Expand Down
13 changes: 1 addition & 12 deletions Pages/Login.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

<!-- Bindings explained: https://stackoverflow.com/questions/58221915/difference-between-bind-and-bind-value -->
<!-- Bindings explained: https://stackoverflow.com/questions/58221915/difference-between-bind-and-bind-value -->

@page "/login"

Expand Down Expand Up @@ -37,12 +36,6 @@
</div>
<button type="submit" class="btn button-gold-a">Continuar</button>

<!-- TODO Delete test -->
<p>Test</p>
<p>@email</p>
<p>@password</p>
<p>@isRememberingUser</p>

</form>

</div>
Expand All @@ -53,10 +46,6 @@
</div>






@code {
private String email = "";
private String password = "";
Expand Down
64 changes: 64 additions & 0 deletions Pages/Register.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!-- Bindings explained: https://stackoverflow.com/questions/58221915/difference-between-bind-and-bind-value -->
@page "/register"

<PageTitle>Registrarse | Cirsa</PageTitle>


<div class="container py-4 jumbotron-a">


<div class="container">
<div class="row">

<div class="col-12 col-md-6">
<h1 class="display-5 fw-bold">Registrarse </h1>
<p>
Regístrate como nuevo usuario para acceder al panel administrativo.
</p>
</div>

<div class="col-12 col-md-6">

<form class="user-form">

<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Nombre</label>
<input @bind-value="name" @bind-value:event="oninput" type="email" class="form-control" id="emailInput" required>
</div>

<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Apellido/s</label>
<input @bind-value="surnames" @bind-value:event="oninput" type="email" class="form-control" id="emailInput" required>
</div>

<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Email</label>
<input @bind-value="email" @bind-value:event="oninput" type="email" class="form-control" id="emailInput" required>
</div>
<div class="mb-3">
<label for="exampleInputPassword1" class="form-label">Contraseña</label>
<input @bind-value="password" @bind-value:event="oninput" type="password" class="form-control" id="passwordInput" minlength="8" required>
</div>
<div class="mb-3 form-check">
<input @bind="isRememberingUser" type="checkbox" class="form-check-input" id="rememberUserCheck">
<label class="form-check-label" for="exampleCheck1">Recordar usuario</label>
</div>
<button type="submit" class="btn button-gold-a">Continuar</button>

</form>

</div>

</div>
</div>

</div>


@code {
private String name = "";
private String surnames = "";
private String email = "";
private String password = "";
private bool isRememberingUser = false;
}

0 comments on commit 0844e70

Please sign in to comment.