From 99a89560321cb6981f06c5ea783b11acaec98ada Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 30 Aug 2024 16:55:13 +0200 Subject: [PATCH] Use "Steig" rather than "Gleis" for bus platforms --- lib/Travelynx/Model/InTransit.pm | 5 +++++ templates/_checked_in.html.ep | 12 ++++++------ templates/_connections_hafas.html.ep | 10 +++++++++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/lib/Travelynx/Model/InTransit.pm b/lib/Travelynx/Model/InTransit.pm index 4f54c7d..62e60f1 100644 --- a/lib/Travelynx/Model/InTransit.pm +++ b/lib/Travelynx/Model/InTransit.pm @@ -265,6 +265,11 @@ sub postprocess { $ret->{extra_data} = $ret->{data}; $ret->{comment} = $ret->{user_data}{comment}; + $ret->{platform_type} = 'Gleis'; + if ( $ret->{train_type} =~ m{ ast | bus | ruf }ix ) { + $ret->{platform_type} = 'Steig'; + } + $ret->{visibility_str} = $ret->{visibility} ? $visibility_itoa{ $ret->{visibility} } diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep index 9e69218..797ff57 100644 --- a/templates/_checked_in.html.ep +++ b/templates/_checked_in.html.ep @@ -42,13 +42,13 @@ % } % if ($journey->{arrival_countdown} < (60 * 15) and $journey->{arr_platform}) { % if ($journey->{arr_direction} and $journey->{arr_direction} eq 'r') { -
Gleis <%= $journey->{arr_platform} %> ▶ +
<%= $journey->{platform_type} %> <%= $journey->{arr_platform} %> ▶ % } % elsif ($journey->{arr_direction} and $journey->{arr_direction} eq 'l') { -
◀ Gleis <%= $journey->{arr_platform} %> +
◀ <%= $journey->{platform_type} %> <%= $journey->{arr_platform} %> % } % else { -
auf Gleis <%= $journey->{arr_platform} %> +
auf <%= $journey->{platform_type} %> <%= $journey->{arr_platform} %> % } % } % } @@ -57,13 +57,13 @@ % } % if ($journey->{departure_countdown} > 0 and $journey->{dep_platform}) { % if ($journey->{dep_direction} and $journey->{dep_direction} eq 'r') { -
Gleis <%= $journey->{dep_platform} %> ▶ +
<%= $journey->{platform_type} %> <%= $journey->{dep_platform} %> ▶ % } % elsif ($journey->{dep_direction} and $journey->{dep_direction} eq 'l') { -
◀ Gleis <%= $journey->{dep_platform} %> +
◀ <%= $journey->{platform_type} %> <%= $journey->{dep_platform} %> % } % else { -
von Gleis <%= $journey->{dep_platform} %> +
von <%= $journey->{platform_type} %> <%= $journey->{dep_platform} %> % } % } % if (my $wr = $journey->{wagonorder}) { diff --git a/templates/_connections_hafas.html.ep b/templates/_connections_hafas.html.ep index 43198e2..3b995b5 100644 --- a/templates/_connections_hafas.html.ep +++ b/templates/_connections_hafas.html.ep @@ -35,7 +35,15 @@ % if ($train->platform) { - Gleis <%= $train->platform %> + + % if (($train->type // q{}) =~ m{ ast | bus | ruf }ix) { + Steig + % } + % else { + Gleis + % } + %= $train->platform + % } %= $train->line