Commit fd2ee29c authored by david's avatar david
Browse files

Added fallback indicator for schedule. #5

parent 563a6ac1
......@@ -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
......@@ -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
......@@ -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">
......
Supports Markdown
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