summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Travelynx/Command/dumpstops.pm2
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm16
-rw-r--r--lib/Travelynx/Model/Users.pm5
-rw-r--r--templates/departures.html.ep4
-rw-r--r--templates/disambiguation.html.ep2
-rw-r--r--templates/use_external_links.html.ep2
6 files changed, 17 insertions, 14 deletions
diff --git a/lib/Travelynx/Command/dumpstops.pm b/lib/Travelynx/Command/dumpstops.pm
index e6740ec..c8ecd7a 100644
--- a/lib/Travelynx/Command/dumpstops.pm
+++ b/lib/Travelynx/Command/dumpstops.pm
@@ -8,7 +8,7 @@ use Mojo::Base 'Mojolicious::Command';
use List::Util qw();
use Text::CSV;
-has description => 'Export HAFAS/IRIS stops to CSV';
+has description => 'Export known stops to CSV';
has usage => sub { shift->extract_usage };
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index 6ceb661..f9bc2d5 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -604,7 +604,7 @@ sub geolocation {
name => $_->name,
eva => $_->eva,
distance => $_->distance_m / 1000,
- hafas => 1
+ hafas => 'DB'
}
} $hafas->results;
if ( @hafas > 10 ) {
@@ -714,7 +714,7 @@ sub travel_action {
if ( my $destination = $params->{dest} ) {
my $station_link = '/s/' . $destination;
if ( $status->{train_id} =~ m{[|]} ) {
- $station_link .= '?hafas=1';
+ $station_link .= '?hafas=DB';
}
$self->render(
json => {
@@ -750,7 +750,7 @@ sub travel_action {
my ( $still_checked_in, $error ) = @_;
my $station_link = '/s/' . $params->{station};
if ( $status->{train_id} =~ m{[|]} ) {
- $station_link .= '?hafas=1';
+ $station_link .= '?hafas=DB';
}
if ($error) {
@@ -801,7 +801,7 @@ sub travel_action {
my $redir = '/';
if ( $status->{checked_in} or $status->{cancelled} ) {
if ( $status->{train_id} =~ m{[|]} ) {
- $redir = '/s/' . $status->{dep_eva} . '?hafas=1';
+ $redir = '/s/' . $status->{dep_eva} . '?hafas=DB';
}
else {
$redir = '/s/' . $status->{dep_ds100};
@@ -999,7 +999,7 @@ sub station {
}
else {
- $api_link = '/s/' . $status->{station_eva} . '?hafas=1';
+ $api_link = '/s/' . $status->{station_eva} . '?hafas=DB';
# You can't check into a train which terminates here
@results = grep { $_->departure } @{ $status->{results} };
@@ -1128,7 +1128,7 @@ sub station {
my @suggestions = $hafas2->results;
if ( @suggestions == 1 ) {
$self->redirect_to(
- '/s/' . $suggestions[0]->eva . '?hafas=1' );
+ '/s/' . $suggestions[0]->eva . '?hafas=DB' );
}
else {
$self->render(
@@ -1171,14 +1171,14 @@ sub redirect_to_station {
if ( my $s = $self->app->stations->search($station) ) {
if ( $s->{source} == 1 ) {
- $self->redirect_to("/s/${station}?hafas=1");
+ $self->redirect_to("/s/${station}?hafas=DB");
}
else {
$self->redirect_to("/s/${station}");
}
}
else {
- $self->redirect_to("/s/${station}?hafas=1");
+ $self->redirect_to("/s/${station}?hafas=DB");
}
}
diff --git a/lib/Travelynx/Model/Users.pm b/lib/Travelynx/Model/Users.pm
index 4602fa2..1154a02 100644
--- a/lib/Travelynx/Model/Users.pm
+++ b/lib/Travelynx/Model/Users.pm
@@ -44,7 +44,10 @@ my @sb_templates = (
undef,
[ 'DBF', 'https://dbf.finalrewind.org/{name}?rt=1#{tt}{tn}' ],
[ 'bahn.expert', 'https://bahn.expert/{name}#{id}' ],
- [ 'DBF HAFAS', 'https://dbf.finalrewind.org/{name}?rt=1&hafas=1#{tt}{tn}' ],
+ [
+ 'DBF HAFAS',
+ 'https://dbf.finalrewind.org/{name}?rt=1&hafas=DB#{tt}{tn}'
+ ],
[ 'bahn.expert/regional', 'https://bahn.expert/regional/{name}#{id}' ],
);
diff --git a/templates/departures.html.ep b/templates/departures.html.ep
index 6aac482..9fd79e6 100644
--- a/templates/departures.html.ep
+++ b/templates/departures.html.ep
@@ -93,7 +93,7 @@
<div class="row">
<div class="col s4 center-align">
% if ($hafas) {
- <a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({hafas => 1, timestamp => $datetime->clone->subtract(hours => 1)->epoch}) %>"><i class="material-icons left" aria-hidden="true">chevron_left</i><span class="hide-on-small-only">früher</span></a>
+ <a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({hafas => $hafas, timestamp => $datetime->clone->subtract(hours => 1)->epoch}) %>"><i class="material-icons left" aria-hidden="true">chevron_left</i><span class="hide-on-small-only">früher</span></a>
% }
</div>
<div class="col s4 center-align">
@@ -103,7 +103,7 @@
</div>
<div class="col s4 center-align">
% if ($hafas) {
- <a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({hafas => 1, timestamp => $datetime->clone->add(hours => 1)->epoch}) %>"><span class="hide-on-small-only">später</span><i class="material-icons right" aria-hidden="true">chevron_right</i></a>
+ <a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({hafas => $hafas, timestamp => $datetime->clone->add(hours => 1)->epoch}) %>"><span class="hide-on-small-only">später</span><i class="material-icons right" aria-hidden="true">chevron_right</i></a>
% }
</div>
</div>
diff --git a/templates/disambiguation.html.ep b/templates/disambiguation.html.ep
index 270aa99..9fc1e4c 100644
--- a/templates/disambiguation.html.ep
+++ b/templates/disambiguation.html.ep
@@ -13,7 +13,7 @@
<div class="col s12">
<ul class="suggestions">
% for my $suggestion (@{$suggestions // []}) {
- <li><a href="<%= url_for('station' => $suggestion->{eva}) . (param('hafas') ? '?hafas=1' : q{}) %>"><%= $suggestion->{name} %></a></li>
+ <li><a href="<%= url_for('station' => $suggestion->{eva}) . (param('hafas') ? '?hafas=DB' : q{}) %>"><%= $suggestion->{name} %></a></li>
% }
</ul>
</div>
diff --git a/templates/use_external_links.html.ep b/templates/use_external_links.html.ep
index d7bebd7..77dfd44 100644
--- a/templates/use_external_links.html.ep
+++ b/templates/use_external_links.html.ep
@@ -52,7 +52,7 @@
<div>
<label>
%= radio_button stationboard => '3'
- <span><a href="https://dbf.finalrewind.org/?hafas=1">DBF</a> (Nahverkehr)</span>
+ <span><a href="https://dbf.finalrewind.org/?hafas=DB">DBF</a> (Nahverkehr)</span>
</label>
</div>
</div>