From 20b791c7682a5ec319498174c40c4b301e9b4716 Mon Sep 17 00:00:00 2001 From: Cassidy Dingenskirchen Date: Sun, 22 Oct 2023 14:39:04 +0200 Subject: departure board: bigger station name --- templates/departures.html.ep | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/departures.html.ep b/templates/departures.html.ep index 021e9ca..c08e986 100644 --- a/templates/departures.html.ep +++ b/templates/departures.html.ep @@ -1,9 +1,9 @@
-
- <%= param('hafas') ? 'directions' : 'train' %> - <%= $station %> +
+

<%= param('hafas') ? 'directions' : 'train' %> + <%= $station %>

% for my $related_station (sort { $a->{name} cmp $b->{name} } @{$related_stations}) { -
+ <%= $related_station->{name} %> + + <%= $related_station->{name} %>
% }
-- cgit v1.2.3 From 6a0f20e29f559cfecf7b2e914d989cc12d00cc35 Mon Sep 17 00:00:00 2001 From: Cassidy Dingenskirchen Date: Sun, 22 Oct 2023 14:40:17 +0200 Subject: departure board: now-jump button and styled hafas/iris switch button --- public/static/js/travelynx-actions.js | 4 ++++ templates/departures.html.ep | 24 +++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) (limited to 'templates') diff --git a/public/static/js/travelynx-actions.js b/public/static/js/travelynx-actions.js index e4d69dc..1b6dd8a 100644 --- a/public/static/js/travelynx-actions.js +++ b/public/static/js/travelynx-actions.js @@ -298,6 +298,10 @@ $(document).ready(function() { $('a[href]').click(function() { $('nav .preloader-wrapper').addClass('active'); }); + $('a[href="#now"]').click(function(event) { + event.preventDefault(); + $('#now')[0].scrollIntoView({behavior: "smooth", block: "center"}); + }); const elems = document.querySelectorAll('.carousel'); const instances = M.Carousel.init(elems, { fullWidth: true, diff --git a/templates/departures.html.ep b/templates/departures.html.ep index c08e986..9235600 100644 --- a/templates/departures.html.ep +++ b/templates/departures.html.ep @@ -7,18 +7,20 @@ % }
-% if ($api_link) { -
-
- % if (param('hafas')) { - zum Schienenverkehr - % } - % else { - zum Nahverkehr - % } -
+
+
+ % if ($api_link) { + % if (param('hafas')) { + trainzum Schienenverkehr + % } + % else { + directionszum Nahverkehr + % } + % } + vertical_align_centerJetzt
-% } +
+ % my $have_connections = 0; % if ($user_status->{checked_in}) {
-- cgit v1.2.3 From f1d3d3ed934a87357e26d84f44daa4719b587749 Mon Sep 17 00:00:00 2001 From: Cassidy Dingenskirchen Date: Sun, 22 Oct 2023 14:43:05 +0200 Subject: departure board: new look and train type highlighting --- sass/src/common/local.scss | 126 ++++++++++++++++++++++++++++++++++-- sass/src/dark/_variables.scss | 3 + sass/src/light/_variables.scss | 2 + templates/_departures_hafas.html.ep | 53 +++++++-------- templates/_departures_iris.html.ep | 55 +++++++--------- 5 files changed, 171 insertions(+), 68 deletions(-) (limited to 'templates') diff --git a/sass/src/common/local.scss b/sass/src/common/local.scss index 4c52486..71f9e81 100644 --- a/sass/src/common/local.scss +++ b/sass/src/common/local.scss @@ -21,10 +21,6 @@ color: #f5c4ce !important; } -td.cancelled { - text-decoration: line-through; -} - .wagons span { margin-right: 0.5ex; color: #808080; @@ -72,7 +68,123 @@ ul.suggestions { } } -table.departures tr.now td { - padding-top: 2em; - padding-bottom: 2em; +.departures li { + transition: background .3s; + display: grid; + grid-template-columns: 10ch 11ch 1fr; + align-items: center; + &:hover { + background-color: $departures-highlight-color; + } + &.cancelled { + background-color: $departures-cancelled-color; + font-style: italic; + .dep-line { + background-color: transparent; + border: 1px solid; + color: $off-black; + } + .dep-dest::before { + content: "Fahrt nach"; + } + .dep-dest::after { + content: "entfällt"; + } + } +} +.followee-checkin { + font-size: 0.9rem; + display: block; + i.material-icons { + vertical-align: middle; + } +} +.departures #now { + background-color: $departures-highlight-color; + padding: 2rem 20px; + grid-template-columns: 10ch 1fr; + strong { + font-weight: bold; + } +} + + +.departures .dep-line { + text-align: center; + padding: .2rem; + color: white; + background: color('grey', 'darken-3'); + border-radius: .2rem; + display: inline-block; + font-weight: 600; + line-height: 1; + margin-right: 0.8rem; + height: fit-content; + + &.Bus, &.RUF, &.AST { + background-color: #a3167e; + border-radius: 5rem; + padding: .2rem .5rem; + } + &.STR { + background-color: #c5161c; + border-radius: 5rem; + padding: .2rem .5rem; + } + &.S, &.RS, &.RER, &.SKW { + background-color: #008d4f; + border-radius: 5rem; + padding: .2rem .5rem; + } + &.U, &.STB, &.M { + background-color: #014e8d; + border-radius: 5rem; + padding: .2rem .5rem; + } + &.RE, &.IRE { + background-color: #ff4f00; + } + &.RB, &.MEX, &.TER { + background-color: #1f4a87; + } + // DE + &.IC, &.ICE, &.EC, &.ECE, &.D, + // CH + &.IR, + // FR + &.TGV, &.OGV, &.EST, + // PL + &.TLK, &.EIC { + background-color: #ff0404; + font-weight: 900; + font-style: italic; + padding: .2rem; + } + &.RJ, &.RJX { + background-color: #c63131; + } + &.NJ, &.EN { + background-color: #29255b; + } + &.WB { + background-color: #2e85ce; + } + &.FLX { + background-color: #71d800; + } +} + +@media screen and (max-width: 600px) { + .departures li { + grid-template-columns: 11ch 1fr; + .dep-line, .dep-time { + grid-column: 1; + margin-right: 0.8rem; + text-align: center; + } + .dep-dest { + grid-column: 2; + grid-row: 1 / span 2; + } + } } diff --git a/sass/src/dark/_variables.scss b/sass/src/dark/_variables.scss index 04e3689..ba14a75 100644 --- a/sass/src/dark/_variables.scss +++ b/sass/src/dark/_variables.scss @@ -21,3 +21,6 @@ $table-striped-color: color('grey', 'darken-4'); $button-flat-color: $off-black; $card-bg-color: color('grey', 'darken-4'); $card-link-color: $link-color; + +$departures-highlight-color: $table-striped-color; +$departures-cancelled-color: color('red', 'darken-3'); diff --git a/sass/src/light/_variables.scss b/sass/src/light/_variables.scss index 6c5095b..4a634e9 100644 --- a/sass/src/light/_variables.scss +++ b/sass/src/light/_variables.scss @@ -6,3 +6,5 @@ $collection-link-color: color('shades', 'black'); $card-bg-color: color('blue-grey', 'lighten-5'); $inactive-color: color('grey', 'darken-2'); $input-label-color: color('shades', 'black'); +$departures-highlight-color: color('grey', 'lighten-3'); +$departures-cancelled-color: color('red', 'lighten-4'); diff --git a/templates/_departures_hafas.html.ep b/templates/_departures_hafas.html.ep index 169b319..f611d8e 100644 --- a/templates/_departures_hafas.html.ep +++ b/templates/_departures_hafas.html.ep @@ -1,39 +1,28 @@ - - +
    % my $orientation_bar_shown = param('train'); % my $now_epoch = now->epoch; % for my $result (@{$results}) { - % my $td_class = ''; + % my $row_class = ''; % my $link_class = 'action-checkin'; % if ($result->is_cancelled) { - % $td_class = "cancelled"; + % $row_class = "cancelled"; % $link_class = 'action-cancelled-from'; % } % if (not $orientation_bar_shown and $result->datetime->epoch < $now_epoch) { % $orientation_bar_shown = 1; -
- - - - + + — Anfragezeitpunkt — + % } - - - - - + + + %= $result->line + + + %= $result->destination + % } + + % } - -
- - — Anfragezeitpunkt — - +
  • + %= now->strftime('%H:%M') -
  • + diff --git a/templates/_departures_iris.html.ep b/templates/_departures_iris.html.ep index c8dd834..237757c 100644 --- a/templates/_departures_iris.html.ep +++ b/templates/_departures_iris.html.ep @@ -1,42 +1,28 @@ - - +
      % my $orientation_bar_shown = param('train'); % my $now_epoch = now->epoch; % for my $result (@{$results}) { - % my $td_class = ''; + % my $row_class = ''; % my $link_class = 'action-checkin'; % if ($result->departure_is_cancelled) { - % $td_class = "cancelled"; + % $row_class = "cancelled"; % $link_class = 'action-cancelled-from'; % } % if (not $orientation_bar_shown and $result->departure->epoch < $now_epoch) { % $orientation_bar_shown = 1; -
    - - - - + + — Anfragezeitpunkt — + % } - - - - - + + + %= $result->line + + + %= $result->destination + + % } - -
    - - — Anfragezeitpunkt — - +
  • + %= now->strftime('%H:%M') -
  • + -- cgit v1.2.3 From 6686a16bbfe8fd2af7d8d0e95b7b083cdd26ca4b Mon Sep 17 00:00:00 2001 From: Cassidy Dingenskirchen Date: Sun, 22 Oct 2023 14:43:41 +0200 Subject: departure board: restyled followee checkin notice, add it for hafas too --- templates/_departures_hafas.html.ep | 4 ++++ templates/_departures_iris.html.ep | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'templates') diff --git a/templates/_departures_hafas.html.ep b/templates/_departures_hafas.html.ep index f611d8e..58bdb02 100644 --- a/templates/_departures_hafas.html.ep +++ b/templates/_departures_hafas.html.ep @@ -36,6 +36,10 @@ %= $result->destination + % for my $checkin (@{$checkin_by_train->{$result->id} // []}) { + + people <%= $checkin->{followee_name} %> → <%= $checkin->{arr_name} // '???' %> + % } diff --git a/templates/_departures_iris.html.ep b/templates/_departures_iris.html.ep index 237757c..2c47016 100644 --- a/templates/_departures_iris.html.ep +++ b/templates/_departures_iris.html.ep @@ -41,6 +41,11 @@ %= $result->destination + % for my $checkin (@{$checkin_by_train->{$result->train_id} // []}) { + + people <%= $checkin->{followee_name} %> → <%= $checkin->{arr_name} // '???' %> + + % } % } -- cgit v1.2.3 From 0504f1adcd12c573ab805894b96a7658e2cd74fa Mon Sep 17 00:00:00 2001 From: Cassidy Dingenskirchen Date: Sun, 22 Oct 2023 16:16:41 +0200 Subject: departure board: some more styling consistency --- sass/src/common/local.scss | 24 +++++++++++++++--------- templates/_departures_hafas.html.ep | 22 ++++++++++++++-------- templates/_departures_iris.html.ep | 24 +++++++++++++++--------- 3 files changed, 44 insertions(+), 26 deletions(-) (limited to 'templates') diff --git a/sass/src/common/local.scss b/sass/src/common/local.scss index 71f9e81..3008c54 100644 --- a/sass/src/common/local.scss +++ b/sass/src/common/local.scss @@ -71,7 +71,7 @@ ul.suggestions { .departures li { transition: background .3s; display: grid; - grid-template-columns: 10ch 11ch 1fr; + grid-template-columns: 10ch 10ch 1fr; align-items: center; &:hover { background-color: $departures-highlight-color; @@ -84,11 +84,11 @@ ul.suggestions { border: 1px solid; color: $off-black; } - .dep-dest::before { - content: "Fahrt nach"; + .dep-time::after { + content: " ⊖"; } - .dep-dest::after { - content: "entfällt"; + } +} } } } @@ -107,8 +107,12 @@ ul.suggestions { font-weight: bold; } } - - +.departures .dep-time { + color: $off-black; +} +.departures .dep-dest { + margin-left: 0.8rem; +} .departures .dep-line { text-align: center; padding: .2rem; @@ -118,8 +122,10 @@ ul.suggestions { display: inline-block; font-weight: 600; line-height: 1; - margin-right: 0.8rem; height: fit-content; + width: fit-content; + min-width: 6ch; + margin: 0 auto; &.Bus, &.RUF, &.AST { background-color: #a3167e; @@ -176,8 +182,8 @@ ul.suggestions { @media screen and (max-width: 600px) { .departures li { - grid-template-columns: 11ch 1fr; .dep-line, .dep-time { + grid-template-columns: 10ch 1fr; grid-column: 1; margin-right: 0.8rem; text-align: center; diff --git a/templates/_departures_hafas.html.ep b/templates/_departures_hafas.html.ep index 58bdb02..a10594e 100644 --- a/templates/_departures_hafas.html.ep +++ b/templates/_departures_hafas.html.ep @@ -22,7 +22,7 @@ data-train="<%= $result->id %>" data-ts="<%= ($result->sched_datetime // $result->datetime)->epoch %>" > - + %= $result->datetime->strftime('%H:%M') % if ($result->delay) { (<%= sprintf('%+d', $result->delay) %>) @@ -30,18 +30,24 @@ % elsif (not defined $result->delay and not $result->is_cancelled) { gps_off % } - - - %= $result->line - - + + + %= $result->line + + + % if ($result->is_cancelled) { + Fahrt nach <%= $result->destination %> entfällt + % } + % else { %= $result->destination % for my $checkin (@{$checkin_by_train->{$result->id} // []}) { - people <%= $checkin->{followee_name} %> → <%= $checkin->{arr_name} // '???' %> + people + <%= $checkin->{followee_name} %> → <%= $checkin->{arr_name} // '???' %> % } - + % } + % } diff --git a/templates/_departures_iris.html.ep b/templates/_departures_iris.html.ep index 2c47016..332ef1c 100644 --- a/templates/_departures_iris.html.ep +++ b/templates/_departures_iris.html.ep @@ -22,7 +22,7 @@ data-train="<%= $result->train_id %>" data-ts="<%= ($result->sched_departure // $result->departure)->epoch %>" > - + % if ($result->departure_hidden) { (<%= $result->departure->strftime('%H:%M') %>) % } @@ -35,16 +35,22 @@ % elsif (not $result->has_realtime and $result->start->epoch < $now_epoch) { gps_off % } - - - %= $result->line + + %= $result->line + - %= $result->destination - % for my $checkin (@{$checkin_by_train->{$result->train_id} // []}) { - - people <%= $checkin->{followee_name} %> → <%= $checkin->{arr_name} // '???' %> - + % if ($result->is_cancelled) { + Fahrt nach <%= $result->destination %> entfällt + % } + % else { + %= $result->destination + % for my $checkin (@{$checkin_by_train->{$result->train_id} // []}) { + + people + <%= $checkin->{followee_name} %> → <%= $checkin->{arr_name} // '???' %> + + % } % } -- cgit v1.2.3 From c22df914908f3f9c7f54e9319dfa41e1ab792b93 Mon Sep 17 00:00:00 2001 From: Cassidy Dingenskirchen Date: Sun, 22 Oct 2023 16:24:29 +0200 Subject: connections: new look consistent with departure board --- sass/src/common/local.scss | 20 +++++++++- templates/_connections.html.ep | 74 +++++++++++++++++------------------- templates/_connections_hafas.html.ep | 59 ++++++++++++---------------- 3 files changed, 76 insertions(+), 77 deletions(-) (limited to 'templates') diff --git a/sass/src/common/local.scss b/sass/src/common/local.scss index 3008c54..d5e4598 100644 --- a/sass/src/common/local.scss +++ b/sass/src/common/local.scss @@ -86,12 +86,23 @@ ul.suggestions { } .dep-time::after { content: " ⊖"; + font-style: normal; } } } + +.departures.connections { + li { + grid-template-columns: 15ch 10ch 1fr; + } + .connect-platform-wrapper { + text-align: center; + span { + display: block; } } } + .followee-checkin { font-size: 0.9rem; display: block; @@ -182,10 +193,9 @@ ul.suggestions { @media screen and (max-width: 600px) { .departures li { - .dep-line, .dep-time { grid-template-columns: 10ch 1fr; + .dep-line, .dep-time, .connect-platform-wrapper { grid-column: 1; - margin-right: 0.8rem; text-align: center; } .dep-dest { @@ -193,4 +203,10 @@ ul.suggestions { grid-row: 1 / span 2; } } + .departures.connections li { + grid-template-columns: 15ch 1fr; + .connect-platform-wrapper span { + display: inline; + } + } } diff --git a/templates/_connections.html.ep b/templates/_connections.html.ep index cd64150..2a89d9b 100644 --- a/templates/_connections.html.ep +++ b/templates/_connections.html.ep @@ -1,39 +1,48 @@ -
    +
      % for my $res (@{$connections}) { % my ($train, $via, $via_arr, $load) = @{$res}; % $via_arr = $via_arr ? $via_arr->strftime('%H:%M') : q{}; - % my $td_class = ''; + % my $row_class = ''; % my $link_class = 'action-checkin'; % if ($train->is_cancelled) { - % $td_class = 'cancelled'; + % $row_class = 'cancelled'; % $link_class = 'action-cancelled-from'; % } % if ($checkin_from) { -
    + +
  • % } -
  • - - - + + % } -
    - % if ($train->platform) { - % if ($checkin_from) { - Gleis <%= $train->platform %> - % } - % else { - Gleis <%= $train->platform %> - % } -
    - % } - % if ($checkin_from) { - <%= $train->line %> + + % if ($train->departure_is_cancelled) { + %= $train->sched_departure->strftime('%H:%M') % } % else { - %= $train->line + %= $train->departure->strftime('%H:%M') + % } + % if ($via_arr) { + → <%= $via_arr %> % } -
    - % if ($checkin_from) { - <%= $via->{name} %> + % if ($train->departure_delay) { + %= sprintf('(%+d)', $train->departure_delay) + % } + + + % if ($train->platform) { + Gleis <%= $train->platform %> + % } + + %= $train->line + + + + % if ($train->is_cancelled) { + Fahrt nach <%= $via->{name} %> entfällt % } % else { %= $via->{name} @@ -61,22 +70,7 @@ % if ($train->{message_id}{70} or $train->{message_id}{71}) { portable_wifi_off % } - - % if ($train->departure_is_cancelled) { - %= $train->sched_departure->strftime('%H:%M') - ⊖ - % } - % else { - %= $train->departure->strftime('%H:%M') - % } - % if ($via_arr) { - → <%= $via_arr %> - % } - % if ($train->departure_delay) { - %= sprintf('(%+d)', $train->departure_delay) - % } -
    + diff --git a/templates/_connections_hafas.html.ep b/templates/_connections_hafas.html.ep index 48a5380..7a7b656 100644 --- a/templates/_connections_hafas.html.ep +++ b/templates/_connections_hafas.html.ep @@ -1,48 +1,26 @@ -
    +
      % for my $res (@{$connections}) { % my ($train, $via, $via_arr) = @{$res}; % $via_arr = $via_arr ? $via_arr->strftime('%H:%M') : q{}; - % my $td_class = ''; + % my $row_class = ''; % my $link_class = 'action-checkin'; % if ($train->is_cancelled) { - % $td_class = 'cancelled'; + % $row_class = 'cancelled'; % $link_class = 'action-cancelled-from'; % } % if ($checkin_from) { -
    + +
  • % } -
  • - - - + + + % if ($train->platform) { + Gleis <%= $train->platform %> + % } + + %= $train->line + + + + %= $via->{name} + + % } -
    - % if ($train->platform) { - % if ($checkin_from) { - Gleis <%= $train->platform %> - % } - % else { - Gleis <%= $train->platform %> - % } -
    - % } - % if ($checkin_from) { - <%= $train->line %> - % } - % else { - %= $train->line - % } -
    - % if ($checkin_from) { - <%= $via->{name} %> - % } - % else { - %= $via->{name} - % } - + % if ($train->is_cancelled) { %= $train->sched_datetime->strftime('%H:%M') - ⊖ % } % else { %= $train->datetime->strftime('%H:%M') @@ -53,7 +31,18 @@ % if ($train->delay) { %= sprintf('(%+d)', $train->delay) % } -
    + -- cgit v1.2.3 From 644ab3e660aa1cf0fce21ef8300997b3c85ef049 Mon Sep 17 00:00:00 2001 From: Cassidy Dingenskirchen Date: Sun, 22 Oct 2023 18:32:41 +0200 Subject: departure board: aria-label and contrast fix --- sass/src/common/local.scss | 59 ++++++++++++++++++++----------------- templates/_departures_hafas.html.ep | 2 +- templates/_departures_iris.html.ep | 2 +- templates/departures.html.ep | 14 +++++---- 4 files changed, 42 insertions(+), 35 deletions(-) (limited to 'templates') diff --git a/sass/src/common/local.scss b/sass/src/common/local.scss index d5e4598..81534dc 100644 --- a/sass/src/common/local.scss +++ b/sass/src/common/local.scss @@ -68,6 +68,7 @@ ul.suggestions { } } + .departures li { transition: background .3s; display: grid; @@ -89,35 +90,17 @@ ul.suggestions { font-style: normal; } } -} - -.departures.connections { - li { - grid-template-columns: 15ch 10ch 1fr; - } - .connect-platform-wrapper { - text-align: center; - span { - display: block; + &#now { + background-color: $departures-highlight-color; + padding: 2rem 20px; + grid-template-columns: 10ch 1fr; + strong { + font-weight: bold; } } } -.followee-checkin { - font-size: 0.9rem; - display: block; - i.material-icons { - vertical-align: middle; - } -} -.departures #now { - background-color: $departures-highlight-color; - padding: 2rem 20px; - grid-template-columns: 10ch 1fr; - strong { - font-weight: bold; - } -} + .departures .dep-time { color: $off-black; } @@ -138,6 +121,14 @@ ul.suggestions { min-width: 6ch; margin: 0 auto; + .followee-checkin { + font-size: 0.9rem; + display: block; + i.material-icons { + vertical-align: middle; + } + } + &.Bus, &.RUF, &.AST { background-color: #a3167e; border-radius: 5rem; @@ -158,10 +149,10 @@ ul.suggestions { border-radius: 5rem; padding: .2rem .5rem; } - &.RE, &.IRE { + &.RE, &.IRE, &.REX { background-color: #ff4f00; } - &.RB, &.MEX, &.TER { + &.RB, &.MEX, &.TER, &.R { background-color: #1f4a87; } // DE @@ -188,9 +179,23 @@ ul.suggestions { } &.FLX { background-color: #71d800; + color: black; } } +.departures.connections { + li { + grid-template-columns: 15ch 10ch 1fr; + } + .connect-platform-wrapper { + text-align: center; + span { + display: block; + } + } +} + + @media screen and (max-width: 600px) { .departures li { grid-template-columns: 10ch 1fr; diff --git a/templates/_departures_hafas.html.ep b/templates/_departures_hafas.html.ep index a10594e..369f5f4 100644 --- a/templates/_departures_hafas.html.ep +++ b/templates/_departures_hafas.html.ep @@ -42,7 +42,7 @@ %= $result->destination % for my $checkin (@{$checkin_by_train->{$result->id} // []}) { - people + people <%= $checkin->{followee_name} %> → <%= $checkin->{arr_name} // '???' %> % } diff --git a/templates/_departures_iris.html.ep b/templates/_departures_iris.html.ep index 332ef1c..d075008 100644 --- a/templates/_departures_iris.html.ep +++ b/templates/_departures_iris.html.ep @@ -47,7 +47,7 @@ %= $result->destination % for my $checkin (@{$checkin_by_train->{$result->train_id} // []}) { - people + people <%= $checkin->{followee_name} %> → <%= $checkin->{arr_name} // '???' %> % } diff --git a/templates/departures.html.ep b/templates/departures.html.ep index 9235600..039ec28 100644 --- a/templates/departures.html.ep +++ b/templates/departures.html.ep @@ -1,7 +1,9 @@
    -

    <%= param('hafas') ? 'directions' : 'train' %> - <%= $station %>

    +

    + + <%= $station %> +

    % for my $related_station (sort { $a->{name} cmp $b->{name} } @{$related_stations}) { + <%= $related_station->{name} %>
    % } @@ -11,13 +13,13 @@
    @@ -51,7 +53,7 @@ Rückgängig - gps_off + Hier auschecken % } -- cgit v1.2.3 From f867abb865460e0f3cc77e3c39eff4e311e46ffa Mon Sep 17 00:00:00 2001 From: Cassidy Dingenskirchen Date: Fri, 27 Oct 2023 07:33:10 +0200 Subject: departure board: more subtle cancellation highlight, use unified cancellation check for IRIS --- sass/src/dark/_variables.scss | 2 +- templates/_departures_iris.html.ep | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/sass/src/dark/_variables.scss b/sass/src/dark/_variables.scss index ba14a75..6665269 100644 --- a/sass/src/dark/_variables.scss +++ b/sass/src/dark/_variables.scss @@ -23,4 +23,4 @@ $card-bg-color: color('grey', 'darken-4'); $card-link-color: $link-color; $departures-highlight-color: $table-striped-color; -$departures-cancelled-color: color('red', 'darken-3'); +$departures-cancelled-color: #702020; diff --git a/templates/_departures_iris.html.ep b/templates/_departures_iris.html.ep index d075008..56b5820 100644 --- a/templates/_departures_iris.html.ep +++ b/templates/_departures_iris.html.ep @@ -40,7 +40,7 @@ %= $result->line - % if ($result->is_cancelled) { + % if ($result->departure_is_cancelled) { Fahrt nach <%= $result->destination %> entfällt % } % else { -- cgit v1.2.3 From 7bf99b00a5064d231641b1309adacf6f1e8f42cb Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 27 Oct 2023 18:34:02 +0200 Subject: Use $train->type rather than firts part of $train->line for CSS class In some cases (e.g. in Belgium), trains do not have a type, so the first part of $train->line is the train number instead. --- templates/_connections.html.ep | 2 +- templates/_connections_hafas.html.ep | 2 +- templates/_departures_hafas.html.ep | 2 +- templates/_departures_iris.html.ep | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/_connections.html.ep b/templates/_connections.html.ep index 2a89d9b..97c53e0 100644 --- a/templates/_connections.html.ep +++ b/templates/_connections.html.ep @@ -36,7 +36,7 @@ % if ($train->platform) { Gleis <%= $train->platform %> % } - + %= $train->line diff --git a/templates/_connections_hafas.html.ep b/templates/_connections_hafas.html.ep index 7a7b656..d2b35ce 100644 --- a/templates/_connections_hafas.html.ep +++ b/templates/_connections_hafas.html.ep @@ -36,7 +36,7 @@ % if ($train->platform) { Gleis <%= $train->platform %> % } - + %= $train->line diff --git a/templates/_departures_hafas.html.ep b/templates/_departures_hafas.html.ep index 369f5f4..9e4d7a4 100644 --- a/templates/_departures_hafas.html.ep +++ b/templates/_departures_hafas.html.ep @@ -31,7 +31,7 @@ gps_off % } - + %= $result->line diff --git a/templates/_departures_iris.html.ep b/templates/_departures_iris.html.ep index 56b5820..d96fd37 100644 --- a/templates/_departures_iris.html.ep +++ b/templates/_departures_iris.html.ep @@ -36,7 +36,7 @@ gps_off % } - + %= $result->line -- cgit v1.2.3