From bd0ba2a120b7a5067c876ce8a5fbd4539132819f Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 10 Apr 2024 18:44:07 +0200 Subject: train details: indicate on time / delayed time stamps by color also: revert back to showing scheduled time first and real/estimated time next --- templates/_train_details.html.ep | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'templates/_train_details.html.ep') diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index 2f89cde..709a1ac 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -271,13 +271,13 @@ generic-stop % } % if (($stop->{rt_dep} and $stop->{dep_delay}) or (not $stop->{rt_dep} and $stop->{rt_arr} and $stop->{arr_delay})) { - "><%= ($stop->{rt_dep} // $stop->{rt_arr})->strftime('%H:%M') %> <%= ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') %> + "><%= ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') %> <%= ($stop->{rt_dep} // $stop->{rt_arr})->strftime('%H:%M') %> +% } +% elsif (($stop->{rt_dep} and defined $stop->{dep_delay}) or (not $stop->{rt_dep} and $stop->{rt_arr} and defined $stop->{arr_delay})) { + "><%= ($stop->{sched_dep} // $stop->{sched_arr}) ? ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') : q{} %> % } % else { - "><%= ($stop->{sched_dep} // $stop->{sched_arr}) ? ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') : q{} %> -% if ($stop->{rt_bogus}) { - gps_off -% } + "><%= ($stop->{sched_dep} // $stop->{sched_arr}) ? ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') : q{} %> % } % if ($stop->{tz_offset} and $stop->{local_dt_da}) { (lokal <%= $stop->{local_dt_da}->strftime('%H:%M') %>) @@ -305,16 +305,23 @@ % }
  • -%= $departure->{departure} // $departure->{arrival} // $departure->{sched_departure} // $departure->{sched_arrival} // q{} % if ($departure->{departure} and $departure->{sched_departure} and $departure->{departure} ne $departure->{sched_departure}) { - <%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %> + <%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %> +% } +% elsif ($departure->{departure} and $departure->{sched_departure} and $departure->{departure} eq $departure->{sched_departure} and not $departure->{no_realtime_yet}) { + % } % elsif ($departure->{arrival} and $departure->{sched_arrival} and $departure->{arrival} ne $departure->{sched_arrival}) { - <%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %> + <%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %> % } -% if ($departure->{missing_realtime} or $departure->{no_realtime_yet}) { - gps_off +% elsif ($departure->{arrival} and $departure->{sched_arrival} and $departure->{arrival} eq $departure->{sched_arrival} and not $departure->{no_realtime_yet}) { + % } +% else { + +% } +%= $departure->{departure} // $departure->{arrival} // $departure->{sched_departure} // $departure->{sched_arrival} // q{} + % if ($departure->{tz_offset} and $departure->{local_dt_da}) { (lokal <%= $departure->{local_dt_da}->strftime('%H:%M') %>) % } @@ -355,13 +362,13 @@ generic-stop % } % if (($stop->{rt_arr} and $stop->{arr_delay}) or (not $stop->{rt_arr} and $stop->{rt_dep} and $stop->{dep_delay})) { - "><%= ($stop->{rt_arr} // $stop->{rt_dep})->strftime('%H:%M') %> <%= ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') %> + "><%= ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') %> <%= ($stop->{rt_arr} // $stop->{rt_dep})->strftime('%H:%M') %> +% } +% elsif (($stop->{rt_arr} and defined $stop->{arr_delay}) or (not $stop->{rt_arr} and $stop->{rt_dep} and defined $stop->{dep_delay})) { + "><%= ($stop->{sched_arr} // $stop->{sched_dep}) ? ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') : q{} %> % } % else { - "><%= ($stop->{sched_arr} // $stop->{sched_dep}) ? ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') : q{} %> -% if ($stop->{rt_bogus}) { - gps_off -% } + "><%= ($stop->{sched_arr} // $stop->{sched_dep}) ? ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') : q{} %> % } % if ($stop->{tz_offset} and $stop->{local_dt_ad}) { (lokal <%= $stop->{local_dt_ad}->strftime('%H:%M') %>) -- cgit v1.2.3