manual station entry: HAFAS support

This commit is contained in:
Birte Kristina Friesel 2023-08-18 20:42:37 +02:00
parent 379da61de4
commit 54547eb3af
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA
2 changed files with 12 additions and 2 deletions

View file

@ -1095,8 +1095,18 @@ sub redirect_to_station {
my ($self) = @_;
my $station = $self->param('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 {
my ($self) = @_;

View file

@ -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">