summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-08-15 19:11:02 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-08-15 19:11:02 +0200
commit92b0c8e4b7be8c26873fe5cbe3b1d67703c2e7c5 (patch)
tree0d975525504cbafe42a437f7bffd54db1c66eefd
parent3c4fb9b8089ff6914bc0d3951a192d5ad9f533c5 (diff)
fix hidelowdelay when combined with show_realtime4.6.1
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm3
-rw-r--r--templates/app.html.ep8
2 files changed, 4 insertions, 7 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm
index a52a3ce..18fa100 100644
--- a/lib/DBInfoscreen/Controller/Stationboard.pm
+++ b/lib/DBInfoscreen/Controller/Stationboard.pm
@@ -1120,9 +1120,6 @@ sub handle_result {
if ($info) {
$info =~ s{ (?: ca [.] \s* )? [+] [ 1 2 3 4 ] $ }{}x;
}
- if ( $delay and $delay < 5 ) {
- $delay = undef;
- }
}
if ($info) {
$info =~ s{ (?: ca [.] \s* )? [+] (\d+) }{Verspätung ca $1 Min.}x;
diff --git a/templates/app.html.ep b/templates/app.html.ep
index 852d8a8..6baf0f4 100644
--- a/templates/app.html.ep
+++ b/templates/app.html.ep
@@ -99,18 +99,18 @@
$departure->{is_cancelled}) ? 'delayed' : q{} %>">
% if ($departure->{delay} and not $departure->{is_cancelled}) {
% if ($show_realtime) {
-% if ($departure->{delay} > 0) {
+% if ($departure->{delay} > ($hide_low_delay ? 4 : 0)) {
<span class="delaynorm" aria-hidden="true">(+<%= $departure->{delay} %>)</span>
% }
-% else {
+% elsif ($departure->{delay} < 0) {
<span class="undelaynorm" aria-hidden="true">(<%= $departure->{delay} %>)</span>
% }
% }
% else {
-% if ($departure->{delay} > 0) {
+% if ($departure->{delay} > ($hide_low_delay ? 4 : 0)) {
<span class="delay" aria-hidden="true">(+<%= $departure->{delay} %>)</span>
% }
-% else {
+% elsif ($departure->{delay} < 0) {
<span class="undelay" aria-hidden="true">(<%= $departure->{delay} %>)</span>
% }
% }