-
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 branch 'dev' of github.com:cvazquezlos/BREMS-Library-App into dev
- Loading branch information
Showing
32 changed files
with
506 additions
and
221 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
import { Component } from '@angular/core'; | ||
import {Component, OnDestroy} from '@angular/core'; | ||
|
||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: 'app.component.html', | ||
styleUrls: ['./app.component.css'] | ||
}) | ||
export class AppComponent { | ||
export class AppComponent implements OnDestroy { | ||
|
||
constructor() { | ||
} | ||
|
||
ngOnDestroy() { | ||
console.log('Killing proccesses...'); | ||
} | ||
|
||
} |
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,13 +1,10 @@ | ||
<div class="wrapper"> | ||
<app-admin-header></app-admin-header> | ||
|
||
<app-admin-sidebar></app-admin-sidebar> | ||
|
||
<div class="content-wrapper"> | ||
<router-outlet></router-outlet> | ||
</div> | ||
|
||
<footer class="main-footer "> | ||
<footer class="main-footer"> | ||
<strong>Copyright © 2017 <a href="/">BREMS</a>.</strong> Todos los derechos reservados. | ||
</footer> | ||
</div> |
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,7 +1,17 @@ | ||
import { Component } from '@angular/core'; | ||
import {Component, OnInit} from '@angular/core'; | ||
|
||
import {SessionService} from '../../service/session.service'; | ||
import {UserService} from '../../service/user.service'; | ||
|
||
@Component({ | ||
templateUrl: './admin.component.html' | ||
}) | ||
export class AdminComponent { | ||
export class AdminComponent implements OnInit { | ||
|
||
constructor(private sessionService: SessionService) { | ||
} | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
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.
25 changes: 0 additions & 25 deletions
25
frontend/src/app/component/admin/dashboard/dashboard.component.spec.ts
This file was deleted.
Oops, something went wrong.
11 changes: 8 additions & 3 deletions
11
frontend/src/app/component/admin/dashboard/dashboard.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,20 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import {Router} from '@angular/router'; | ||
|
||
import {SessionService} from '../../../service/session.service'; | ||
|
||
@Component({ | ||
selector: 'app-dashboard', | ||
templateUrl: './dashboard.component.html', | ||
styleUrls: ['./dashboard.component.css'] | ||
templateUrl: 'dashboard.component.html' | ||
}) | ||
export class DashboardComponent implements OnInit { | ||
|
||
constructor() { } | ||
constructor(private router: Router, private sessionService: SessionService) { } | ||
|
||
ngOnInit() { | ||
if (!this.sessionService.checkCredentials()) { | ||
this.router.navigate(["/login"]); | ||
} | ||
} | ||
|
||
} |
35 changes: 0 additions & 35 deletions
35
frontend/src/app/component/admin/header/header.component.css
This file was deleted.
Oops, something went wrong.
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: 0 additions & 25 deletions
25
frontend/src/app/component/admin/header/header.component.spec.ts
This file was deleted.
Oops, something went wrong.
28 changes: 23 additions & 5 deletions
28
frontend/src/app/component/admin/header/header.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,19 +1,37 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import {IMG_URL} from "../../../util"; | ||
import {DomSanitizer} from '@angular/platform-browser'; | ||
import {ADMIN_IMG_URL} from '../../../util'; | ||
|
||
import {User} from '../../../model/user.model'; | ||
|
||
import {FileService} from '../../../service/file.service'; | ||
import {UserService} from '../../../service/user.service'; | ||
|
||
@Component({ | ||
selector: 'app-admin-header', | ||
templateUrl: 'header.component.html', | ||
styleUrls: ['header.component.css'] | ||
templateUrl: 'header.component.html' | ||
}) | ||
export class HeaderComponent implements OnInit { | ||
|
||
public imgLogo = IMG_URL + "logo.png"; | ||
imgLogo = ADMIN_IMG_URL + 'logo.png'; | ||
user: User; | ||
userImage: any; | ||
|
||
constructor() { } | ||
constructor(private fileService: FileService, private sanitizer: DomSanitizer, private userService: UserService) { } | ||
|
||
ngOnInit() { | ||
console.log(Number(localStorage.getItem('id'))); | ||
this.userService.getUser(Number(localStorage.getItem('id'))).subscribe( | ||
user => this.user = user, | ||
error => console.log("Fail trying to get user information.") | ||
); | ||
this.fileService.getUserFile(Number(localStorage.getItem('id'))).subscribe( | ||
data => { | ||
let dataRecieved: string[] = data.split('"'); | ||
this.userImage = 'data:image/png;base64,' + dataRecieved[3]; | ||
}, | ||
error => console.log("Fail trying to charge " + this.user.name + " image.") | ||
); | ||
} | ||
|
||
} |
Empty file.
52 changes: 49 additions & 3 deletions
52
frontend/src/app/component/admin/manage-fines/manage-fines.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,49 @@ | ||
<p> | ||
manage-fines works! | ||
</p> | ||
<section class="content-header"> | ||
<h1> | ||
Administración de multas | ||
<small>Administra las multas de los usuarios</small> | ||
</h1> | ||
<ol class="breadcrumb"> | ||
<li><a href="/admin/"><i class="fa fa-dashboard"></i> Inicio</a></li> | ||
<li class="active">Multas</li> | ||
</ol> | ||
</section> | ||
<section class="content"> | ||
<table class="table table-bordered table-striped" style="background-color: white !important;"> | ||
<thead> | ||
<tr> | ||
<th width="10%">Identificador</th> | ||
<th width="15%">Usuario</th> | ||
<th width="20%">Recurso</th> | ||
<th width="10%">Razón</th> | ||
<th width="20%">Tiempo</th> | ||
<th width="3%">Administrar</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<ng-template ngFor let-fine [ngForOf]="fines"> | ||
<tr> | ||
<td>{{fine?.id}}</td> | ||
<td>{{fine.user?.name}}</td> | ||
<td>{{fine.resourceCopy?.title}}</td> | ||
<td>Default</td> | ||
<td>{{fine?.initDate}} - {{fine?.finishDate}}</td> | ||
<td> | ||
<button type="button" class="btn btn-warning" (click)="delete(fine.id)"> | ||
<span class="fa fa-trash"></span> | ||
</button> | ||
</td> | ||
</tr> | ||
</ng-template> | ||
</tbody> | ||
</table><div> | ||
<div class="pull-right"> | ||
<button *ngIf="showPreviousPage" type="button" class="btn btn-primary" (click)="previousPage()"> | ||
<i class="fa fa-arrow-left" aria-hidden="true"></i> | ||
</button> | ||
<button *ngIf="showNextPage" type="button" class="btn btn-primary" (click)="nextPage()"> | ||
<i class="fa fa-arrow-right" aria-hidden="true"></i> | ||
</button> | ||
</div> | ||
</div> | ||
</section> |
25 changes: 0 additions & 25 deletions
25
frontend/src/app/component/admin/manage-fines/manage-fines.component.spec.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.