Show backend errors on station selection page

This commit is contained in:
Daniel Friesel 2019-03-16 21:49:47 +01:00
parent 42bb5cc493
commit 629ca9e9f6
2 changed files with 18 additions and 2 deletions

View file

@ -1458,7 +1458,11 @@ get '/s/*station' => sub {
my $status = get_departures($station); my $status = get_departures($station);
if ( $status->{errstr} ) { if ( $status->{errstr} ) {
$self->render( 'landingpage', error => $status->{errstr} ); $self->render(
'landingpage',
with_geolocation => 1,
error => $status->{errstr}
);
} }
else { else {
# You can't check into a train which terminates here # You can't check into a train which terminates here

View file

@ -1,4 +1,16 @@
% if (is_user_authenticated()) { % if (is_user_authenticated()) {
% if (stash('error')) {
<div class="row">
<div class="col s12">
<div class="card red darken-4">
<div class="card-content white-text">
<span class="card-title">Backend-Fehler</span>
<p><%= stash('error') %></p>
</div>
</div>
</div>
</div>
% }
<div class="row"> <div class="row">
<div class="col s12"> <div class="col s12">
% my $status = get_user_status(); % my $status = get_user_status();
@ -35,7 +47,7 @@
<div class="progress"><div class="indeterminate"></div></div> <div class="progress"><div class="indeterminate"></div></div>
</div> </div>
%= form_for 'list_departures' => begin %= form_for 'list_departures' => begin
<div class="input-field text-white"> <div class="input-field">
%= text_field 'station', id => 'station', class => 'autocomplete white-text', require => undef %= text_field 'station', id => 'station', class => 'autocomplete white-text', require => undef
<label for="station">Manuelle Eingabe (Name oder DS100)</label> <label for="station">Manuelle Eingabe (Name oder DS100)</label>
</div> </div>