Skip to content
Commits on Source (5)
......@@ -874,6 +874,16 @@ sub render_train {
= [ $load->{FIRST}, $load->{SECOND} ];
}
}
$departure->{tz_offset} = $route->[$i]{tz_offset};
$departure->{local_dt_da} = $route->[$i]{local_dt_da};
$departure->{local_sched_arr}
= $route->[$i]{local_sched_arr};
$departure->{local_sched_dep}
= $route->[$i]{local_sched_dep};
$departure->{is_annotated} = $route->[$i]{is_annotated};
$departure->{prod_name} = $route->[$i]{prod_name};
$departure->{direction} = $route->[$i]{direction};
$departure->{operator} = $route->[$i]{operator};
last;
}
}
......@@ -1247,6 +1257,10 @@ sub train_details {
$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->{is_annotated} = $station_info->{is_annotated};
$res->{prod_name} = $station_info->{prod_name};
$res->{direction} = $station_info->{direction};
$res->{operator} = $station_info->{operator};
$res->{platform} = $station_info->{platform};
$res->{scheduled_platform}
= $station_info->{sched_platform};
......
......@@ -105,7 +105,67 @@ sub get_route_p {
my $journey = $hafas->result;
my @ret;
my $station_is_past = 1;
my $num_names = 0;
my $prev_name = q{};
my $num_directions = 0;
my $prev_direction = q{};
my $num_operators = 0;
my $prev_operator = q{};
for my $stop ( $journey->route ) {
my $prod = $stop->prod_dep // $stop->prod_arr;
if ( $prod and $prod->name and $prod->name ne $prev_name ) {
$num_names++;
$prev_name = $prod->name;
}
if ( $prod
and $prod->operator
and $prod->operator ne $prev_operator )
{
$num_operators++;
$prev_operator = $prod->operator;
}
if ( $stop->direction and $stop->direction ne $prev_direction )
{
$num_directions++;
$prev_direction = $stop->direction;
}
}
$prev_name = q{};
$prev_direction = q{};
$prev_operator = q{};
for my $stop ( $journey->route ) {
my $prod = $stop->prod_dep // $stop->prod_arr;
my %annotation;
if ( $num_names > 1
and $prod
and $prod->name
and $prod->name ne $prev_name )
{
$prev_name = $annotation{prod_name} = $prod->name;
}
if ( $num_operators > 1
and $prod
and $prod->operator
and $prod->operator ne $prev_operator )
{
$prev_operator = $annotation{operator} = $prod->operator;
}
if ( $num_directions > 1
and $stop->direction
and $stop->direction ne $prev_direction )
{
$prev_direction = $annotation{direction} = $stop->direction;
}
if (%annotation) {
$annotation{is_annotated} = 1;
}
push(
@ret,
{
......@@ -129,6 +189,7 @@ sub get_route_p {
and
( $stop->dep_cancelled or not $stop->sched_dep )
),
%annotation,
}
);
if (
......
This diff is collapsed.
This diff is collapsed.
......@@ -2,12 +2,12 @@
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(/static/v94/fonts/MaterialIcons-Regular.eot); /* For IE6-8 */
src: url(/static/v95/fonts/MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(/static/v94/fonts/MaterialIcons-Regular.woff2) format('woff2'),
url(/static/v94/fonts/MaterialIcons-Regular.woff) format('woff'),
url(/static/v94/fonts/MaterialIcons-Regular.ttf) format('truetype');
url(/static/v95/fonts/MaterialIcons-Regular.woff2) format('woff2'),
url(/static/v95/fonts/MaterialIcons-Regular.woff) format('woff'),
url(/static/v95/fonts/MaterialIcons-Regular.ttf) format('truetype');
}
.material-icons {
......
......@@ -618,6 +618,12 @@ div.app {
list-style-type: circle;
}
.annotation {
color: $fg2;
list-style-type: none;
padding-left: 3em;
}
.sched-delayed:before {
content: "(";
}
......
......@@ -243,6 +243,19 @@
% }
<ul class="mroute">
% for my $stop (@{$departure->{route_pre_diff}}) {
% if ($stop->{is_annotated} and $stop->{prod_name}) {
<li class="annotation">
% if ($stop->{prod_name}) {
%= $stop->{prod_name}
% }
% if ($stop->{direction}) {
→ <%= $stop->{direction} %>
% }
% if ($stop->{operator}) {
(<%= $stop->{operator} %>)
% }
</li>
% }
<li class="<%= $stop->{isPast} ? 'past-stop' : 'future-stop' %>">
<a href="<%= url_for('station', station => $stop->{eva} // $stop->{name})->query({detailed => param('detailed'), past => param('past'), rt => param('rt'), hafas => param('hafas')}) %>#<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>" class="
% if ($stop->{isAdditional}) {
......@@ -278,6 +291,19 @@
</li>
% }
% if (stash('station_name')) {
% if ($departure->{is_annotated} and $departure->{prod_name}) {
<li class="annotation">
% if ($departure->{prod_name}) {
%= $departure->{prod_name}
% }
% if ($departure->{direction}) {
→ <%= $departure->{direction} %>
% }
% if ($departure->{operator}) {
(<%= $departure->{operator} %>)
% }
</li>
% }
<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}) {
......@@ -301,6 +327,19 @@
</li>
% }
% for my $stop (@{$departure->{route_post_diff}}) {
% if ($stop->{is_annotated} and $stop->{prod_name}) {
<li class="annotation">
% if ($stop->{prod_name}) {
%= $stop->{prod_name}
% }
% if ($stop->{direction}) {
→ <%= $stop->{direction} %>
% }
% if ($stop->{operator}) {
(<%= $stop->{operator} %>)
% }
</li>
% }
<li class="<%= $stop->{isPast} ? 'past-stop' : 'future-stop' %>">
<a href="<%= url_for('station', station => $stop->{eva} // $stop->{name})->query({detailed => param('detailed'), past => param('past'), rt => param('rt'), hafas => param('hafas')}) %>#<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>" class="
% if ($stop->{isAdditional}) {
......
......@@ -18,7 +18,7 @@
<meta http-equiv="refresh" content="<%= $self->stash('refresh_interval') %>"/>
% }
% my $av = 'v94'; # asset version
% my $av = 'v95'; # asset version
% if (session('theme') and session('theme') eq 'dark' or param('dark')) {
%= stylesheet "/static/${av}/css/dark.min.css", id => 'theme'
% }
......
......@@ -17,13 +17,13 @@
<meta http-equiv="refresh" content="<%= $self->stash('refresh_interval') %>"/>
% }
% my $av = 'v94'; # asset version
%= stylesheet "/static/${av}/css/default.css"
% my $av = 'v95'; # asset version
%= stylesheet "/static/${av}/css/legacy.css"
%= stylesheet "/static/${av}/css/material-icons.css"
%= stylesheet "/static/${av}/css/jquery-ui.min.css"
% my $force_mobile = param('force_mobile') // stash('force_mobile');
% if ($force_mobile) {
%= stylesheet "/static/${av}/css/mobile.css"
%= stylesheet "/static/${av}/css/legacy-mobile.css"
% }
%if (stash('load_marquee')) {
%= javascript '/static/js/jquery-3.4.1.min.js'
......