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 22, 2017
2 parents 6f25117 + 856353c commit 086c857
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,18 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.fasterxml.jackson.annotation.JsonView;

import appSpring.model.Fine;
import appSpring.model.ResourceCopy;
import appSpring.model.User;

import appSpring.service.UserService;
import appSpring.service.ResourceService;

@RestController
@RequestMapping("/api/files")
public class FileRestController {

public interface FineDetail extends Fine.Basic, Fine.ResoCopy, Fine.Usr, ResourceCopy.Basic, User.Basic {
}

@Autowired
private UserService userService;
@Autowired
private ResourceService resourceService;

@JsonView(FineDetail.class)
@RequestMapping(value = "/user/{id}", method = RequestMethod.GET)
public ResponseEntity<String> getUserfile(@PathVariable int id, Authentication authentication, HttpSession session,
HttpServletRequest request) throws IOException {
Expand All @@ -48,7 +38,6 @@ public ResponseEntity<String> getUserfile(@PathVariable int id, Authentication a
}
}

@JsonView(FineDetail.class)
@RequestMapping(value = "/resource/{id}", method = RequestMethod.GET)
public ResponseEntity<String> getResourceFile(@PathVariable int id, Authentication authentication, HttpSession session,
HttpServletRequest request) throws IOException {
Expand Down
Binary file modified backend/target/appSpring-0.0.1.jar
Binary file not shown.
Binary file modified backend/target/appSpring-0.0.1.jar.original
Binary file not shown.
2 changes: 1 addition & 1 deletion backend/target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by Apache Maven
#Fri Apr 07 18:09:30 CEST 2017
#Sun Apr 23 00:32:37 CEST 2017
version=0.0.1
groupId=es.urjc.daw
artifactId=appSpring
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h1>Book Reserve System Management</h1>
{{sessionService.user?.name}}</button>
<ul class="dropdown-menu">
<li><a [routerLink]="['/profile']" (click)="update('profile')">Perfil <span class="glyphicon glyphicon-user"></span></a>
<li *ngIf="sessionService.isAdmin"><a [routerLink]="['/admin']" (click)="select()">Panel de administración <span class="glyphicon glyphicon-cog"></span></a></li>
<li *ngIf="sessionService.isAdmin"><a [routerLink]="['/admin']">Panel de administración <span class="glyphicon glyphicon-cog"></span></a></li>
<li><a href="#" (click)="logOut()">Cerrar sesión <span class="glyphicon glyphicon-log-out"></span></a></li>
</ul>
</div>
Expand Down
150 changes: 82 additions & 68 deletions frontend/src/app/component/public/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,100 +17,114 @@
<ngb-tab title="Libros">
<template ngbTabContent>
<div class="listItems">
<ng-template ngFor let-book [ngForOf]="books">
<div class="row item">
<div class="col-sm-12 col-md-4 col-lg-3">
<div class="coverItem">
<div *ngIf="book.image == undefined; else chargedImage">
<img src="../../../../assets/img/loadingImages.svg" width="50px" height="50px" align="middle">
</div>
<ng-template #chargedImage>
<img [src]="sanitizer.bypassSecurityTrustUrl(book.image)" class="img-responsive" />
</ng-template>
<div>
<div *ngIf="isLogged">
<div>
<div *ngIf="book.avaiblereserve; else notEnough">
<button (click)="reserveResource(book)" class="btn btn-reserve">Reservar</button>
<div *ngIf="books.length == 0; else chargedBooks">
<img src="../../../../assets/img/loadingElements.gif" style="margin-left: 40%;">
</div>
<ng-template #chargedBooks>
<ng-template ngFor let-book [ngForOf]="books">
<div class="row item">
<div class="col-sm-12 col-md-4 col-lg-3">
<div class="coverItem">
<div *ngIf="book.image == undefined; else chargedImage">
<img src="../../../../assets/img/loadingImages.svg" width="50px" height="50px" align="middle">
</div>
<ng-template #chargedImage>
<img [src]="sanitizer.bypassSecurityTrustUrl(book.image)" class="img-responsive"/>
</ng-template>
<div>
<div *ngIf="isLogged">
<div>
<div *ngIf="book.avaiblereserve; else notEnough">
<button (click)="reserveResource(book)" class="btn btn-reserve">Reservar</button>
</div>
<ng-template #notEnough>
<p class="btn btn-notEnough">No disponible</p>
</ng-template>
</div>
<ng-template #notEnough>
<p class="btn btn-notEnough">No disponible</p>
</ng-template>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-md-8 col-lg-7 informationItem">
<h3 class="title">{{book.title}}</h3>
<h5 class="authorName">por {{book.author}}</h5>
<div class="description">
<p>
{{book.description}}
<span>...</span>
<a [routerLink]="['/resource',book.id]"> <span class="moreInfo">+ info</span> </a>
</p>
<div class="available stockAvailable">
<span class="glyphicon glyphicon-ok-circle"></span>
<span class="textAvailable">Disponible</span>
<div class="col-sm-12 col-md-8 col-lg-7 informationItem">
<h3 class="title">{{book.title}}</h3>
<h5 class="authorName">por {{book.author}}</h5>
<div class="description">
<p>
{{book.description}}
<span>...</span>
<a [routerLink]="['/resource',book.id]"> <span class="moreInfo">+ info</span> </a>
</p>
<div class="available stockAvailable">
<span class="glyphicon glyphicon-ok-circle"></span>
<span class="textAvailable">Disponible</span>
</div>
</div>
</div>
</div>
</ng-template>
<div *ngIf="moreBooksActive">
<button (click)="addBooks(true)" type="button" class="btn btn-lg btn-block btn-view-more">Ver más
libros
</button>
</div>
</ng-template>
<div *ngIf="moreBooksActive">
<button (click)="addBooks(true)" type="button" class="btn btn-lg btn-block btn-view-more">Ver más libros</button>
</div>
</div>
</template>
</ngb-tab>
<ngb-tab title="Revistas">
<template ngbTabContent>
<div class="listItems">
<ng-template ngFor let-magazine [ngForOf]="magazines">
<div class="row item">
<div class="col-sm-12 col-md-4 col-lg-3">
<div class="coverItem">
<div *ngIf="magazine.image == undefined; else chargedImage">
<img src="../../../../assets/img/loadingImages.svg" width="50px" height="50px" align="middle">
</div>
<ng-template #chargedImage>
<img [src]="sanitizer.bypassSecurityTrustUrl(magazine.image)" class="img-responsive" />
</ng-template>
<div>
<div *ngIf="isLogged">
<div>
<div *ngIf="magazine.avaiblereserve; else notEnough">
<button (click)="reserveResource(magazine)" class="btn btn-reserve">Reservar</button>
<div *ngIf="magazines.length == 0; else chargedMagazines">
<img src="../../../../assets/img/loadingElements.gif" style="margin-left: 40%;">
</div>
<ng-template #chargedMagazines>
<ng-template ngFor let-magazine [ngForOf]="magazines">
<div class="row item">
<div class="col-sm-12 col-md-4 col-lg-3">
<div class="coverItem">
<div *ngIf="magazine.image == undefined; else chargedImage">
<img src="../../../../assets/img/loadingImages.svg" width="50px" height="50px" align="middle">
</div>
<ng-template #chargedImage>
<img [src]="sanitizer.bypassSecurityTrustUrl(magazine.image)" class="img-responsive"/>
</ng-template>
<div>
<div *ngIf="isLogged">
<div>
<div *ngIf="magazine.avaiblereserve; else notEnough">
<button (click)="reserveResource(magazine)" class="btn btn-reserve">Reservar</button>
</div>
<ng-template #notEnough>
<p class="btn btn-notEnough">No disponible</p>
</ng-template>
</div>
<ng-template #notEnough>
<p class="btn btn-notEnough">No disponible</p>
</ng-template>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-md-8 col-lg-7 informationItem">
<h3 class="title">{{magazine.title}}</h3>
<h5 class="authorName">por {{magazine.author}}</h5>
<div class="description">
<p>
{{magazine.description}}
<span>...</span>
<a [routerLink]="['/resource',magazine.id]"> <span class="moreInfo">+ info</span> </a>
</p>
<div class="available stockAvailable">
<span class="glyphicon glyphicon-ok-circle"></span>
<span class="textAvailable">Disponible</span>
<div class="col-sm-12 col-md-8 col-lg-7 informationItem">
<h3 class="title">{{magazine.title}}</h3>
<h5 class="authorName">por {{magazine.author}}</h5>
<div class="description">
<p>
{{magazine.description}}
<span>...</span>
<a [routerLink]="['/resource',magazine.id]"> <span class="moreInfo">+ info</span> </a>
</p>
<div class="available stockAvailable">
<span class="glyphicon glyphicon-ok-circle"></span>
<span class="textAvailable">Disponible</span>
</div>
</div>
</div>
</div>
</ng-template>
<div *ngIf="moreMagazActive">
<button (click)="addMagazines(true)" type="button" class="btn btn-lg btn-block btn-view-more">Ver más
revistas
</button>
</div>
</ng-template>
<div *ngIf="moreMagazActive">
<button (click)="addMagazines(true)" type="button" class="btn btn-lg btn-block btn-view-more">Ver más revistas</button>
</div>
</div>
</template>
</ngb-tab>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/app/component/public/user/profile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {FineService} from '../../../service/fine.service';
import {FileService} from '../../../service/file.service';
import {SessionService} from '../../../service/session.service';
import {UserService} from '../../../service/user.service';
import {ModalProfileEdit} from "./modal.profile.component/modal-profile-edit";
import {ModalBiographyEdit} from "./modal.biography.component/modal-biography-edit";
import {ModalProfileEdit} from './modal.profile.component/modal-profile-edit';
import {ModalBiographyEdit} from './modal.biography.component/modal-biography-edit';

@Component({
templateUrl: 'profile.component.html'
Expand Down Expand Up @@ -61,7 +61,7 @@ export class ProfileComponent implements OnInit, DoCheck {
this.currentActionsPage++;
this.downloadImages(resources);
},
error => console.log("Fail trying to charge " + this.user.name + " current loans.")
error => console.log('Fail trying to charge ' + this.user.name + " current loans.")
);
this.fineService.getAllFines(this.finePage).subscribe(
fines => {
Expand Down
Binary file added frontend/src/assets/img/loadingElements.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 086c857

Please sign in to comment.