Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:cvazquezlos/BREMS-Library-App into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jherel committed Apr 20, 2017
2 parents b39da93 + 7fcdf17 commit b4cc1a0
Show file tree
Hide file tree
Showing 32 changed files with 506 additions and 221 deletions.
9 changes: 7 additions & 2 deletions frontend/src/app/app.component.ts
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...');
}

}
5 changes: 1 addition & 4 deletions frontend/src/app/component/admin/admin.component.html
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 &copy; 2017 <a href="/">BREMS</a>.</strong> Todos los derechos reservados.
</footer>
</div>
14 changes: 12 additions & 2 deletions frontend/src/app/component/admin/admin.component.ts
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() {
}

}
3 changes: 2 additions & 1 deletion frontend/src/app/component/admin/admin.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';

import {AdminComponent} from './admin.component';

Expand Down Expand Up @@ -35,7 +36,7 @@ import {DashboardComponent} from './dashboard/dashboard.component';
ManageUsersComponent,
CreateUserComponent,
EditUserComponent,

]
})
export class AdminModule {
Expand Down
Empty file.

This file was deleted.

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 frontend/src/app/component/admin/header/header.component.css

This file was deleted.

26 changes: 16 additions & 10 deletions frontend/src/app/component/admin/header/header.component.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<header class="main-header">

<a [routerLink]="['']" class="logo">
<img [src]="imgLogo" width="50" height="50">
<span class="logo-mini">Book Reserve System</span>
<span class="logo-mini br">Management</span>
<a [routerLink]="['/admin']" class="logo" height="40px">
<img [src]="imgLogo">
<span class="logo-mini">BREMS</span>
</a>

<nav class="navbar navbar-static-top" role="navigation">
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">Menú</span>
Expand All @@ -14,14 +11,23 @@
<ul class="nav navbar-nav">
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="./assets/img/icon-profile.png" class="user-image" alt="User Image">
<span class="hidden-xs"></span>
<div *ngIf="userImage == undefined; else chargedImage">
<img src="../../../../assets/img/loadingImages.svg" width="20px" height="20px" align="middle">
</div>
<ng-template #chargedImage>
<img [src]="sanitizer.bypassSecurityTrustUrl(userImage)" class="user-image" />
</ng-template>
<span class="hidden-xs">{{user?.firstName}} {{user?.lastName1}}</span>
</a>
<ul class="dropdown-menu">
<li class="user-header">
<div class="imgUploaderr">
<img id="myImg" src="./assets/img/icon-profile.png" alt="Tu imagen" />
<input type='file' />
<div *ngIf="userImage == undefined; else chargedImage">
<img src="../../../../assets/img/loadingImages.svg" width="50px" height="50px" align="middle">
</div>
<ng-template #chargedImage>
<img [src]="sanitizer.bypassSecurityTrustUrl(userImage)" class="user-image" />
</ng-template>
</div>
<p>
</p>
Expand Down
25 changes: 0 additions & 25 deletions frontend/src/app/component/admin/header/header.component.spec.ts

This file was deleted.

28 changes: 23 additions & 5 deletions frontend/src/app/component/admin/header/header.component.ts
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.
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>

This file was deleted.

Loading

0 comments on commit b4cc1a0

Please sign in to comment.