summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-08-12 18:16:21 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-08-12 18:16:41 +0200
commit897b88691c05adda8eaca09c3064b12ecfa74062 (patch)
tree40c7d273a09d7a6e00f673c0e89bd478151b970e
parente2b5365810bd49c799b396a98cbb07b54a86f475 (diff)
backend selection: add homepage links
-rw-r--r--lib/Travelynx/Controller/Account.pm9
-rw-r--r--templates/select_backend.html.ep14
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') // [] }) {
<div class="row">
- <div class="col s12 m4 l4 center-align">
- <button class="btn waves-effect waves-light <%= $backend->{id} == $user->{backend_id} ? 'disabled' : q{} %>" type="submit" name="backend" value="<%= $backend->{id} %>">
- <%= $backend->{name} %> (<%= $backend->{type} %>)
- </button>
- </div>
- <div class="col s12 m8 l8">
+ <div class="col s8 m6 l6 right-align">
% if ($backend->{longname}) {
- <%= $backend->{longname} %>
+ <a href="<%= $backend->{homepage} %>"><%= $backend->{longname} %></a>
% }
% if ($backend->{id} == $user->{backend_id}) {
(aktuell ausgewählt)
% }
</div>
+ <div class="col s4 m6 l6 left-align">
+ <button class="btn waves-effect waves-light <%= $backend->{id} == $user->{backend_id} ? 'disabled' : q{} %>" type="submit" name="backend" value="<%= $backend->{id} %>">
+ <%= $backend->{name} %> (<%= $backend->{type} %>)
+ </button>
+ </div>
</div>
% }
%= end