From 74f2132c2e5b2637363e3885d71a1d917dbfa746 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 23 Aug 2019 22:54:59 +0200 Subject: declutter Checked In-panel --- templates/_checked_in.html.ep | 442 ++++++++++++++++++++++-------------------- 1 file changed, 230 insertions(+), 212 deletions(-) diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep index 3070ed9..af9e71a 100644 --- a/templates/_checked_in.html.ep +++ b/templates/_checked_in.html.ep @@ -1,246 +1,264 @@ -
-
- - Eingecheckt in <%= $journey->{train_type} %> <%= $journey->{train_no} %> -

-

- % if ($journey->{boarding_countdown} > 120) { - Einfahrt in <%= sprintf('%.f', $journey->{boarding_countdown} / 60) %> Minuten
- % } - % elsif ($journey->{boarding_countdown} > 60) { - Einfahrt in einer Minute
- % } - % elsif ($journey->{boarding_countdown} > 0) { - Zug fährt ein
- % } - % if ($journey->{departure_countdown} > 120) { - Abfahrt in <%= sprintf('%.f', $journey->{departure_countdown} / 60) %> Minuten - % } - % elsif ($journey->{departure_countdown} > 60) { - Abfahrt in einer Minute - % } - % elsif ($journey->{departure_countdown} > 0) { - Abfahrt in weniger als einer Minute - % } - % elsif (defined $journey->{arrival_countdown}) { - % if ($journey->{arrival_countdown} > 60) { - Ankunft in <%= sprintf('%.f', $journey->{arrival_countdown} / 60) %> - Minute<%= sprintf('%.f', $journey->{arrival_countdown} / 60) == 1 ? '' : 'n' %> +
+
+
+ + Eingecheckt in <%= $journey->{train_type} %> <%= $journey->{train_no} %> +

+

+ % if ($journey->{boarding_countdown} > 120) { + Einfahrt in <%= sprintf('%.f', $journey->{boarding_countdown} / 60) %> Minuten
+ % } + % elsif ($journey->{boarding_countdown} > 60) { + Einfahrt in einer Minute
+ % } + % elsif ($journey->{boarding_countdown} > 0) { + Zug fährt ein
% } - % elsif ($journey->{arrival_countdown} > 0) { - Ankunft in weniger als einer Minute + % if ($journey->{departure_countdown} > 120) { + Abfahrt in <%= sprintf('%.f', $journey->{departure_countdown} / 60) %> Minuten % } - % else { - Ziel erreicht + % elsif ($journey->{departure_countdown} > 60) { + Abfahrt in einer Minute % } - % if ($journey->{arrival_countdown} < (60 * 15) and $journey->{arr_platform}) { - % if ($journey->{arr_direction} and $journey->{arr_direction} eq 'r') { -
Gleis <%= $journey->{arr_platform} %> ▶ + % elsif ($journey->{departure_countdown} > 0) { + Abfahrt in weniger als einer Minute + % } + % elsif (defined $journey->{arrival_countdown}) { + % if ($journey->{arrival_countdown} > 60) { + Ankunft in <%= sprintf('%.f', $journey->{arrival_countdown} / 60) %> + Minute<%= sprintf('%.f', $journey->{arrival_countdown} / 60) == 1 ? '' : 'n' %> % } - % elsif ($journey->{arr_direction} and $journey->{arr_direction} eq 'l') { -
◀ Gleis <%= $journey->{arr_platform} %> + % elsif ($journey->{arrival_countdown} > 0) { + Ankunft in weniger als einer Minute % } % else { -
auf Gleis <%= $journey->{arr_platform} %> + Ziel erreicht + % } + % if ($journey->{arrival_countdown} < (60 * 15) and $journey->{arr_platform}) { + % if ($journey->{arr_direction} and $journey->{arr_direction} eq 'r') { +
Gleis <%= $journey->{arr_platform} %> ▶ + % } + % elsif ($journey->{arr_direction} and $journey->{arr_direction} eq 'l') { +
◀ Gleis <%= $journey->{arr_platform} %> + % } + % else { +
auf Gleis <%= $journey->{arr_platform} %> + % } % } % } - % } - % elsif ($journey->{arr_name}) { - Ankunft in mehr als zwei Stunden - % } - % if ($journey->{departure_countdown} > 0 and $journey->{dep_platform}) { - % if ($journey->{dep_direction} and $journey->{dep_direction} eq 'r') { -
Gleis <%= $journey->{dep_platform} %> ▶ - % } - % elsif ($journey->{dep_direction} and $journey->{dep_direction} eq 'l') { -
◀ Gleis <%= $journey->{dep_platform} %> - % } - % else { -
von Gleis <%= $journey->{dep_platform} %> + % elsif ($journey->{arr_name}) { + Ankunft in mehr als zwei Stunden % } - % } - % if (my $wr = $journey->{wagonorder}) { -
- % my @wagons = $wr->wagons; - % my $direction = $wr->direction == 100 ? '→' : '←'; - % if ($journey->{dep_direction}) { - % $direction = $journey->{dep_direction} eq 'l' ? '◀' : '▶'; - % if (($journey->{dep_direction} eq 'l' ? 0 : 100) != $wr->direction) { - % @wagons = reverse @wagons; + % if ($journey->{departure_countdown} > 0 and $journey->{dep_platform}) { + % if ($journey->{dep_direction} and $journey->{dep_direction} eq 'r') { +
Gleis <%= $journey->{dep_platform} %> ▶ % } - % } - - %= $direction - % for my $wagon (@wagons) { - % if (not ($wagon->is_locomotive or $wagon->is_powercar)) { - %= $wagon->number || $wagon->type + % elsif ($journey->{dep_direction} and $journey->{dep_direction} eq 'l') { +
◀ Gleis <%= $journey->{dep_platform} %> % } - % } - %= $direction -
- % } -
-
-
-
-

- % if ($journey->{arr_name}) { -

-

- <%= $journey->{dep_name} %>
- <%= $journey->{real_departure}->strftime('%H:%M') %> - % if ($journey->{real_departure}->epoch != $journey->{sched_departure}->epoch) { - (<%= sprintf('%+d', ($journey->{real_departure}->epoch - $journey->{sched_departure}->epoch)/60) %>) - % } -
-
- <%= $journey->{arr_name} %>
- % if ($journey->{real_arrival}->epoch) { - <%= $journey->{real_arrival}->strftime('%H:%M') %> - % if ($journey->{real_arrival}->epoch != $journey->{sched_arrival}->epoch) { - (<%= sprintf('%+d', ($journey->{real_arrival}->epoch - $journey->{sched_arrival}->epoch)/60) %>) + % else { +
von Gleis <%= $journey->{dep_platform} %> % } % } - % else { - noch nicht bekannt - % } -
-
- % for my $station (@{$journey->{route_after}}) { - % if ($station->[0] eq $journey->{arr_name}) { - % last; - % } - % if (($station->[1]{rt_arr_countdown} // 0) > 0) { - <%= $station->[0] %>
<%= $station->[1]{rt_arr}->strftime('%H:%M') %> - % if ($station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { - %= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60); + % if (my $wr = $journey->{wagonorder}) { +
+ % my @wagons = $wr->wagons; + % my $direction = $wr->direction == 100 ? '→' : '←'; + % if ($journey->{dep_direction}) { + % $direction = $journey->{dep_direction} eq 'l' ? '◀' : '▶'; + % if (($journey->{dep_direction} eq 'l' ? 0 : 100) != $wr->direction) { + % @wagons = reverse @wagons; % } - % last; % } - % if (($station->[1]{rt_dep_countdown} // 0) > 0) { - <%= $station->[0] %>
- <%= $station->[1]{rt_arr}->strftime('%H:%M') %> → - <%= $station->[1]{rt_dep}->strftime('%H:%M') %> - % if ($station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { - %= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60); + + %= $direction + % for my $wagon (@wagons) { + % if (not ($wagon->is_locomotive or $wagon->is_powercar)) { + %= $wagon->number || $wagon->type % } - % last; % } + %= $direction + % }
-
+
+
-
- % for my $station (@{$journey->{route_after}}) { - % if ($station->[0] eq $journey->{arr_name}) { - % last; +

+ % if ($journey->{arr_name}) { +

+

+ <%= $journey->{dep_name} %>
+ <%= $journey->{real_departure}->strftime('%H:%M') %> + % if ($journey->{real_departure}->epoch != $journey->{sched_departure}->epoch) { + (<%= sprintf('%+d', ($journey->{real_departure}->epoch - $journey->{sched_departure}->epoch)/60) %>) + % } +
+
+ <%= $journey->{arr_name} %>
+ % if ($journey->{real_arrival}->epoch) { + <%= $journey->{real_arrival}->strftime('%H:%M') %> + % if ($journey->{real_arrival}->epoch != $journey->{sched_arrival}->epoch) { + (<%= sprintf('%+d', ($journey->{real_arrival}->epoch - $journey->{sched_arrival}->epoch)/60) %>) + % } + % } + % else { + noch nicht bekannt % } - % if (($station->[1]{rt_arr_countdown} // 0) > 0) { - Nächster Halt:
- <%= $station->[0] %>
<%= $station->[1]{rt_arr}->strftime('%H:%M') %> - % if ($station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { - %= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60); +
+
+ % for my $station (@{$journey->{route_after}}) { + % if ($station->[0] eq $journey->{arr_name}) { + % last; + % } + % if (($station->[1]{rt_arr_countdown} // 0) > 0) { + <%= $station->[0] %>
<%= $station->[1]{rt_arr}->strftime('%H:%M') %> + % if ($station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { + %= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60); + % } + % last; + % } + % if (($station->[1]{rt_dep_countdown} // 0) > 0) { + <%= $station->[0] %>
+ <%= $station->[1]{rt_arr}->strftime('%H:%M') %> → + <%= $station->[1]{rt_dep}->strftime('%H:%M') %> + % if ($station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { + %= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60); + % } + % last; % } - % last; % } - % if (($station->[1]{rt_dep_countdown} // 0) > 0) { - Aktueller Halt:
- <%= $station->[0] %>
- <%= $station->[1]{rt_arr}->strftime('%H:%M') %> → - <%= $station->[1]{rt_dep}->strftime('%H:%M') %> - % if ($station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { - %= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60); +
+
+
+
+ % for my $station (@{$journey->{route_after}}) { + % if ($station->[0] eq $journey->{arr_name}) { + % last; + % } + % if (($station->[1]{rt_arr_countdown} // 0) > 0) { + Nächster Halt:
+ <%= $station->[0] %>
<%= $station->[1]{rt_arr}->strftime('%H:%M') %> + % if ($station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { + %= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60); + % } + % last; + % } + % if (($station->[1]{rt_dep_countdown} // 0) > 0) { + Aktueller Halt:
+ <%= $station->[0] %>
+ <%= $station->[1]{rt_arr}->strftime('%H:%M') %> → + <%= $station->[1]{rt_dep}->strftime('%H:%M') %> + % if ($station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { + %= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60); + % } + % last; % } - % last; % } - % } -
-

- % } - % if (@{$journey->{messages} // []} or @{$journey->{extra_data}{him_msg} // []} or @{$journey->{extra_data}{qos_msg} // []}) { -

-

    - % for my $message (reverse @{$journey->{messages} // []}) { - % if ($journey->{sched_departure}->epoch - $message->[0]->epoch < 1800) { -
  • warning <%= $message->[0]->strftime('%H:%M') %>: <%= $message->[1] %>
  • +
+

+ % } + % if (@{$journey->{messages} // []} or @{$journey->{extra_data}{him_msg} // []} or @{$journey->{extra_data}{qos_msg} // []}) { +

+

    + % for my $message (reverse @{$journey->{messages} // []}) { + % if ($journey->{sched_departure}->epoch - $message->[0]->epoch < 1800) { +
  • warning <%= $message->[0]->strftime('%H:%M') %>: <%= $message->[1] %>
  • + % } % } - % } - % if ($journey->{departure_countdown} > 0) { - % for my $message (@{$journey->{extra_data}{qos_msg} // []}) { -
  • info <%= $message->[0]->strftime('%H:%M') %>: <%= $message->[1] %>
  • + % if ($journey->{departure_countdown} > 0) { + % for my $message (@{$journey->{extra_data}{qos_msg} // []}) { +
  • info <%= $message->[0]->strftime('%H:%M') %>: <%= $message->[1] %>
  • + % } % } - % } - % for my $message (@{$journey->{extra_data}{him_msg} // []}) { -
  • info <%= $message->{header} %> <%= $message->{lead} %>
  • - % } -
-

- % } - % if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} < (20*60)) { - % if (my @connections = get_connecting_trains()) { - Verbindungen - % if ($journey->{arrival_countdown} < 0) { -

Zug auswählen zum Einchecken mit Zielwahl.

- % } - %= include '_connections', connections => \@connections, checkin_from => $journey->{arrival_countdown} < 0 ? $journey->{arr_ds100} : undef; + % for my $message (@{$journey->{extra_data}{him_msg} // []}) { +
  • info <%= $message->{header} %> <%= $message->{lead} %>
  • + % } + +

    % } - % } - % if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} <= 0) { -

    - Der automatische Checkout erfolgt wegen gelegentlich veralteter - IRIS-Daten erst etwa zehn Minuten nach der Ankunft. Jetzt auschecken. -

    - % } - % elsif ($journey->{arr_name}) { -

    Ziel ändern?

    - % } - % else { -

    Ziel wählen:

    - % } - - - % my $is_after = 0; - % for my $station (@{$journey->{route_after}}) { - % if ($journey->{arr_name} and $station->[0] eq $journey->{arr_name}) { - - % } - % else { - + % if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} < (20*60)) { + % if (my @connections = get_connecting_trains()) { + Verbindungen + % if ($journey->{arrival_countdown} < 0) { +

    Zug auswählen zum Einchecken mit Zielwahl.

    % } + %= include '_connections', connections => \@connections, checkin_from => $journey->{arrival_countdown} < 0 ? $journey->{arr_ds100} : undef; % } - -
    <%= $station->[0] %>
    <%= $station->[0] %>
    - % if ($journey->{arr_name}) { -

    - Falls das Backend ausgefallen ist oder der Zug aus anderen - Gründen verloren ging: Ohne Echtzeitdaten in <%= $journey->{arr_name} %> - auschecken. -

    - % } -
    -
    - - undo Rückgängig - - % if ($journey->{arr_name}) { - % my $attrib = 'im'; - % if ($journey->{train_type} =~ m{ ^ (?: S | RB ) $ }x) { - % $attrib = 'in der'; % } - {is_public} & 0x02) { - data-url="<%= url_for('/status')->to_abs->scheme('https') %>/<%= current_user->{name} %>/<%= $journey->{sched_departure}->epoch %>" - % } - > - share Teilen + % if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} <= 0) { +

    + Der automatische Checkout erfolgt wegen gelegentlich veralteter + IRIS-Daten erst etwa zehn Minuten nach der Ankunft. Jetzt auschecken. +

    + % } + % elsif (not $journey->{arr_name}) { +

    Ziel wählen:

    + + + % my $is_after = 0; + % for my $station (@{$journey->{route_after}}) { + % if ($journey->{arr_name} and $station->[0] eq $journey->{arr_name}) { + + % } + % else { + + % } + % } + +
    <%= $station->[0] %>
    <%= $station->[0] %>
    + % } +
    +
    + + undo Rückgängig - % } + % if ($journey->{arr_name}) { + % my $attrib = 'im'; + % if ($journey->{train_type} =~ m{ ^ (?: S | RB ) $ }x) { + % $attrib = 'in der'; + % } + {is_public} & 0x02) { + data-url="<%= url_for('/status')->to_abs->scheme('https') %>/<%= current_user->{name} %>/<%= $journey->{sched_departure}->epoch %>" + % } + > + share Teilen + + % } +
    + % if ($journey->{arr_name}) { +
    +
    + + Ziel ändern? + + + % my $is_after = 0; + % for my $station (@{$journey->{route_after}}) { + % if ($journey->{arr_name} and $station->[0] eq $journey->{arr_name}) { + + % } + % else { + + % } + % } + +
    <%= $station->[0] %>
    <%= $station->[0] %>
    +

    + Falls das Backend ausgefallen ist oder der Zug aus anderen + Gründen verloren ging: Ohne Echtzeitdaten in <%= $journey->{arr_name} %> + auschecken. +

    +
    +
    + % }
    -- cgit v1.2.3