From ae9d9eb60018e0b69bf072ce21cfab48fc1ef6ae Mon Sep 17 00:00:00 2001 From: networkException Date: Thu, 15 May 2025 17:35:43 +0200 Subject: Generate bahn.expert details link based on trip_id for DBRIS (#36) Generate bahn.expert details link based on trip_id for DBRIS This patch adds a conditional for the train details page to generate the bahn.expert details outlink based on the trip_id when using DBRIS bahn.de. This is a lot more reliable compared to concating category and train number / date. As bahn.expert recently added support for resolving these HAFAS trip ids to RIS::Journey journeys, the data quality is also on par. See https://chaos.social/@marudor/114404980599765615 --------- Co-authored-by: Birte Kristina Friesel --- templates/_train_details.html.ep | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index a1c46db..6f9de56 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -155,7 +155,9 @@ <%= $departure->{wr_text} || 'Wagen' %> % } -% if ($departure->{train_type} and $departure->{train_no} and (not param('hafas') or param('hafas') eq 'DB')) { +% if ($departure->{trip_id} and param('dbris') eq 'bahn.de') { + Details +% } elsif ($departure->{train_type} and $departure->{train_no} and (not param('hafas') or param('hafas') eq 'DB')) { Details % } % for my $link (@{$departure->{links}}) { -- cgit v1.2.3