diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index 112fa80..8c15782 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -26,10 +26,10 @@ sub status_card { delete $self->stash->{layout}; if ( $status->{checked_in} ) { - $self->render( '_checked_in', status => $status ); + $self->render( '_checked_in', journey => $status ); } else { - $self->render( '_checked_out', status => $status ); + $self->render( '_checked_out', journey => $status ); } } diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep index 34b8c86..916b56f 100644 --- a/templates/_checked_in.html.ep +++ b/templates/_checked_in.html.ep @@ -2,24 +2,24 @@
Eingecheckt

- In <%= $status->{train_type} %> <%= $status->{train_no} %> - % if ($status->{arr_name}) { - von <%= $status->{dep_name} %> nach <%= $status->{arr_name} %>. + In <%= $journey->{train_type} %> <%= $journey->{train_no} %> + % if ($journey->{arr_name}) { + von <%= $journey->{dep_name} %> nach <%= $journey->{arr_name} %>. % } % else { - ab <%= $status->{dep_name} %>. + ab <%= $journey->{dep_name} %>. % }

- <%= $status->{real_departure}->strftime('%H:%M') %> - % if ($status->{real_departure}->epoch != $status->{sched_departure}->epoch) { - (<%= sprintf('%+d', ($status->{real_departure}->epoch - $status->{sched_departure}->epoch)/60) %>) + <%= $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) %>) % } → - % if ($status->{real_arrival}->epoch) { - <%= $status->{real_arrival}->strftime('%H:%M') %> - % if ($status->{real_arrival}->epoch != $status->{sched_arrival}->epoch) { - (<%= sprintf('%+d', ($status->{real_arrival}->epoch - $status->{sched_arrival}->epoch)/60) %>) + % 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 { @@ -28,37 +28,37 @@

- % if ($status->{departure_countdown} > 120) { - Abfahrt in <%= sprintf('%.f', $status->{departure_countdown} / 60) %> Minuten + % if ($journey->{departure_countdown} > 120) { + Abfahrt in <%= sprintf('%.f', $journey->{departure_countdown} / 60) %> Minuten % } - % elsif (defined $status->{arrival_countdown}) { - % if ($status->{arrival_countdown} > 60) { - Ankunft in <%= sprintf('%.f', $status->{arrival_countdown} / 60) %> - Minute<%= sprintf('%.f', $status->{arrival_countdown} / 60) == 1 ? '' : 'n' %> + % 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 ($status->{arrival_countdown} > 0) { + % elsif ($journey->{arrival_countdown} > 0) { Ankunft in weniger als einer Minute % } % else { Ziel erreicht % } % } - % elsif ($status->{arr_name}) { + % elsif ($journey->{arr_name}) { Ankunft in mehr als zwei Stunden % }
-
+

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

Der automatische Checkout erfolgt in wenigen Minuten. Zum Umsteigen: Aktuelle Station in der Liste auswählen. Zum Weiterfahren: Neues Ziel wählen.

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

Ziel ändern?

% } % else { @@ -67,8 +67,8 @@ % my $is_after = 0; - % for my $station (@{$status->{route_after}}) { - % if ($status->{arr_name} and $station eq $status->{arr_name}) { + % for my $station (@{$journey->{route_after}}) { + % if ($journey->{arr_name} and $station eq $journey->{arr_name}) { % } % else { @@ -77,12 +77,12 @@ % }
<%= $station %>
- % if ($status->{arr_name}) { + % if ($journey->{arr_name}) {

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

% } diff --git a/templates/_checked_out.html.ep b/templates/_checked_out.html.ep index 737cc9d..1b6113a 100644 --- a/templates/_checked_out.html.ep +++ b/templates/_checked_out.html.ep @@ -1,11 +1,11 @@
Ausgecheckt -

Aus <%= $status->{train_type} %> <%= $status->{train_no} %> - bis <%= $status->{arr_name} %>

+

Aus <%= $journey->{train_type} %> <%= $journey->{train_no} %> + bis <%= $journey->{arr_name} %>

diff --git a/templates/departures.html.ep b/templates/departures.html.ep index 32a4336..fb917f3 100644 --- a/templates/departures.html.ep +++ b/templates/departures.html.ep @@ -16,7 +16,7 @@
% } % elsif ($status->{timestamp_delta} < 180) { - %= include '_checked_out', status => $status; + %= include '_checked_out', journey => $status; % }
diff --git a/templates/landingpage.html.ep b/templates/landingpage.html.ep index 83b8303..e694229 100644 --- a/templates/landingpage.html.ep +++ b/templates/landingpage.html.ep @@ -15,7 +15,7 @@
% my $status = get_user_status(); % if ($status->{checked_in}) { - %= include '_checked_in', status => $status; + %= include '_checked_in', journey => $status; % } % elsif ($status->{cancelled}) {