Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-web
Commits
437da7ca
Commit
437da7ca
authored
Apr 27, 2017
by
mdsecurity
Browse files
displaying open/ close status
parent
741a2b5e
Changes
4
Show whitespace changes
Inline
Side-by-side
src/app/place-window/area/place-card/place-card.component.html
View file @
437da7ca
...
...
@@ -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
*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>
src/app/place-window/area/place-card/place-card.component.scss
View file @
437da7ca
...
...
@@ -21,12 +21,13 @@
// image-rendering: crisp-edges;
}
.title-container
{
margin
:
8px
0px
8px
0px
;
height
:
32
px
;
//
margin:8px 0px 8px 0px;
height
:
48
px
;
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
src/app/place-window/area/place-card/place-card.component.ts
View file @
437da7ca
...
...
@@ -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
);
...
...
src/app/remove-brackets.pipe.ts
View file @
437da7ca
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment