From 96dfab6a7fec08e2c83bbc0bd22b330985692784 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 17 Dec 2025 18:32:55 +0100 Subject: View: Normalize trip type / line number to avoid redundancy Closes #343 --- templates/_departures_dbris.html.ep | 2 +- templates/_format_train.html.ep | 5 ++++- templates/_history_trains.html.ep | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/_departures_dbris.html.ep b/templates/_departures_dbris.html.ep index dbd1a70..f769f13 100644 --- a/templates/_departures_dbris.html.ep +++ b/templates/_departures_dbris.html.ep @@ -33,7 +33,7 @@ gps_off % } - + %= $result->line diff --git a/templates/_format_train.html.ep b/templates/_format_train.html.ep index cb81211..f06e905 100644 --- a/templates/_format_train.html.ep +++ b/templates/_format_train.html.ep @@ -1,10 +1,13 @@ % if ($journey->{extra_data}{wagonorder_pride}) { 🏳️‍🌈 % } - + % if (not $journey->{is_motis}) { <%= $journey->{train_type} %> % } + % if ($journey->{train_type} and $journey->{train_line}) { + % $journey->{train_line} =~ s{ ^ \Q$journey->{train_type}\E (?= \d ) }{}x; + % } <%= $journey->{train_line} // $journey->{train_no}%> % if ($journey->{train_line}) { diff --git a/templates/_history_trains.html.ep b/templates/_history_trains.html.ep index 166d74d..0a9abd5 100644 --- a/templates/_history_trains.html.ep +++ b/templates/_history_trains.html.ep @@ -16,10 +16,13 @@ % }
  • - + % if (length($travel->{type}) < 5 and not $travel->{is_motis}) { <%= $travel->{type} %> % } + % if ($travel->{type} and $travel->{line}) { + % $travel->{line} =~ s{ ^ \Q$travel->{type}\E (?= \d ) }{}x; + % } <%= $travel->{line} // $travel->{no}%> -- cgit v1.2.3