From 3feabf250947d12e66a238654df43df81fc0d3b2 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 5 May 2019 01:30:20 +0200 Subject: Move moreinfo to ajax-requested sub-template This decreases the DOM size and allows for future speed improvements (the backend no longer needs to precalculate routes etc for all trains) --- templates/_train_details.html.ep | 165 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 templates/_train_details.html.ep (limited to 'templates/_train_details.html.ep') diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep new file mode 100644 index 0000000..5e904d9 --- /dev/null +++ b/templates/_train_details.html.ep @@ -0,0 +1,165 @@ + +
+
+% if ($departure->{scheduled_platform} or $departure->{platform}) { + Gleis <%= $departure->{scheduled_platform} // $departure->{platform} %> +% } +% if ($departure->{scheduled_platform} and $departure->{platform} +% and $departure->{scheduled_platform} ne $departure->{platform}) { + (heute Gleis <%= $departure->{platform} %>) +% } +% elsif ($departure->{changed_platform}) { + (Gleiswechsel) +% } +
+% if (not $departure->{is_cancelled}) { +
+% if ($departure->{sched_arrival}) { + Ankunft: <%= $departure->{sched_arrival} %> +% if ($departure->{arrival} and $departure->{arrival} ne $departure->{sched_arrival}) { + (heute <%= $departure->{arrival} %>) +% } +
+% } +% if ($departure->{sched_departure}) { + Abfahrt: <%= $departure->{sched_departure} %> +% if ($departure->{departure} and $departure->{departure} ne $departure->{sched_departure}) { + (heute <%= $departure->{departure} %>) +% } +
+% } +% if (not ($departure->{sched_arrival} or $departure->{sched_departure})) { + Abfahrt: <%= $departure->{time} %> +% if ($departure->{delay}) { + (heute +<%= $departure->{delay} %>) +% } +% } +
+% if ($linetype eq 'fern' and $departure->{wr_link}) { + +% } + +% } +% if ($departure->{route_pre_diff} and $departure->{route_post_diff}) { +% if (@{$departure->{route_pre_diff}}) { +
+ Von: +% my $first = 0; +% for my $stop (@{$departure->{route_pre_diff}}) { +% if ($first++) { + +% } + <%= $stop->{name} %> +% } +
+% } +% if (@{$departure->{route_post_diff}}) { +
+ Nach: +% my $first = 0; +% for my $stop (@{$departure->{route_post_diff}}) { +% if ($first++) { + +% } + <%= $stop->{name} %> +% } +
+% } +% } +% if ($departure->{moreinfo} and @{$departure->{moreinfo}}) { + Meldungen: + +% } +
-- cgit v1.2.3