summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm12
-rw-r--r--templates/landingpage.html.ep2
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index 0f6b64f..8f560a9 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -1095,7 +1095,17 @@ sub redirect_to_station {
my ($self) = @_;
my $station = $self->param('station');
- $self->redirect_to("/s/${station}");
+ if ( my $s = $self->app->stations->search($station) ) {
+ if ( $s->{hafas} ) {
+ $self->redirect_to("/s/${station}?hafas=1");
+ }
+ else {
+ $self->redirect_to("/s/${station}");
+ }
+ }
+ else {
+ $self->redirect_to("/s/${station}?hafas=1");
+ }
}
sub cancelled {
diff --git a/templates/landingpage.html.ep b/templates/landingpage.html.ep
index bf2835e..42a46f2 100644
--- a/templates/landingpage.html.ep
+++ b/templates/landingpage.html.ep
@@ -61,7 +61,7 @@
%= form_for 'list_departures' => begin
<div class="input-field">
%= text_field 'station', id => 'station', class => 'autocomplete contrast-color-text', autocomplete => 'off', required => undef
- <label for="station">Manuelle Eingabe (Name oder DS100)</label>
+ <label for="station">Manuelle Eingabe</label>
</div>
<div class="center-align">
<button class="btn waves-effect waves-light btn-flat" type="submit" name="action" value="departures">