From b41a64bd7f246bdf3651111d167167e61af4d0c9 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 2 Nov 2018 22:29:12 +0100 Subject: [PATCH] add undo for checkouts --- index.pl | 4 ++++ templates/departures.html.ep | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/index.pl b/index.pl index fe5bcb6..2bce4eb 100755 --- a/index.pl +++ b/index.pl @@ -303,6 +303,10 @@ helper 'undo' => sub { return 'Nested undo (undoing an undo) is not supported'; } + if ( @{$rows} > 1 and $rows->[1][0] == $action_type{undo}) { + return 'Repeated undo is not supported'; + } + my $success = $self->app->undo_query->execute( $self->get_user_id, DateTime->now( time_zone => 'Europe/Berlin' )->epoch, diff --git a/templates/departures.html.ep b/templates/departures.html.ep index bd11d15..be2c7cd 100644 --- a/templates/departures.html.ep +++ b/templates/departures.html.ep @@ -15,6 +15,20 @@ % } + % elsif ($status->{timestamp_delta} < 600) { +
+
+ Ausgecheckt +

Aus <%= $status->{train_type} %> <%= $status->{train_no} %> + bis <%= $status->{station_name} %>

+
+ +
+ % }