-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from cvazquezlos/carlos
Added user management.
- Loading branch information
Showing
16 changed files
with
264 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,5 @@ import { Component } from '@angular/core'; | |
export class AppComponent { | ||
|
||
constructor() { | ||
localStorage.clear(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 60 additions & 61 deletions
121
frontend/src/app/component/admin/manage-users/create/create.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,65 @@ | ||
<div class="content-wrapper"> | ||
<div class="alert alert-danger alert-dismissible" role="alert"> | ||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<section class="content-header"> | ||
<h1> | ||
Administración de usuarios | ||
<small>Administra los usuarios</small> | ||
</h1> | ||
<ol class="breadcrumb"> | ||
<li><a href="/admin/"><i class="fa fa-dashboard"></i> Inicio</a></li> | ||
<li><a href="/admin/users">Usuarios</a></li> | ||
<li class="active">Añadir usuario</li> | ||
</ol> | ||
</section> | ||
<section class="content"> | ||
<div class="box box-default"> | ||
<div class="box-header with-border"> | ||
<h3 class="box-title">Nuevo usuario</h3> | ||
</div> | ||
<div class="box-body"> | ||
<div class="row"> | ||
<div class="col-lg-8"> | ||
<div class="form-group"> | ||
<label>Nombre y apellidos</label> | ||
<br> | ||
<input type="text" class="form-control" style='display: inline; width: 38%;' placeholder="Nombre" | ||
#firstName required> | ||
<input type="text" class="form-control" style='display: inline; width: 30%;' | ||
placeholder="Primer apellido" #lastName1 required> | ||
<input type="text" class="form-control" style='display: inline; width: 30%;' | ||
placeholder="Segundo apellido" #lastName2 required> | ||
</div> | ||
<div class="form-group"> | ||
<label>Usuario</label> | ||
<input type="text" class="form-control" name="name" placeholder="Usuario" #name required> | ||
</div> | ||
<div class="form-group"> | ||
<label>Email</label> | ||
<input type="text" class="form-control" name="email" placeholder="Email" #email required> | ||
</div> | ||
<div class="pull-left"> | ||
<button class="btn btn-success" (click)="create(firstName.value, lastName1.value, lastName2.value, | ||
name.value, email.value, password.value, dni.value, telephone.value)">Registrar</button> | ||
</div> | ||
<div class="alert alert-danger alert-dismissible" role="alert"> | ||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<section class="content-header"> | ||
<h1> | ||
Administración de usuarios | ||
<small>Administra los usuarios</small> | ||
</h1> | ||
<ol class="breadcrumb"> | ||
<li><a href="/admin/"><i class="fa fa-dashboard"></i> Inicio</a></li> | ||
<li><a href="/admin/users">Usuarios</a></li> | ||
<li class="active">Añadir usuario</li> | ||
</ol> | ||
</section> | ||
<section class="content"> | ||
<div class="box box-default"> | ||
<div class="box-header with-border"> | ||
<h3 class="box-title">Nuevo usuario</h3> | ||
</div> | ||
<div class="box-body"> | ||
<div class="row"> | ||
<div class="col-lg-8"> | ||
<div class="form-group"> | ||
<label>Nombre y apellidos</label> | ||
<br> | ||
<input type="text" class="form-control" style='display: inline; width: 38%;' placeholder="Nombre" | ||
#firstName required> | ||
<input type="text" class="form-control" style='display: inline; width: 30%;' | ||
placeholder="Primer apellido" #lastName1 required> | ||
<input type="text" class="form-control" style='display: inline; width: 30%;' | ||
placeholder="Segundo apellido" #lastName2 required> | ||
</div> | ||
<div class="form-group"> | ||
<label>Usuario</label> | ||
<input type="text" class="form-control" name="name" placeholder="Usuario" #name required> | ||
</div> | ||
<div class="form-group"> | ||
<label>Email</label> | ||
<input type="text" class="form-control" name="email" placeholder="Email" #email required> | ||
</div> | ||
<div class="col-lg-2"> | ||
<div class="form-group"> | ||
<label>Contraseña</label> | ||
<input class="form-control" name="password" type="password" placeholder="Contraseña" #password required> | ||
</div> | ||
<div class="form-group"> | ||
<label>D.N.I.</label> | ||
<input class="form-control" name="dni" type="text" #dni placeholder="D.N.I."> | ||
</div> | ||
<div class="form-group"> | ||
<label>Teléfono</label> | ||
<input class="form-control" name="telephone" type="text" #telephone placeholder="Teléfono"> | ||
</div> | ||
</div> | ||
<div class="col-lg-2"> | ||
<div class="form-group"> | ||
<label>D.N.I.</label> | ||
<input class="form-control" name="dni" type="text" #dni placeholder="D.N.I."> | ||
</div> | ||
<div class="form-group"> | ||
<label>Contraseña</label> | ||
<input class="form-control" name="password" type="password" placeholder="Contraseña" #password required> | ||
</div> | ||
<div class="form-group"> | ||
<label>Teléfono</label> | ||
<input class="form-control" name="telephone" type="text" #telephone placeholder="Teléfono"> | ||
</div> | ||
<div class="pull-left"> | ||
<button class="btn btn-success" (click)="create(firstName.value, lastName1.value, lastName2.value, | ||
name.value, email.value, password.value, dni.value, telephone.value)">Registrar | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
</div> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 43 additions & 44 deletions
87
frontend/src/app/component/admin/manage-users/edit/edit.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,47 @@ | ||
<div class="content-wrapper"> | ||
<section class="content-header"> | ||
<h1> | ||
Administración de usuarios | ||
<small>Administra los usuarios</small> | ||
</h1> | ||
<ol class="breadcrumb"> | ||
<li><a [routerLink]="['/admin']"><i class="fa fa-dashboard"></i> Inicio</a></li> | ||
<li><a [routerLink]="['/admin/users']">Usuarios</a></li> | ||
<li class="active">Añadir usuario</li> | ||
</ol> | ||
</section> | ||
<section class="content"> | ||
<div class="box box-default"> | ||
<div class="box-header with-border"> | ||
<h3 class="box-title">Editar {{user?.name}}</h3> | ||
</div> | ||
<div class="box-body"> | ||
<div class="row"> | ||
<div class="col-lg-8"> | ||
<div class="form-group"> | ||
<label>Nombre y apellidos</label> | ||
<br> | ||
<input type="text" class="form-control" name="firstName" style='display: inline; width: 38%;' | ||
#firstName value="{{user?.firstName}}"> | ||
<input type="text" class="form-control" name="lastName1" style='display: inline; width: 30%;' | ||
#lastName1 value="{{user?.lastName1}}"> | ||
<input type="text" class="form-control" name="lastName2" style='display: inline; width: 30%;' | ||
#lastName2 value="{{user?.lastName2}}"> | ||
</div> | ||
<div class="form-group"> | ||
<label>Email</label> | ||
<input type="text" class="form-control" name="email" #email value="{{user?.email}}"> | ||
</div> | ||
<div class="form-group"> | ||
<label>DNI</label> | ||
<input type="text" class="form-control" name="dni" #dni value="{{user?.dni}}"> | ||
</div> | ||
<div class="pull-right"> | ||
<button type="submit" class="btn btn-success" (click)="edit(firstName.value, lastName1.value, | ||
lastName2.value, email.value, dni.value)">Modificar</button> | ||
</div> | ||
<section class="content-header"> | ||
<h1> | ||
Administración de usuarios | ||
<small>Administra los usuarios</small> | ||
</h1> | ||
<ol class="breadcrumb"> | ||
<li><a [routerLink]="['/admin']"><i class="fa fa-dashboard"></i> Inicio</a></li> | ||
<li><a [routerLink]="['/admin/users']">Usuarios</a></li> | ||
<li class="active">Modificar usuario</li> | ||
</ol> | ||
</section> | ||
<section class="content"> | ||
<div class="box box-default"> | ||
<div class="box-header with-border"> | ||
<h3 class="box-title">Editar {{user?.name}}</h3> | ||
</div> | ||
<div class="box-body"> | ||
<div class="row"> | ||
<div class="col-lg-8"> | ||
<div class="form-group"> | ||
<label>Nombre y apellidos</label> | ||
<br> | ||
<input type="text" class="form-control" name="firstName" style='display: inline; width: 38%;' | ||
#firstName value="{{user?.firstName}}"> | ||
<input type="text" class="form-control" name="lastName1" style='display: inline; width: 30%;' | ||
#lastName1 value="{{user?.lastName1}}"> | ||
<input type="text" class="form-control" name="lastName2" style='display: inline; width: 30%;' | ||
#lastName2 value="{{user?.lastName2}}"> | ||
</div> | ||
<div class="form-group"> | ||
<label>Email</label> | ||
<input type="text" class="form-control" name="email" #email value="{{user?.email}}"> | ||
</div> | ||
<div class="form-group"> | ||
<label>DNI</label> | ||
<input type="text" class="form-control" name="dni" #dni value="{{user?.dni}}"> | ||
</div> | ||
<div class="pull-right"> | ||
<button type="submit" class="btn btn-success" (click)="edit(firstName.value, lastName1.value, | ||
lastName2.value, email.value, dni.value)">Modificar | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
</div> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
111 changes: 58 additions & 53 deletions
111
frontend/src/app/component/admin/manage-users/manage-users.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,60 @@ | ||
<div class="content-wrapper"> | ||
<div *ngIf="successMessage" class="alert alert-success"> | ||
<strong>¡Eliminado!</strong> {{message}} | ||
</div> | ||
<div *ngIf="errorMessage" class="alert alert-danger"> | ||
<strong>Algo ha ido mal...</strong> {{message}} | ||
</div> | ||
<section class="content-header"> | ||
<h1> | ||
Administración de usuarios | ||
<small>Administra los usuarios</small> | ||
</h1> | ||
<ol class="breadcrumb"> | ||
<li><a [routerLink]="['/admin']"><i class="fa fa-dashboard"></i> Inicio</a></li> | ||
<li class="active">Usuarios</li> | ||
</ol> | ||
</section> | ||
<section class="content"> | ||
<table class="table table-bordered table-striped" style="background-color: white !important;"> | ||
<thead> | ||
<div *ngIf="successMessage" class="alert alert-success"> | ||
<strong>¡Eliminado!</strong> {{message}} | ||
</div> | ||
<div *ngIf="errorMessage" class="alert alert-danger"> | ||
<strong>Algo ha ido mal...</strong> {{message}} | ||
</div> | ||
<section class="content-header"> | ||
<h1> | ||
Administración de usuarios | ||
<small>Administra los usuarios</small> | ||
</h1> | ||
<ol class="breadcrumb"> | ||
<li><a [routerLink]="['/admin']"><i class="fa fa-dashboard"></i> Inicio</a></li> | ||
<li class="active">Usuarios</li> | ||
</ol> | ||
</section> | ||
<section class="content"> | ||
<table class="table table-bordered table-striped" style="background-color: white !important;"> | ||
<thead> | ||
<tr> | ||
<th width="20%">Nombre y apellidos</th> | ||
<th width="20%">Usuario</th> | ||
<th width="5%">Rol(es)</th> | ||
<th width="5%">Multas</th> | ||
<th width="5%">Préstamos</th> | ||
<th width="3%">Administrar</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<ng-template ngFor let-user [ngForOf]="users"> | ||
<tr> | ||
<th>Nombre y apellidos</th> | ||
<th>Usuario</th> | ||
<th>Rol(es)</th> | ||
<th>Multas</th> | ||
<th>Préstamos</th> | ||
<th>Administrar</th> | ||
<td>{{user?.firstName}} {{user?.lastName1}} {{user?.lastName2}}</td> | ||
<td>{{user?.name}}</td> | ||
<td>{{user?.roles?.length}}</td> | ||
<td>{{user.penalties?.length}}</td> | ||
<td>{{user.actions?.length}}</td> | ||
<td> | ||
<a [routerLink]="['./',user.id]"> | ||
<button type="button" class="btn btn-success"><span class="fa fa-pencil"></span></button> | ||
</a> | ||
| ||
<button type="button" class="btn btn-warning" (click)="delete(user.id)"><span class="fa fa-trash"></span> | ||
</button> | ||
</td> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<ng-template ngFor let-user [ngForOf]="users"> | ||
<tr> | ||
<td>{{user.firstName}} {{user.lastName1}} {{user.lastName2}}</td> | ||
<td>{{user.name}}</td> | ||
<td>{{user.roles?.length}}</td> | ||
<td>{{user.penalties?.length}}</td> | ||
<td>{{user.actions?.length}}</td> | ||
<td> | ||
<a [routerLink]="['/user',user.id]"> | ||
<button type="button" class="btn btn-success"><span class="fa fa-pencil"></span></button> | ||
</a> | ||
| ||
<button type="button" class="btn btn-warning" (click)="delete(user.id)"><span class="fa fa-trash"></span> | ||
</button> | ||
</td> | ||
</tr> | ||
</ng-template> | ||
</tbody> | ||
</table> | ||
<a [routerLink]="['/user/new']"> | ||
<button type="button" class="btn btn-primary"><span class="fa fa-plus-circle"> </span> Añadir usuario | ||
</button> | ||
</a> | ||
</section> | ||
</div> | ||
</ng-template> | ||
</tbody> | ||
</table> | ||
<div> | ||
<div class="pull-left"> | ||
<a [routerLink]="['/admin/users/new']"> | ||
<button type="button" class="btn btn-primary"><span class="fa fa-plus-circle"> </span> Añadir usuario</button> | ||
</a> | ||
</div> | ||
<div class="pull-right"> | ||
<button *ngIf="showPreviousPage" type="button" class="btn btn-primary" (click)="previousPage()">⇦</button> | ||
<button *ngIf="showNextPage" type="button" class="btn btn-primary" (click)="nextPage()">⇨</button> | ||
</div> | ||
</div> | ||
</section> |
Oops, something went wrong.