diff options
-rw-r--r-- | lib/DBInfoscreen/Controller/Stationboard.pm | 10 | ||||
-rw-r--r-- | templates/_train_details.html.ep | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 2013669..cba737c 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -411,6 +411,7 @@ sub format_hafas_result_info { sub render_train { my ( $self, $result, $departure, $station_name, $template ) = @_; + $departure->{links} = []; $departure->{route_pre_diff} = [ $self->json_route_diff( [ $result->route_pre ], @@ -609,6 +610,15 @@ sub render_train { if ( $message->{display} ) { push( @him_messages, [ $message->{header}, $message->{lead} ] ); + if ( $message->{lead} =~ m{zuginfo.nrw/?\?msg=(\d+)} ) { + push( + @{ $departure->{links} }, + [ + "Großstörung", + "https://zuginfo.nrw/?msg=$1" + ] + ); + } } } for my $message ( @{ $departure->{moreinfo} // [] } ) { diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index adfc5b4..3168852 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -115,6 +115,9 @@ % elsif ($icetype and $icetype->[1] and $departure->{train_type} ne 'Bus') { <span class="disabledbutton"><i class="material-icons" aria-hidden="true">compare_arrows</i> Plan: <%= $icetype->[0] %></span> % } +% for my $link (@{$departure->{links}}) { + <a class="smallbutton" href="<%= $link->[1] %>"><i class="material-icons" aria-hidden="true">warning</i> <%= $link->[0] %></a> +% } </div> % if ($departure->{moreinfo} and @{$departure->{moreinfo}}) { |