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

displaying open/ close status

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