diff options
| author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-04-18 13:04:35 +0200 | 
|---|---|---|
| committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-04-18 13:04:35 +0200 | 
| commit | 75411af57219a256a767361cb7c8caae1477ba9c (patch) | |
| tree | 315e31c00094459a8190d7be53794a10f9e2a95e /lib/DBInfoscreen | |
| parent | 45a85b48185b7f810271a3f83e99547d1fbba32d (diff) | |
Stationboard: dbris: show messages and attributes4.36.10
Diffstat (limited to 'lib/DBInfoscreen')
| -rw-r--r-- | lib/DBInfoscreen/Controller/Stationboard.pm | 39 | 
1 files changed, 38 insertions, 1 deletions
| diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index d05a5b1..662ef67 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -1305,17 +1305,54 @@ sub train_details_dbris {  			my ($dbris) = @_;  			my $trip = $dbris->result; +			my ( @him_messages, @him_details ); +			for my $message ( $trip->messages ) { +				if ( not $message->{ueberschrift} ) { +					push( +						@him_messages, +						[ +							q{}, +							{ +								icon => $message->{prioritaet} eq 'HOCH' +								? 'warning' +								: 'info', +								text => $message->{text} +							} +						] +					); +				} +			} + +			for my $attribute ( $trip->attributes ) { +				push( +					@him_details, +					[ +						q{}, +						{ +							text => $attribute->{value} +							  . ( +								$attribute->{teilstreckenHinweis} +								? q { } . $attribute->{teilstreckenHinweis} +								: q{} +							  ) +						} +					] +				); +			} +  			my $now = DateTime->now( time_zone => 'Europe/Berlin' );  			my $res = {  				trip_id         => $trip_id,  				train_line      => $trip->train, +				train_no        => $trip->number,  				origin          => ( $trip->route )[0]->name,  				destination     => ( $trip->route )[-1]->name,  				operators       => [],  				linetype        => 'bahn',  				route_pre_diff  => [],  				route_post_diff => [], -				moreinfo        => [], +				moreinfo        => [@him_messages], +				details         => [@him_details],  				replaced_by     => [],  				replacement_for => [],  			}; | 
