_checked_in: HAFAS: pass train type and number to bahn.expert, if available

Patch by @networkException, thanks!

Closes #158
This commit is contained in:
Birte Kristina Friesel 2024-08-24 09:33:52 +02:00
parent 8184a17a20
commit 9fdae85904
No known key found for this signature in database
GPG key ID: B63118F7196EA660

View file

@ -358,10 +358,13 @@
<div class="card-action"> <div class="card-action">
% my $url = 'https://bahn.expert/details/'; % my $url = 'https://bahn.expert/details/';
% if ($journey->{train_id} =~ m{[|]}) { % if ($journey->{train_id} =~ m{[|]}) {
% $url = $url . '/' . $journey->{sched_departure}->epoch . '000?jid=' . $journey->{train_id} =~ s{#}{%23}gr; % if ($journey->{train_type} and $journey->{train_no}) {
% $url .= $journey->{train_type} . ' ' . $journey->{train_no};
% }
% $url .= '/' . $journey->{sched_departure}->epoch . '000?jid=' . $journey->{train_id} =~ s{#}{%23}gr;
% } % }
% else { % else {
% $url = $url . $journey->{train_type} . ' ' . $journey->{train_no} . '/' . $journey->{sched_departure}->epoch . '000?station=' . $journey->{dep_eva}; % $url .= $journey->{train_type} . ' ' . $journey->{train_no} . '/' . $journey->{sched_departure}->epoch . '000?station=' . $journey->{dep_eva};
% } % }
% if ($journey->{backend_id} <= 1) { % if ($journey->{backend_id} <= 1) {
<a style="margin-right: 0;" href="<%= $url %>"><i class="material-icons left" aria-hidden="true">timeline</i> Zuglauf</a> <a style="margin-right: 0;" href="<%= $url %>"><i class="material-icons left" aria-hidden="true">timeline</i> Zuglauf</a>