From ffee7177ac26f4e79227cdf0abcd83f80f34faa4 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 7 Apr 2019 18:44:33 +0200 Subject: Refactor history template, add yearly stats --- templates/_history_trains.html.ep | 51 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 templates/_history_trains.html.ep (limited to 'templates/_history_trains.html.ep') diff --git a/templates/_history_trains.html.ep b/templates/_history_trains.html.ep new file mode 100644 index 0000000..2044f7b --- /dev/null +++ b/templates/_history_trains.html.ep @@ -0,0 +1,51 @@ +
+
+ + + + + + + + + + + % for my $travel (@{$journeys}) { + % if ($travel->{completed}) { + % my $detail_link = '/journey/' . current_user()->{id} . '-' . $travel->{ids}->[1]; + + + + + + + % } + % } + +
DatumZeitZugStrecke
<%= $travel->{sched_departure}->strftime('%d.%m.%Y') %> + % if (param('cancelled') and $travel->{sched_arrival}->epoch != 0) { + %= $travel->{sched_arrival}->strftime('%H:%M') + % } + % else { + % if ($travel->{rt_arrival}->epoch == 0 and $travel->{sched_arrival}->epoch == 0) { + timer_off + % } else { + %= $travel->{rt_arrival}->strftime('%H:%M'); + % if ($travel->{sched_arrival} != $travel->{rt_arrival}) { + (<%= sprintf('%+d', ($travel->{rt_arrival}->epoch - $travel->{sched_arrival}->epoch) / 60) %>) + % } + % } + % } +
+ % if (param('cancelled')) { + %= $travel->{sched_departure}->strftime('%H:%M') + % } + % else { + <%= $travel->{rt_departure}->strftime('%H:%M') %> + % if ($travel->{sched_departure} != $travel->{rt_departure}) { + (<%= sprintf('%+d', ($travel->{rt_departure}->epoch - $travel->{sched_departure}->epoch) / 60) %>) + % } + % } +
<%= $travel->{type} %> <%= $travel->{line} // '' %> <%= $travel->{no} %><%= $travel->{from_name} %> → <%= $travel->{to_name} %>
+
+
-- cgit v1.2.3