From d3f8cfc5a03db410593fa9df5b22b154b721fad5 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 20 Mar 2021 13:23:50 +0100 Subject: train_details: do not pass unused data to view --- lib/DBInfoscreen/Controller/Stationboard.pm | 22 ++++------------------ templates/_train_details.html.ep | 3 --- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 1f42f69..28ab239 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -886,11 +886,9 @@ sub train_details { : undef, departure => $result->departure ? $result->departure->strftime('%H:%M') : undef, - train => $result->train, train_type => $result->type // '', train_line => $result->line_no, train_no => $result->train_no, - via => [ $result->route_interesting(3) ], destination => $result->destination, origin => $result->origin, platform => $result->platform, @@ -898,22 +896,10 @@ sub train_details { is_cancelled => $result->is_cancelled, departure_is_cancelled => $result->departure_is_cancelled, arrival_is_cancelled => $result->arrival_is_cancelled, - messages => { - delay => [ - map { { timestamp => $_->[0], text => $_->[1] } } - $result->delay_messages - ], - qos => [ - map { { timestamp => $_->[0], text => $_->[1] } } - $result->qos_messages - ], - }, - moreinfo => $moreinfo, - delay => $result->delay, - route_pre => [ $result->route_pre ], - route_post => [ $result->route_post ], - additional_stops => [ $result->additional_stops ], - canceled_stops => [ $result->canceled_stops ], + moreinfo => $moreinfo, + delay => $result->delay, + route_pre => [ $result->route_pre ], + route_post => [ $result->route_post ], replaced_by => [ map { $_->type . q{ } . $_->train_no } $result->replaced_by ], replacement_for => diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index 6b3e1a7..0aa3bba 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -8,9 +8,6 @@ <%= $departure->{train_line} // $departure->{train_no} %> <%= $departure->{train_line} ? $departure->{train_no} : q{} %> -% } -% else { - <%= $departure->{train} // q{???} %> % }
-- cgit v1.2.3