From 6c1cae86f4fa343b4f165f80a4e42eba37fa917c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 23 Apr 2019 22:27:13 +0200 Subject: Primitive auto-refresh of current journey status Todo: Redirect user to destination station upon arrival --- lib/Travelynx/Controller/Traveling.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/Travelynx/Controller') diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index d8e5e03..73a079c 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -19,6 +19,20 @@ sub homepage { } } +sub status_card { + my ($self) = @_; + my $status = $self->get_user_status; + + delete $self->stash->{layout}; + + if ( $status->{checked_in} ) { + $self->render( '_checked_in', status => $status ); + } + else { + $self->render( '_checked_out', status => $status ); + } +} + sub geolocation { my ($self) = @_; -- cgit v1.2.3