summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-06-12 21:10:48 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-06-12 21:10:48 +0200
commit29fb9c3a7ff1983efb441b2c47d1264d6d1b91c7 (patch)
tree677fd089b6af9fb4a257a5a00111efa1db31350a
parentec2fa31a0f26a99e5d54da75c40a56261b692f90 (diff)
Use explicit hafas=DB links4.27.4
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm2
-rw-r--r--templates/app.html.ep8
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm
index 9e2f2ea..8e1e7df 100644
--- a/lib/DBInfoscreen/Controller/Stationboard.pm
+++ b/lib/DBInfoscreen/Controller/Stationboard.pm
@@ -1999,7 +1999,7 @@ sub handle_result {
my $station_name = $data->{station_name} // $self->stash('station');
my ( $api_link, $api_text, $api_icon );
my $params = $self->req->params->clone;
- $params->param( hafas => not $params->param('hafas') );
+ $params->param( hafas => $params->param('hafas') ? q{} : 'DB' );
if ( $params->param('hafas') ) {
if ( $data->{station_eva} >= 8100000
and $data->{station_eva} < 8200000 )
diff --git a/templates/app.html.ep b/templates/app.html.ep
index 214bee1..e81191b 100644
--- a/templates/app.html.ep
+++ b/templates/app.html.ep
@@ -53,9 +53,9 @@
>
% }
% if (param('hafas')) {
- <a href="/z/<%= Mojo::Util::url_escape($departure->{journey_id}) . '?hafas=1&highlight=' . Mojo::Util::url_escape($departure->{station} // $station) %>">
+ <a href="/z/<%= Mojo::Util::url_escape($departure->{journey_id}) . '?hafas=' . Mojo::Util::url_escape(param('hafas')) . '&highlight=' . Mojo::Util::url_escape($departure->{station} // $station) %>">
% }
-% else {
+% elsif (not param('efa')) {
<a href="/z/<%= Mojo::Util::url_escape(($departure->{train_type} // q{}) . ' ' . ($departure->{train_no} // $departure->{train} // q{})) . '/' . Mojo::Util::url_escape($departure->{station} // $station) %>">
% }
<div class="anchor" id="<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>"></div>
@@ -177,7 +177,9 @@
%= $route_str
</span>
% }
- </a>
+% if (not param('efa')) {
+ </a>
+% }
</li>
% }