diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-05-01 12:29:59 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-05-01 12:29:59 +0200 |
commit | 35bf3022330602242d0d8dbf7a7b2a7b2bd66e71 (patch) | |
tree | 8072db177e5bf95500f72e82fdc2857561a4e0c4 | |
parent | f0bbf6b8ab0b9ad5c8f8503792cdc807731280ab (diff) |
Indicate carriages belonging to other trains in carriage formation preview
-rw-r--r-- | lib/DBInfoscreen/Controller/Stationboard.pm | 19 | ||||
-rw-r--r-- | sass/app.scss | 8 | ||||
-rw-r--r-- | templates/_train_details.html.ep | 12 |
3 files changed, 32 insertions, 7 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 4d8406e..017e4f2 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -759,13 +759,19 @@ sub render_train { or $wagon->is_powercar ) ) { + my $class; if ($first) { - push( @{ $departure->{wr_preview} }, '•' ); + push( + @{ $departure->{wr_preview} }, + [ '•', 'meta' ] + ); $first = 0; + say "-"; } my $entry; if ( $wagon->is_closed ) { $entry = 'X'; + $class = 'closed'; } else { $entry = $wagon->number @@ -776,7 +782,16 @@ sub render_train { : $wagon->type ); } - push( @{ $departure->{wr_preview} }, $entry ); + if ( + $group->train_no ne $departure->{train_no} ) + { + $class = 'otherno'; + } + say $entry; + push( + @{ $departure->{wr_preview} }, + [ $entry, $class ] + ); } } $first = 1; diff --git a/sass/app.scss b/sass/app.scss index d69e41e..fb81921 100644 --- a/sass/app.scss +++ b/sass/app.scss @@ -558,6 +558,14 @@ div.app { a { color: $fg; } + + .otherno { + color: $fg2; + } + + .meta { + color: $fg1; + } } .departure { diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index 0f02483..425446a 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -124,11 +124,13 @@ % } <a href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{wr_direction} // '' %>"> %= $direction - % if (defined $departure->{direction_num} and $departure->{direction_num} != $wr->direction) { - %= join(q{ }, reverse @{$departure->{wr_preview} // []}) - % } - % else { - %= join(q{ }, @{$departure->{wr_preview} // []}) + % for my $entry ((defined $departure->{wr_direction_num} and $departure->{wr_direction_num} != $wr->direction) ? reverse @{$departure->{wr_preview} // []} : @{$departure->{wr_preview} // []}) { + % if ($entry->[1]) { + <span class="<%= $entry->[1] %>"><%= $entry->[0] %></span> + % } + % else { + %= $entry->[0] + % } % } %= $direction </a> |