manual station entry: HAFAS support
This commit is contained in:
parent
379da61de4
commit
54547eb3af
2 changed files with 12 additions and 2 deletions
|
@ -1095,7 +1095,17 @@ sub redirect_to_station {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
my $station = $self->param('station');
|
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 {
|
sub cancelled {
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
%= form_for 'list_departures' => begin
|
%= form_for 'list_departures' => begin
|
||||||
<div class="input-field">
|
<div class="input-field">
|
||||||
%= text_field 'station', id => 'station', class => 'autocomplete contrast-color-text', autocomplete => 'off', required => undef
|
%= 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>
|
||||||
<div class="center-align">
|
<div class="center-align">
|
||||||
<button class="btn waves-effect waves-light btn-flat" type="submit" name="action" value="departures">
|
<button class="btn waves-effect waves-light btn-flat" type="submit" name="action" value="departures">
|
||||||
|
|
Loading…
Reference in a new issue