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/app.html.ep | 190 ++++++-------------------------------------------- 1 file changed, 20 insertions(+), 170 deletions(-) (limited to 'templates/app.html.ep') diff --git a/templates/app.html.ep b/templates/app.html.ep index e65ada5..e29caef 100644 --- a/templates/app.html.ep +++ b/templates/app.html.ep @@ -6,6 +6,20 @@ % else {
% } +
+ +
+
% } -
- -
-
-% 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: -
    -% for my $pair (@{$departure->{moreinfo}}) { -
  • -% if ($pair->[0]->isa('DateTime')) { -% if ($pair->[0]->day != $dt_now->day) { -% $pair->[0]->set_locale('de_DE'); -%= $pair->[0]->strftime('%a %H:%M') -% } -% else { -%= $pair->[0]->strftime('%H:%M') -% } -% } -% else { -%= $pair->[0] -% } - : - -%= $pair->[1] - -
  • -% } -% if ($departure->{route_info}) { -
  • <%= $departure->{route_info} %>
  • -% } -
-% } -
-
% if ($departure->{info} and length $departure->{info}) { %= $departure->{info} -- cgit v1.2.3