diff --git a/index.pl b/index.pl index 24cdc91b7f7228fb7c47bd47a1e21ced18818dff..bb3fee8d9187182b7e10864c2b35852896713301 100755 --- a/index.pl +++ b/index.pl @@ -647,6 +647,12 @@ post '/action' => sub { } }; +get '/a/history' => sub { + my ($self) = @_; + + $self->render('history'); +}; + get '/x/about' => sub { my ($self) = @_; diff --git a/templates/history.html.ep b/templates/history.html.ep new file mode 100644 index 0000000000000000000000000000000000000000..3c798a483d7794ecf4020f2e711cf940f70512c2 --- /dev/null +++ b/templates/history.html.ep @@ -0,0 +1,30 @@ +

Bisherige Fahrten

+
+ + + + + + + + + + + % for my $travel (get_user_travels(0)) { + % if ($travel->{completed}) { + + + + + % if ($travel->{rt_arrival} and $travel->{rt_departure}) { + + % } + % else { + + % } + + % } + % } + + + diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index 2e07ffeb7d03530ccba00cf426f9115d137fec42..19be1771ed8ce7b6b1a960980a285301e29f6a53 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -21,6 +21,7 @@
DatumZugStreckeDauer
<%= $travel->{sched_departure}->strftime('%d.%m.%Y') %><%= $travel->{type} %> <%= $travel->{line} // $travel->{no} %><%= $travel->{from_name} %> → <%= $travel->{to_name} %><%= ($travel->{rt_arrival}->epoch - $travel->{rt_departure}->epoch) / 60 %> min?