From 897b88691c05adda8eaca09c3064b12ecfa74062 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Mon, 12 Aug 2024 18:16:21 +0200 Subject: [PATCH] backend selection: add homepage links --- lib/Travelynx/Controller/Account.pm | 9 ++++++--- templates/select_backend.html.ep | 14 +++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm index 08d173a..09aa81a 100644 --- a/lib/Travelynx/Controller/Account.pm +++ b/lib/Travelynx/Controller/Account.pm @@ -1008,13 +1008,16 @@ sub backend_form { for my $backend (@backends) { my $type = 'UNKNOWN'; if ( $backend->{iris} ) { - $type = 'IRIS-TTS'; - $backend->{name} = 'DB'; + $type = 'IRIS-TTS'; + $backend->{name} = 'DB'; + $backend->{longname} = 'Deutsche Bahn'; + $backend->{homepage} = 'https://www.bahn.de'; } elsif ( $backend->{hafas} ) { if ( my $s = $self->hafas->get_service( $backend->{name} ) ) { - $type = 'HAFAS'; + $type = 'HAFAS'; $backend->{longname} = $s->{name}; + $backend->{homepage} = $s->{homepage}; } else { $type = undef; diff --git a/templates/select_backend.html.ep b/templates/select_backend.html.ep index 4eb4cc9..0a76fda 100644 --- a/templates/select_backend.html.ep +++ b/templates/select_backend.html.ep @@ -16,19 +16,19 @@ % } % for my $backend (@{ stash('backends') // [] }) {
-
- -
-
+
% if ($backend->{longname}) { - <%= $backend->{longname} %> + <%= $backend->{longname} %> % } % if ($backend->{id} == $user->{backend_id}) { (aktuell ausgewählt) % }
+
+ +
% } %= end