diff options
Diffstat (limited to 'templates/_train_details.html.ep')
-rw-r--r-- | templates/_train_details.html.ep | 146 |
1 files changed, 104 insertions, 42 deletions
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index 24d2d55..f560950 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -27,7 +27,7 @@ % } % elsif ($departure->{arrival}) { % if ($departure->{arrival} ne $departure->{sched_arrival}) { - % if (($departure->{delay} // 0) < 0) { + % if (($departure->{arrival_delay} // 0) < 0) { An: <span class="undelay"><%= $departure->{arrival} %></span> % } % else { @@ -45,6 +45,9 @@ % elsif ($departure->{prep_time}) { Ein: <%= $departure->{prep_time} %> % } +% if ($departure->{tz_offset} and $departure->{local_sched_arr}) { + <br/>Lokal: <%= $departure->{local_sched_arr}->strftime('%H:%M') %> +% } </div> </div> <div> @@ -65,10 +68,10 @@ % else { % my $left = ''; % my $right = ''; -% if ($departure->{direction} and $departure->{direction} eq 'l') { +% if ($departure->{wr_direction} and $departure->{wr_direction} eq 'l') { % $left = '◀ '; % } -% elsif ($departure->{direction} and $departure->{direction} eq 'r') { +% elsif ($departure->{wr_direction} and $departure->{wr_direction} eq 'r') { % $right = ' ▶'; % } % if ($departure->{scheduled_platform} and $departure->{platform} @@ -107,46 +110,49 @@ % elsif ($departure->{sched_departure}) { Ab: <%= $departure->{sched_departure} %> % } +% if ($departure->{tz_offset} and $departure->{local_sched_dep}) { + <br/>Lokal: <%= $departure->{local_sched_dep}->strftime('%H:%M') %> +% } </div> </div> </div> <!-- dataline --> % if (my $wr = $departure->{wr}) { <div class="wagonorder-preview"> -% my @wagons = $wr->wagons; -% my $direction = $wr->direction ? $wr->direction == 100 ? '→' : '←' : q{}; -% if ($departure->{direction}) { -% $direction = $departure->{direction} eq 'l' ? '◀' : '▶'; -% if (($departure->{direction} eq 'l' ? 0 : 100) != $wr->direction) { -% @wagons = reverse @wagons; -% } +% my $left = defined $wr->direction ? $wr->direction == 100 ? q{} : '←' : q{}; +% my $right = defined $wr->direction ? $wr->direction == 100 ? '→' : q{} : q{}; +% if ($departure->{wr_direction} and $departure->{wr_direction} eq 'l') { +% $left = '◀'; +% $right = q{}; % } - <a href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{direction} // '' %>"> - %= $direction -% my $gi; -% for my $wagon (@wagons) { -% if (not ($wagon->is_locomotive or $wagon->is_powercar)) { -% if (defined $gi and $gi != $wagon->group_index) { - • -% } -%= $wagon->number || ($wagon->type =~ m{AB} ? '½' : $wagon->type =~ m{A} ? '1.' : $wagon->type =~ m{B} ? '2.' : '?' ) -% } -% $gi = $wagon->group_index; +% elsif ($departure->{wr_direction} and $departure->{wr_direction} eq 'r') { +% $left = q{}; +% $right = '▶'; % } - %= $direction + <a href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{wr_direction} // '' %>"> + %= $left + % for my $entry ((defined $departure->{wr_direction_num} and $departure->{wr_direction_num} != $wr->direction) ? reverse @{$departure->{wr_preview} // []} : @{$departure->{wr_preview} // []}) { + % if ($entry->[1]) { + <span class="<%= $entry->[1] %>"><%= $entry->[0] %></span> + % } + % else { + %= $entry->[0] + % } + % } + %= $right </a> </div> % } <div class="verbose"> % if ($departure->{trip_id}) { % if (stash('station_name')) { - <a class="smallbutton" href="/map/<%= $departure->{trip_id} =~ s{#}{%23}gr %>/<%= $departure->{train_line} // 0 %>?from=<%= stash('station_name') %>&hafas=<%= param('hafas') // q{} %>"><i class="material-icons" aria-hidden="true">map</i> Karte</a> + <a class="smallbutton" href="/map/<%= $departure->{trip_id} =~ s{#}{%23}gr %>/<%= $departure->{train_line} || 0 %>?from=<%= stash('station_name') %>&hafas=<%= param('hafas') // q{} %>"><i class="material-icons" aria-hidden="true">map</i> Karte</a> % } % else { - <a class="smallbutton" href="/map/<%= $departure->{trip_id} =~ s{#}{%23}gr %>/<%= $departure->{train_line} // 0 %>?hafas=<%= param('hafas') // q{} %>"><i class="material-icons" aria-hidden="true">map</i> Karte</a> + <a class="smallbutton" href="/map/<%= $departure->{trip_id} =~ s{#}{%23}gr %>/<%= $departure->{train_line} || 0 %>?hafas=<%= param('hafas') // q{} %>"><i class="material-icons" aria-hidden="true">map</i> Karte</a> % } % } % if ($departure->{wr_link}) { - <a class="smallbutton" href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{direction} // '' %>"><i class="material-icons" aria-hidden="true">train</i> <%= $departure->{wr_text} || 'Wagen' %> + <a class="smallbutton" href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{wr_direction} // '' %>"><i class="material-icons" aria-hidden="true">train</i> <%= $departure->{wr_text} || 'Wagen' %> </a> % } % if ($departure->{train_type} and $departure->{train_no}) { @@ -232,6 +238,19 @@ % } <ul class="mroute"> % for my $stop (@{$departure->{route_pre_diff}}) { +% if ($stop->{is_annotated} and $stop->{prod_name}) { + <li class="annotation"> +% if ($stop->{prod_name}) { +%= $stop->{prod_name} +% } +% if ($stop->{direction}) { + → <%= $stop->{direction} %> +% } +% if ($stop->{operator}) { + (<%= $stop->{operator} %>) +% } + </li> +% } <li class="<%= $stop->{isPast} ? 'past-stop' : 'future-stop' %>"> <a href="<%= url_for('station', station => $stop->{eva} // $stop->{name})->query({detailed => param('detailed'), past => param('past'), rt => param('rt'), hafas => param('hafas')}) %>#<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>" class=" % if ($stop->{isAdditional}) { @@ -247,13 +266,16 @@ generic-stop % } % if (($stop->{rt_dep} and $stop->{dep_delay}) or (not $stop->{rt_dep} and $stop->{rt_arr} and $stop->{arr_delay})) { - "><%= ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') %> (heute <%= ($stop->{rt_dep} // $stop->{rt_arr})->strftime('%H:%M') %>) + "><span class="time-sched-only"><%= ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') %></span> <span class="time-delayed"><%= ($stop->{rt_dep} // $stop->{rt_arr})->strftime('%H:%M') %></span> +% } +% elsif (($stop->{rt_dep} and defined $stop->{dep_delay}) or (not $stop->{rt_dep} and $stop->{rt_arr} and defined $stop->{arr_delay})) { + "><span class="time-sched-ontime"><%= ($stop->{sched_dep} // $stop->{sched_arr}) ? ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') : q{} %></span> % } % else { - "><%= ($stop->{sched_dep} // $stop->{sched_arr}) ? ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') : q{} %> -% if ($stop->{rt_bogus}) { - <i class="material-icons" aria-label="Echtzeitdaten fehlen">gps_off</i> -% } + "><span class="time-sched"><%= ($stop->{sched_dep} // $stop->{sched_arr}) ? ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') : q{} %></span> +% } +% if ($stop->{tz_offset} and $stop->{local_dt_da}) { + (lokal <%= $stop->{local_dt_da}->strftime('%H:%M') %>) % } <%= $stop->{name} %></a> % if ($stop->{load}{FIRST} or $stop->{load}{SECOND}) { @@ -264,15 +286,39 @@ </li> % } % if (stash('station_name')) { - <li class="<%= $departure->{is_cancelled} ? 'cancelled-stop' : q{} %> <%= $departure->{isPast} ? 'past-stop' : 'future-stop' %>"><%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %> +% if ($departure->{is_annotated} and $departure->{prod_name}) { + <li class="annotation"> +% if ($departure->{prod_name}) { +%= $departure->{prod_name} +% } +% if ($departure->{direction}) { + → <%= $departure->{direction} %> +% } +% if ($departure->{operator}) { + (<%= $departure->{operator} %>) +% } + </li> +% } + <li class="<%= $departure->{is_cancelled} ? 'cancelled-stop' : q{} %> <%= $departure->{isPast} ? 'past-stop' : 'future-stop' %>"> % if ($departure->{departure} and $departure->{sched_departure} and $departure->{departure} ne $departure->{sched_departure}) { - (heute <%= $departure->{departure} %>) + <span class="time-sched-only"><%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %></span><span class="time-delayed"> +% } +% elsif ($departure->{departure} and $departure->{sched_departure} and $departure->{departure} eq $departure->{sched_departure} and not $departure->{no_realtime_yet}) { + <span class="time-sched-ontime"> % } % elsif ($departure->{arrival} and $departure->{sched_arrival} and $departure->{arrival} ne $departure->{sched_arrival}) { - (heute <%= $departure->{arrival} %>) + <span class="time-sched-only"><%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %></span><span class="time-delayed"> +% } +% elsif ($departure->{arrival} and $departure->{sched_arrival} and $departure->{arrival} eq $departure->{sched_arrival} and not $departure->{no_realtime_yet}) { + <span class="time-sched-ontime"> +% } +% else { + <span class="time-sched"> % } -% if ($departure->{missing_realtime} or $departure->{no_realtime_yet}) { - <i class="material-icons" aria-label="Echtzeitdaten fehlen">gps_off</i> +%= $departure->{departure} // $departure->{arrival} // $departure->{sched_departure} // $departure->{sched_arrival} // q{} + </span> +% if ($departure->{tz_offset} and $departure->{local_dt_da}) { + (lokal <%= $departure->{local_dt_da}->strftime('%H:%M') %>) % } <strong><%= stash('station_name') %></strong> % if (my $u = $departure->{utilization}) { @@ -283,6 +329,19 @@ </li> % } % for my $stop (@{$departure->{route_post_diff}}) { +% if ($stop->{is_annotated} and $stop->{prod_name}) { + <li class="annotation"> +% if ($stop->{prod_name}) { +%= $stop->{prod_name} +% } +% if ($stop->{direction}) { + → <%= $stop->{direction} %> +% } +% if ($stop->{operator}) { + (<%= $stop->{operator} %>) +% } + </li> +% } <li class="<%= $stop->{isPast} ? 'past-stop' : 'future-stop' %>"> <a href="<%= url_for('station', station => $stop->{eva} // $stop->{name})->query({detailed => param('detailed'), past => param('past'), rt => param('rt'), hafas => param('hafas')}) %>#<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>" class=" % if ($stop->{isAdditional}) { @@ -298,13 +357,16 @@ generic-stop % } % if (($stop->{rt_arr} and $stop->{arr_delay}) or (not $stop->{rt_arr} and $stop->{rt_dep} and $stop->{dep_delay})) { - "><%= ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') %> (heute <%= ($stop->{rt_arr} // $stop->{rt_dep})->strftime('%H:%M') %>) + "><span class="time-sched-only"><%= ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') %></span> <span class="time-delayed"><%= ($stop->{rt_arr} // $stop->{rt_dep})->strftime('%H:%M') %></span> +% } +% elsif (($stop->{rt_arr} and defined $stop->{arr_delay}) or (not $stop->{rt_arr} and $stop->{rt_dep} and defined $stop->{dep_delay})) { + "><span class="time-sched-ontime"><%= ($stop->{sched_arr} // $stop->{sched_dep}) ? ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') : q{} %></span> % } % else { - "><%= ($stop->{sched_arr} // $stop->{sched_dep}) ? ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') : q{} %> -% if ($stop->{rt_bogus}) { - <i class="material-icons" aria-label="Echtzeitdaten fehlen">gps_off</i> -% } + "><span class="time-sched"><%= ($stop->{sched_arr} // $stop->{sched_dep}) ? ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') : q{} %></span> +% } +% if ($stop->{tz_offset} and $stop->{local_dt_ad}) { + (lokal <%= $stop->{local_dt_ad}->strftime('%H:%M') %>) % } <%= $stop->{name} %></a> % if ($stop->{load}{FIRST} or $stop->{load}{SECOND}) { @@ -316,8 +378,8 @@ % } </ul> <!-- mroute --> % } -% if ($departure->{operator}) { - <div class="details">Betrieb: <%= $departure->{operator} %></div> +% if ($departure->{operators} and @{$departure->{operators} // []}) { + <div class="details">Betrieb: <%= join(q{, }, @{ $departure->{operators} // [] } ) %></div> % } % if ($departure->{details} and @{$departure->{details}}) { <div class="details">Details: |