From c65c85f3e23f3d4f5cc3f1faf70b6fb6e9578baa Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 12 Feb 2023 12:42:55 +0100 Subject: add bahn.expert link to train details page --- lib/DBInfoscreen/Controller/Stationboard.pm | 3 +++ public/static/icons/bahn-expert.svg | 5 +++++ sass/app.scss | 7 +++++++ templates/_train_details.html.ep | 3 +++ 4 files changed, 18 insertions(+) create mode 100644 public/static/icons/bahn-expert.svg diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index a81c7d5..05d4afb 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -1038,6 +1038,8 @@ sub station_train_details { wr_link => $result->sched_departure ? $result->sched_departure->strftime('%Y%m%d%H%M') : undef, + eva => $result->station_uic, + start => $result->start, }; $self->stash( title => $status->station->{name} @@ -1174,6 +1176,7 @@ sub train_details { ); } my $station_info = shift( @{ $res->{route_post_diff} } ); + $res->{eva} = $station_info->{eva}; if ( $station_info->{sched_arr} ) { $res->{sched_arrival} = $station_info->{sched_arr}->strftime('%H:%M'); diff --git a/public/static/icons/bahn-expert.svg b/public/static/icons/bahn-expert.svg new file mode 100644 index 0000000..4cee072 --- /dev/null +++ b/public/static/icons/bahn-expert.svg @@ -0,0 +1,5 @@ + + + diff --git a/sass/app.scss b/sass/app.scss index 62b2cbd..9b37ece 100644 --- a/sass/app.scss +++ b/sass/app.scss @@ -821,6 +821,13 @@ div.field { margin-right: 0.5ex; } +.smallbutton img { + display: block; + float: left; + margin-right: 0.7ex; + height: 1.2em; +} + input, select, .button { display: inline-block; width: 60em; diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index 82f0257..f212525 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -144,6 +144,9 @@ % elsif ($icetype and $icetype->[1] and $linetype eq 'fern') { Plan: <%= $icetype->[0] %> % } +% if ($departure->{train_type} and $departure->{train_no}) { + Details +% } % for my $link (@{$departure->{links}}) { <%= $link->[0] %> % } -- cgit v1.2.3