Skip to content
Commits on Source (5)
...@@ -1243,7 +1243,11 @@ sub train_details { ...@@ -1243,7 +1243,11 @@ sub train_details {
= $station_info->{dep_cancelled}; = $station_info->{dep_cancelled};
$res->{is_cancelled} = $res->{arrival_is_cancelled} $res->{is_cancelled} = $res->{arrival_is_cancelled}
|| $res->{arrival_is_cancelled}; || $res->{arrival_is_cancelled};
$res->{platform} = $station_info->{platform}; $res->{tz_offset} = $station_info->{tz_offset};
$res->{local_dt_da} = $station_info->{local_dt_da};
$res->{local_sched_arr} = $station_info->{local_sched_arr};
$res->{local_sched_dep} = $station_info->{local_sched_dep};
$res->{platform} = $station_info->{platform};
$res->{scheduled_platform} $res->{scheduled_platform}
= $station_info->{sched_platform}; = $station_info->{sched_platform};
} }
......
...@@ -119,6 +119,7 @@ sub get_route_p { ...@@ -119,6 +119,7 @@ sub get_route_p {
dep_delay => $stop->dep_delay, dep_delay => $stop->dep_delay,
arr_cancelled => $stop->arr_cancelled, arr_cancelled => $stop->arr_cancelled,
dep_cancelled => $stop->dep_cancelled, dep_cancelled => $stop->dep_cancelled,
tz_offset => $stop->tz_offset,
platform => $stop->platform, platform => $stop->platform,
sched_platform => $stop->sched_platform, sched_platform => $stop->sched_platform,
load => $stop->load, load => $stop->load,
...@@ -142,6 +143,32 @@ sub get_route_p { ...@@ -142,6 +143,32 @@ sub get_route_p {
$station_is_past = 0; $station_is_past = 0;
} }
$ret[-1]{isPast} = $station_is_past; $ret[-1]{isPast} = $station_is_past;
if ( $stop->tz_offset ) {
if ( $stop->sched_arr ) {
$ret[-1]{local_sched_arr}
= $stop->sched_arr->clone->add(
minutes => $stop->tz_offset );
}
if ( $stop->sched_dep ) {
$ret[-1]{local_sched_dep}
= $stop->sched_dep->clone->add(
minutes => $stop->tz_offset );
}
if ( $stop->rt_arr ) {
$ret[-1]{local_rt_arr} = $stop->rt_arr->clone->add(
minutes => $stop->tz_offset );
}
if ( $stop->rt_dep ) {
$ret[-1]{local_rt_dep} = $stop->rt_dep->clone->add(
minutes => $stop->tz_offset );
}
$ret[-1]{local_dt_ad} = $ret[-1]{local_rt_arr}
// $ret[-1]{local_sched_arr} // $ret[-1]{local_rt_dep}
// $ret[-1]{local_sched_dep};
$ret[-1]{local_dt_da} = $ret[-1]{local_rt_dep}
// $ret[-1]{local_sched_dep} // $ret[-1]{local_rt_arr}
// $ret[-1]{local_sched_arr};
}
} }
$promise->resolve( \@ret, $journey, $hafas ); $promise->resolve( \@ret, $journey, $hafas );
......
This diff is collapsed.
This diff is collapsed.
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
font-family: 'Material Icons'; font-family: 'Material Icons';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: url(/static/v92/fonts/MaterialIcons-Regular.eot); /* For IE6-8 */ src: url(/static/v93/fonts/MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'), src: local('Material Icons'),
local('MaterialIcons-Regular'), local('MaterialIcons-Regular'),
url(/static/v92/fonts/MaterialIcons-Regular.woff2) format('woff2'), url(/static/v93/fonts/MaterialIcons-Regular.woff2) format('woff2'),
url(/static/v92/fonts/MaterialIcons-Regular.woff) format('woff'), url(/static/v93/fonts/MaterialIcons-Regular.woff) format('woff'),
url(/static/v92/fonts/MaterialIcons-Regular.ttf) format('truetype'); url(/static/v93/fonts/MaterialIcons-Regular.ttf) format('truetype');
} }
.material-icons { .material-icons {
......
...@@ -618,6 +618,14 @@ div.app { ...@@ -618,6 +618,14 @@ div.app {
list-style-type: circle; list-style-type: circle;
} }
.sched-delayed:before {
content: "(";
}
.sched-delayed:after {
content: ")";
}
i.material-icons { i.material-icons {
font-size: 14px; font-size: 14px;
} }
......
...@@ -44,6 +44,9 @@ ...@@ -44,6 +44,9 @@
% } % }
% elsif ($departure->{prep_time}) { % elsif ($departure->{prep_time}) {
Ein: <%= $departure->{prep_time} %> Ein: <%= $departure->{prep_time} %>
% }
% if ($departure->{tz_offset} and $departure->{local_sched_arr}) {
<br/>Lokal: <%= $departure->{local_sched_arr}->strftime('%H:%M') %>
% } % }
</div> </div>
</div> </div>
...@@ -106,6 +109,9 @@ ...@@ -106,6 +109,9 @@
% } % }
% elsif ($departure->{sched_departure}) { % elsif ($departure->{sched_departure}) {
Ab: <%= $departure->{sched_departure} %> Ab: <%= $departure->{sched_departure} %>
% }
% if ($departure->{tz_offset} and $departure->{local_sched_dep}) {
<br/>Lokal: <%= $departure->{local_sched_dep}->strftime('%H:%M') %>
% } % }
</div> </div>
</div> </div>
...@@ -252,13 +258,16 @@ ...@@ -252,13 +258,16 @@
generic-stop generic-stop
% } % }
% if (($stop->{rt_dep} and $stop->{dep_delay}) or (not $stop->{rt_dep} and $stop->{rt_arr} and $stop->{arr_delay})) { % if (($stop->{rt_dep} and $stop->{dep_delay}) or (not $stop->{rt_dep} and $stop->{rt_arr} and $stop->{arr_delay})) {
"><%= ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') %> (heute <%= ($stop->{rt_dep} // $stop->{rt_arr})->strftime('%H:%M') %>) "><%= ($stop->{rt_dep} // $stop->{rt_arr})->strftime('%H:%M') %> <span class="sched-delayed"><%= ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') %></span>
% } % }
% else { % else {
"><%= ($stop->{sched_dep} // $stop->{sched_arr}) ? ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') : q{} %> "><%= ($stop->{sched_dep} // $stop->{sched_arr}) ? ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') : q{} %>
% if ($stop->{rt_bogus}) { % if ($stop->{rt_bogus}) {
<i class="material-icons" aria-label="Echtzeitdaten fehlen">gps_off</i> <i class="material-icons" aria-label="Echtzeitdaten fehlen">gps_off</i>
% } % }
% }
% if ($stop->{tz_offset} and $stop->{local_dt_da}) {
(lokal <%= $stop->{local_dt_da}->strftime('%H:%M') %>)
% } % }
<%= $stop->{name} %></a> <%= $stop->{name} %></a>
% if ($stop->{load}{FIRST} or $stop->{load}{SECOND}) { % if ($stop->{load}{FIRST} or $stop->{load}{SECOND}) {
...@@ -269,15 +278,19 @@ ...@@ -269,15 +278,19 @@
</li> </li>
% } % }
% if (stash('station_name')) { % if (stash('station_name')) {
<li class="<%= $departure->{is_cancelled} ? 'cancelled-stop' : q{} %> <%= $departure->{isPast} ? 'past-stop' : 'future-stop' %>"><%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %> <li class="<%= $departure->{is_cancelled} ? 'cancelled-stop' : q{} %> <%= $departure->{isPast} ? 'past-stop' : 'future-stop' %>">
%= $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}) { % if ($departure->{departure} and $departure->{sched_departure} and $departure->{departure} ne $departure->{sched_departure}) {
(heute <%= $departure->{departure} %>) <span class="sched-delayed"><%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %></span>
% } % }
% elsif ($departure->{arrival} and $departure->{sched_arrival} and $departure->{arrival} ne $departure->{sched_arrival}) { % elsif ($departure->{arrival} and $departure->{sched_arrival} and $departure->{arrival} ne $departure->{sched_arrival}) {
(heute <%= $departure->{arrival} %>) <span class="sched-delayed"><%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %></span>
% } % }
% if ($departure->{missing_realtime} or $departure->{no_realtime_yet}) { % if ($departure->{missing_realtime} or $departure->{no_realtime_yet}) {
<i class="material-icons" aria-label="Echtzeitdaten fehlen">gps_off</i> <i class="material-icons" aria-label="Echtzeitdaten fehlen">gps_off</i>
% }
% if ($departure->{tz_offset} and $departure->{local_dt_da}) {
(lokal <%= $departure->{local_dt_da}->strftime('%H:%M') %>)
% } % }
<strong><%= stash('station_name') %></strong> <strong><%= stash('station_name') %></strong>
% if (my $u = $departure->{utilization}) { % if (my $u = $departure->{utilization}) {
...@@ -303,13 +316,16 @@ ...@@ -303,13 +316,16 @@
generic-stop generic-stop
% } % }
% if (($stop->{rt_arr} and $stop->{arr_delay}) or (not $stop->{rt_arr} and $stop->{rt_dep} and $stop->{dep_delay})) { % if (($stop->{rt_arr} and $stop->{arr_delay}) or (not $stop->{rt_arr} and $stop->{rt_dep} and $stop->{dep_delay})) {
"><%= ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') %> (heute <%= ($stop->{rt_arr} // $stop->{rt_dep})->strftime('%H:%M') %>) "><%= ($stop->{rt_arr} // $stop->{rt_dep})->strftime('%H:%M') %> <span class="sched-delayed"><%= ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') %></span>
% } % }
% else { % else {
"><%= ($stop->{sched_arr} // $stop->{sched_dep}) ? ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') : q{} %> "><%= ($stop->{sched_arr} // $stop->{sched_dep}) ? ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') : q{} %>
% if ($stop->{rt_bogus}) { % if ($stop->{rt_bogus}) {
<i class="material-icons" aria-label="Echtzeitdaten fehlen">gps_off</i> <i class="material-icons" aria-label="Echtzeitdaten fehlen">gps_off</i>
% } % }
% }
% if ($stop->{tz_offset} and $stop->{local_dt_ad}) {
(lokal <%= $stop->{local_dt_ad}->strftime('%H:%M') %>)
% } % }
<%= $stop->{name} %></a> <%= $stop->{name} %></a>
% if ($stop->{load}{FIRST} or $stop->{load}{SECOND}) { % if ($stop->{load}{FIRST} or $stop->{load}{SECOND}) {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<meta http-equiv="refresh" content="<%= $self->stash('refresh_interval') %>"/> <meta http-equiv="refresh" content="<%= $self->stash('refresh_interval') %>"/>
% } % }
% my $av = 'v92'; # asset version % my $av = 'v93'; # asset version
% if (session('theme') and session('theme') eq 'dark' or param('dark')) { % if (session('theme') and session('theme') eq 'dark' or param('dark')) {
%= stylesheet "/static/${av}/css/dark.min.css", id => 'theme' %= stylesheet "/static/${av}/css/dark.min.css", id => 'theme'
% } % }
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<meta http-equiv="refresh" content="<%= $self->stash('refresh_interval') %>"/> <meta http-equiv="refresh" content="<%= $self->stash('refresh_interval') %>"/>
% } % }
% my $av = 'v92'; # asset version % my $av = 'v93'; # asset version
%= stylesheet "/static/${av}/css/default.css" %= stylesheet "/static/${av}/css/default.css"
%= stylesheet "/static/${av}/css/material-icons.css" %= stylesheet "/static/${av}/css/material-icons.css"
%= stylesheet "/static/${av}/css/jquery-ui.min.css" %= stylesheet "/static/${av}/css/jquery-ui.min.css"
......