-
Notifications
You must be signed in to change notification settings - Fork 3
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
8 changed files
with
98 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"prefix": "REQUESTS_PAGE", | ||
"en": { | ||
"Title": "Requests", | ||
"State": "State", | ||
"NoRequests": "No requests available" | ||
}, | ||
"de": { | ||
"Title": "Haltewünsche", | ||
"State": "Status", | ||
"NoRequests": "Keine Haltewünsche verfügbar" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!-- | ||
Generated template for the RequestsPage page. | ||
See http://ionicframework.com/docs/v2/components/#navigation for more info on | ||
Ionic pages and navigation. | ||
--> | ||
<ion-navbar *navbar> | ||
<ion-title>{{ 'REQUESTS_PAGE.Title' | translate }}</ion-title> | ||
</ion-navbar> | ||
|
||
<ion-content padding class="requests"> | ||
<ion-refresher (ionRefresh)="doRefresh($event)"> | ||
<ion-refresher-content pullingText="{{'C.PullToRefresh' | translate}}" refreshingText="{{'C.Refreshing' | translate}}"> | ||
</ion-refresher-content> | ||
</ion-refresher> | ||
<div *ngIf="empty" id="noRequests">{{ 'REQUESTS_PAGE.NoRequests' | translate }}<p>{{'C.PullToRefresh' | translate}}</p></div> | ||
<ion-card *ngFor="let request of requests"> | ||
<ion-card-header> | ||
ID: {{request.is}} | ||
</ion-card-header> | ||
<ion-card-content> | ||
{{ 'REQUESTS_PAGE.State' | translate }}: {{request.state}} | ||
</ion-card-content> | ||
</ion-card> | ||
</ion-content> |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.requests { | ||
#noRequests { | ||
text-align: center; | ||
margin-top: 10px; | ||
font-size: 15px; | ||
p { | ||
margin-top: 10px; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Component, ElementRef } from '@angular/core'; | ||
import { NavController, Refresher } from 'ionic-angular'; | ||
import {ViewRequestState} from '../models'; | ||
import {TransformationService} from '../../providers/transformation'; | ||
|
||
/* | ||
Generated class for the RequestsPage page. | ||
See http://ionicframework.com/docs/v2/components/#navigation for more info on | ||
Ionic pages and navigation. | ||
*/ | ||
@Component({ | ||
templateUrl: 'build/pages/requests/requests.html', | ||
}) | ||
export class RequestsPage { | ||
private requests: Array<ViewRequestState>; | ||
// The length or ! check does not work in the template :/ | ||
private empty: boolean; | ||
constructor(private element: ElementRef, private nav: NavController, private dataAccess: TransformationService) { | ||
this.doRefresh(); | ||
} | ||
|
||
public doRefresh(refresher?: Refresher) { | ||
this.dataAccess.getRequests().subscribe((reqs: Array<ViewRequestState>) => { | ||
this.empty = false; | ||
if (reqs.length === 0) { | ||
this.empty = true; | ||
} | ||
this.requests = reqs; | ||
if (refresher) { | ||
refresher.complete(); | ||
} | ||
}); | ||
} | ||
|
||
ionViewWillEnter() { | ||
this.element.nativeElement.removeAttribute('hidden'); | ||
} | ||
|
||
ionViewDidLeave() { | ||
this.element.nativeElement.setAttribute('hidden', ''); | ||
} | ||
} |
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