From 1aa5e786edb0134fe39b31ee7834d925f8e94896 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 27 Mar 2019 21:20:59 +0100 Subject: add history per month --- templates/history.html.ep | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/history.html.ep b/templates/history.html.ep index af24eed..0bed9ab 100644 --- a/templates/history.html.ep +++ b/templates/history.html.ep @@ -1,4 +1,32 @@ -% if (param('cancelled')) { +% if (my $stats = stash('statistics')) { +

<%= stash('month') %> <%= stash('year') %>

+
+
+ + + + + + + + + + + + + + + + +
Fahrten<%= $stats->{num_trains} %>
Entfernungca. <%= sprintf('%.f', $stats->{km_route}) %> km + (Luftlinie: <%= sprintf('%.f', $stats->{km_beeline}) %> km)
Fahrtzeit<%= sprintf('%02d:%02d', $stats->{min_travel_real} / 60, $stats->{min_travel_real} % 60) %> Stunden + (nach Fahrplan: <%= sprintf('%02d:%02d', $stats->{min_travel_sched} / 60, $stats->{min_travel_sched} % 60) %>) +
Kumulierte VerspätungBei Abfahrt: <%= sprintf('%02d:%02d', $stats->{delay_dep} / 60, $stats->{delay_dep} % 60) %> Stunden
+ Bei Ankunft: <%= sprintf('%02d:%02d', $stats->{delay_arr} / 60, $stats->{delay_arr} % 60) %> Stunden
+
+
+% } +% elsif (param('cancelled')) {

Ausgefallene Fahrten

@@ -10,7 +38,7 @@
% } % else { -

Bisherige Fahrten

+

Fahrten

    @@ -33,7 +61,7 @@ - % for my $travel (get_user_travels(cancelled => (param('cancelled') ? 1 : 0))) { + % for my $travel (@{$journeys}) { % if ($travel->{completed}) { % my $detail_link = '/journey/' . current_user()->{id} . '-' . $travel->{checkin}->epoch . '-' . $travel->{checkout}->epoch; -- cgit v1.2.3