Commit 437da7ca authored by mdsecurity's avatar mdsecurity
Browse files

displaying open/ close status

parent 741a2b5e
...@@ -11,16 +11,27 @@ ...@@ -11,16 +11,27 @@
<div class="place-location">{{place.location}}</div> <div class="place-location">{{place.location}}</div>
</div>--> </div>-->
<div (click)="openInContext()" class="place-card"> <div (click)="openInContext()" class="place-card">
<div class="closed-shader"></div>
<img [src]="url" class="place-picture"> <img [src]="url" class="place-picture">
<div class="title-container"> <div class="title-container">
<div class="place-title">{{place.name | removeBrackets}}</div> <div class="place-title">{{place.name | removeBrackets}}</div>
</div> </div>
<div *ngIf="place.isOpen(); else elseBlock">
<div class="place-open-badge"> <div class="place-open-badge">
<div class="place-status">OPEN</div> <div class="place-status">OPEN</div>
<div class="place-divider"></div> <div class="place-divider"></div>
<div class="place-time-remaining">~{{place.openFor().hour}}Hrs</div> <div class="place-time-remaining">~{{place.openFor().hour}}Hrs</div>
</div> </div>
</div>
<ng-template #elseBlock>
<div class="closed-shader"></div>
<div class="place-open-badge" style="width:102px;background-color:#C4B9B9;">
<div class="place-status">CLOSED</div>
<div class="place-divider"></div>
<div class="place-time-remaining">~{{place.openFor().hour}}Hrs</div>
</div>
</ng-template>
<div class="place-location">{{place.location }}</div> <div class="place-location">{{place.location }}</div>
<div class="place-error-feedback">See an error?</div> <div class="place-error-feedback">See an error?</div>
</div> </div>
...@@ -21,12 +21,13 @@ ...@@ -21,12 +21,13 @@
// image-rendering: crisp-edges; // image-rendering: crisp-edges;
} }
.title-container{ .title-container{
margin:8px 0px 8px 0px; // margin:8px 0px 8px 0px;
height:32px; height:48px;
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
overflow: hidden;
} }
.place-open-badge { .place-open-badge {
...@@ -91,4 +92,5 @@ ...@@ -91,4 +92,5 @@
height: 100%; height: 100%;
opacity: .3; opacity: .3;
background-color: black; background-color: black;
pointer-events: none;
} }
\ No newline at end of file
...@@ -19,9 +19,12 @@ export class PlaceCardComponent implements OnInit { ...@@ -19,9 +19,12 @@ export class PlaceCardComponent implements OnInit {
constructor(private dataProvider: DataProviderService, public dialog: MdDialog,private sanitizer: DomSanitizer) { } constructor(private dataProvider: DataProviderService, public dialog: MdDialog,private sanitizer: DomSanitizer) { }
ngOnInit() { ngOnInit() {
this.url = this.sanitizer.bypassSecurityTrustUrl('https://unsplash.it/200/300?image='+Math.floor((Math.random()*999+1))); this.url = this.sanitizer.bypassSecurityTrustUrl('https://unsplash.it/200/300?image='+Math.floor((Math.random()*999+1)));
} }
openInContext() { openInContext() {
this.dataProvider.setContext(this.place); this.dataProvider.setContext(this.place);
console.log(this.place.openFor().hour+ " "+ this.place.openFor().minute+ " "+ this.place.openFor().second)
} }
openDialog() { openDialog() {
let dialogRef = this.dialog.open(FeedbackDialogComponent); let dialogRef = this.dialog.open(FeedbackDialogComponent);
......
...@@ -6,7 +6,6 @@ import { Pipe, PipeTransform } from '@angular/core'; ...@@ -6,7 +6,6 @@ import { Pipe, PipeTransform } from '@angular/core';
export class RemoveBracketsPipe implements PipeTransform { export class RemoveBracketsPipe implements PipeTransform {
transform(value: string): string { transform(value: string): string {
console.log(value.substr(0, value.indexOf('[')));
const index = value.indexOf('['); const index = value.indexOf('[');
if (index === -1) { if (index === -1) {
return value; return value;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment