-
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.
- Loading branch information
Showing
13 changed files
with
151 additions
and
106 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
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
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
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
48 changes: 45 additions & 3 deletions
48
frontend/src/app/component/admin/manage-loans/manage-loans.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,3 +1,45 @@ | ||
<p> | ||
manage-loans works! | ||
</p> | ||
<section class="content-header"> | ||
<h1>Administración de préstamos <small>Administra los préstamos de los recursos</small></h1> | ||
</section> | ||
|
||
<section class="content"> | ||
<table class="table table-bordered table-striped" style="background-color: white !important;"> | ||
<thead> | ||
<tr> | ||
<th width="20%">Identificador</th> | ||
<th width="20%">Usuario</th> | ||
<th>Recurso</th> | ||
<th>Petición</th> | ||
<th>Préstamo</th> | ||
<th>Devolución</th> | ||
<th>Administrar</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr *ngFor="let loan of loans"> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td> | ||
<a> | ||
<button type="button" class="btn btn-primary"><span class="fa fa-bookmark-o"></span> Prestar</button> | ||
</a> | ||
</td> | ||
<td> | ||
<a> | ||
<button type="button" class="btn btn-primary"><span class="fa fa-bookmark"></span> Devolución</button> | ||
</a> | ||
</td> | ||
<td> | ||
<a> | ||
<button type="button" class="btn btn-warning"><span class="fa fa-trash"></span></button> | ||
</a> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<a> | ||
<button type="button" class="btn btn-primary"><span class="fa fa-plus-circle"> </span> Añadir préstamo</button> | ||
</a> | ||
</section> |
16 changes: 13 additions & 3 deletions
16
frontend/src/app/component/admin/manage-loans/manage-loans.component.ts
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,15 +1,25 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
import { ActionService } from 'app/service/action.service' | ||
|
||
@Component({ | ||
selector: 'app-manage-loans', | ||
templateUrl: './manage-loans.component.html', | ||
styleUrls: ['./manage-loans.component.css'] | ||
}) | ||
export class ManageLoansComponent implements OnInit { | ||
|
||
constructor() { } | ||
private loans: Object[] = []; | ||
|
||
ngOnInit() { | ||
constructor(private service: ActionService) { | ||
} | ||
|
||
ngOnInit() { | ||
this.service.getAllActions().subscribe( | ||
loans => { | ||
this.loans = loans; | ||
console.log(this.loans); | ||
}, | ||
error => console.log(error) | ||
); | ||
} | ||
} |
57 changes: 0 additions & 57 deletions
57
frontend/src/app/component/admin/manage-resources/edit/edit.component.1.html
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
frontend/src/app/component/admin/manage-resources/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,3 +1,59 @@ | ||
<section class="content-header"> | ||
<h1>Administraión de recursos<small>Administra los libros o las revistas</small></h1> | ||
</section> | ||
|
||
<section class="content"> | ||
<div class="box box-default"> | ||
<div class="box-header with-border"> | ||
<h3 class="box-title">Editar {{resource?.title}}</h3> | ||
</div> | ||
<div class="box-body"> | ||
<div class="row"> | ||
<form> | ||
<div class="col-md-5 col-lg-3"> | ||
<div class="form-group"> | ||
<!-- | ||
<img src="/img/books/{{ resource.picture }}" alt="" class="img-responsive"> | ||
<img src="/img/noPicture.png" alt="" class="img-responsive"> | ||
<label for="exampleInputFile">Imagen</label> | ||
<input for="exampleInputFile" type="file" name="picture"> | ||
--> | ||
</div> | ||
</div> | ||
|
||
<div class="col-lg-8"> | ||
<div class="form-group"> | ||
<label>Sumario del recurso</label> | ||
<textarea rows="3" cols="50" class="form-control" [(ngModel)]="resource.description"> | ||
</textarea> | ||
</div> | ||
<div class="form-group"> | ||
<label>Autor o compañía</label> | ||
<input type="text" class="form-control" [(ngModel)]="resource.author"> | ||
</div> | ||
<div class="form-group"> | ||
<label>Género literario</label> | ||
<input type="text" class="form-control" [(ngModel)]="resource.genre.name"> | ||
</div> | ||
<div class="form-group"> | ||
<label>Editorial</label> | ||
<input type="text" class="form-control" [(ngModel)]="resource.editorial"> | ||
</div> | ||
<div class="form-group"> | ||
<label>Tipo de recurso</label> | ||
<input type="text" class="form-control" [(ngModel)]="resource.resourceType.name"> | ||
</div> | ||
<div class="form-group"> | ||
<label>Número de copias</label> | ||
<input type="number" class="form-control" [(ngModel)]="resource.copies.length"> | ||
</div> | ||
|
||
<div class="pull-right"> | ||
<button (click)="saveResource()" class="btn btn-success">Guardar</button> | ||
</div> | ||
</div>--> | ||
</form> | ||
</div> | ||
</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
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
25 changes: 7 additions & 18 deletions
25
frontend/src/app/component/admin/manage-resources/manage-resources.component.ts
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,35 +1,24 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Http } from '@angular/http'; | ||
|
||
import { ResourceService } from 'app/service/resource.service'; | ||
|
||
@Component({ | ||
selector: 'app-manage-resources', | ||
templateUrl: './manage-resources.component.html', | ||
styleUrls: ['./manage-resources.component.css'] | ||
}) | ||
export class ManageResourcesComponent implements OnInit { | ||
|
||
private resources: Object[] = []; | ||
|
||
constructor(private http: Http) { | ||
constructor(private service: ResourceService) { | ||
} | ||
|
||
ngOnInit() { | ||
this.getResources(); | ||
} | ||
|
||
getResources() { | ||
this.resources = []; | ||
let url = "https://localhost:8443/api/resources"; | ||
|
||
this.http.get(url).subscribe( | ||
response => { | ||
let data = response.json().content; | ||
data.forEach(element => { | ||
this.resources.push(element); | ||
}); | ||
this.service.getAllResources().subscribe( | ||
resources => { | ||
this.resources = resources; | ||
}, | ||
error => console.error(error) | ||
error => console.log(error) | ||
); | ||
} | ||
|
||
} |
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
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