Use $train->type rather than firts part of $train->line for CSS class

In some cases (e.g. in Belgium), trains do not have a type, so the first part
of $train->line is the train number instead.
This commit is contained in:
Birte Kristina Friesel 2023-10-27 18:34:02 +02:00
parent 58b02bc698
commit 7bf99b00a5
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA
4 changed files with 4 additions and 4 deletions

View file

@ -36,7 +36,7 @@
% if ($train->platform) {
<span>Gleis <%= $train->platform %></span>
% }
<span class="dep-line <%= (split(/ /, $train->line))[0] %>">
<span class="dep-line <%= $train->type // q{} %>">
%= $train->line
</span>
</span>

View file

@ -36,7 +36,7 @@
% if ($train->platform) {
<span>Gleis <%= $train->platform %></span>
% }
<span class="dep-line <%= (split(/ /, $train->line))[0] %>">
<span class="dep-line <%= $train->type // q{} %>">
%= $train->line
</span>
</span>

View file

@ -31,7 +31,7 @@
<i class="material-icons" aria-label="Keine Echtzeitdaten vorhanden" style="font-size: 16px;">gps_off</i>
% }
</a>
<span class="dep-line <%= (split(/ /, $result->line))[0] %>">
<span class="dep-line <%= $result->type // q{} %>">
%= $result->line
</span>
<span class="dep-dest">

View file

@ -36,7 +36,7 @@
<i class="material-icons" aria-label="Keine Echtzeitdaten vorhanden" style="font-size: 16px;">gps_off</i>
% }
</a>
<span class="dep-line <%= (split(/ /, $result->line))[0] %>">
<span class="dep-line <%= $result->type // q{} %>">
%= $result->line
</span>
<span class="dep-dest">