Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AURA
dashboard-clock
Commits
fd2ee29c
Commit
fd2ee29c
authored
Sep 18, 2020
by
david
Browse files
Added fallback indicator for schedule.
#5
parent
563a6ac1
Changes
3
Hide whitespace changes
Inline
Side-by-side
config/default-sample.env
View file @
fd2ee29c
...
...
@@ -6,4 +6,5 @@ UNKNOWN_TITLE="Unknown Title"
NO_CURRENT_SCHEDULE="Right now, there's no show playing"
NO_NEXT_SCHEDULE="Nothing scheduled next"
PLAY_OFFSET=3
CSS=""
\ No newline at end of file
CSS=""
FALLBACK_TEXT="FALLBACK"
\ No newline at end of file
config/o94-sample.env
View file @
fd2ee29c
...
...
@@ -7,3 +7,4 @@ NO_CURRENT_SCHEDULE="Derzeit keine Sendung"
NO_NEXT_SCHEDULE="Keine weiteren Sendungen"
PLAY_OFFSET=3
CSS="/css/o94.css"
FALLBACK_TEXT="Notfallprogramm"
\ No newline at end of file
src/StudioClock.svelte
View file @
fd2ee29c
...
...
@@ -12,6 +12,7 @@
export
let
nonextschedule
=
globalConfig
.
NO_NEXT_SCHEDULE
;
export
let
unknowntitle
=
globalConfig
.
UNKNOWN_TITLE
;
export
let
playoffset
=
globalConfig
.
PLAY_OFFSET
;
export
let
fallbacktext
=
globalConfig
.
FALLBACK_TEXT
;
let
version
=
"
APP_VERSION
"
;
let
time
=
new
Date
();
...
...
@@ -235,6 +236,15 @@
return
str
;
}
/* Indicates if some fallback is playing */
function
isFallback
(
current_schedule
)
{
if
(
current_schedule
.
fallback_type
>
0
)
return
true
;
return
false
;
}
/* Check if the given track is currently playing */
function
isActive
(
entry
,
currentTrack
)
{
if
(
currentTrack
!=
null
&&
entry
.
track_num
==
currentTrack
.
track_num
)
{
...
...
@@ -410,6 +420,15 @@
border
:
1px
solid
gray
;
}
.fallback-indicator
{
margin
:
25px
50px
;
border-radius
:
25px
;
padding
:
5px
33px
;
border
:
1px
solid
gray
;
background-color
:
red
;
color
:
white
;
}
.is-active
{
color
:
rgb
(
43
,
241
,
36
);
font-weight
:
bold
;
...
...
@@ -566,11 +585,14 @@
<div
id=
"current-schedule"
>
<div
class=
"schedule-title"
>
<h1>
{#if hasValidSchedule(value)}
{#if hasValidSchedule(value)}
{@html displayShowName(value.current_schedule)} {displayShowSchedule(value.current_schedule)}
{#if isFallback(value.current_schedule)}
<span
class=
"fallback-indicator"
>
{fallbacktext}
</span>
{/if}
{:else}
<span
class=
"error"
>
{nocurrentschedule}
</span>
{/if}
{/if}
</h1>
</div>
<div
id=
"playlist"
>
...
...
Write
Preview
Supports
Markdown
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