From 619646b533bc27575131f7a521aac30a1431bfb1 Mon Sep 17 00:00:00 2001 From: Derf Null Date: Thu, 8 Jun 2023 10:20:13 +0200 Subject: warn when trying to check out at invalid unscheduled station Closes #72 --- templates/departures.html.ep | 55 ++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 17 deletions(-) (limited to 'templates') diff --git a/templates/departures.html.ep b/templates/departures.html.ep index 857be74..852f876 100644 --- a/templates/departures.html.ep +++ b/templates/departures.html.ep @@ -6,37 +6,50 @@ % } -% my $status = $self->get_user_status; % my $have_connections = 0; -% if ($status->{checked_in}) { +% if ($user_status->{checked_in}) {
Aktuell eingecheckt -

In <%= $status->{train_type} %> <%= $status->{train_no} %> - ab <%= $status->{dep_name} %>

+

In <%= $user_status->{train_type} %> <%= $user_status->{train_no} %> + ab <%= $user_status->{dep_name} %>

% } -% elsif ($status->{cancellation} and $station eq $status->{cancellation}{dep_name}) { +% elsif ($user_status->{cancellation} and $station eq $user_status->{cancellation}{dep_name}) {
- %= include '_cancelled_departure', journey => $status->{cancellation}; + %= include '_cancelled_departure', journey => $user_status->{cancellation};
% } -% elsif ($status->{timestamp_delta} < 180) { +% elsif ($user_status->{timestamp_delta} < 180) {
- %= include '_checked_out', journey => $status; + %= include '_checked_out', journey => $user_status;
% } @@ -55,7 +68,13 @@ % if ($have_connections) { Alle Abfahrten – % } - % if (@{$results}) { + % if ($user_status->{checked_in} and not $can_check_out) { + Diese Station liegt nicht auf der Route deines aktuellen Checkins. + Falls du aktuell nicht mit <%= $user_status->{train_type} %> <%= $user_status->{train_no} %> unterwegs bist, kannst du den Checkin rückgängig machen. + Falls es sich bei <%= $station %> um einen nicht in den Echtzeitdaten abgebildeten Zusatzhalt handelt, kannst du hier auchecken. + Da travelynx nicht weiß, welcher der beiden Fälle zutrifft, sind bis dahin keine neuen Checkins möglich. + % } + % elsif (@{$results}) { Zug auswählen zum Einchecken. % } % else { @@ -63,11 +82,13 @@ und maximal 120 Minuten nach Abfahrt möglich. % }

- % if ($hafas) { - %= include '_departures_hafas', results => $results; - % } - % else { - %= include '_departures_iris', results => $results; + % if (not ($user_status->{checked_in} and not $can_check_out)) { + % if ($hafas) { + %= include '_departures_hafas', results => $results; + % } + % else { + %= include '_departures_iris', results => $results; + % } % } -- cgit v1.2.3