summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-07-23 12:50:46 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-07-23 12:51:07 +0200
commitc0754f9e871e68019cd6109e8fc2649b515b9fc1 (patch)
tree8056a5087e25ba3000ae6cf55789b36f664d3bf4 /templates
parent13277ad770b6710a9a5536334011d04fcf390919 (diff)
departure board: do not allow new checkins prior to arrival of current checkin
This check is already present in the backend; now the frontend knows about it too.
Diffstat (limited to 'templates')
-rw-r--r--templates/departures.html.ep21
1 files changed, 18 insertions, 3 deletions
diff --git a/templates/departures.html.ep b/templates/departures.html.ep
index 0d10338..666d620 100644
--- a/templates/departures.html.ep
+++ b/templates/departures.html.ep
@@ -14,7 +14,13 @@
<div class="card-content">
<span class="card-title">Aktuell eingecheckt</span>
<p>In <%= $user_status->{train_type} %> <%= $user_status->{train_no} %>
- ab <%= $user_status->{dep_name} %></p>
+ % if ( $user_status->{arr_name}) {
+ von <%= $user_status->{dep_name} %> nach <%= $user_status->{arr_name} %>
+ % }
+ % else {
+ ab <%= $user_status->{dep_name} %>
+ % }
+ </p>
</div>
<div class="card-action">
% if ($can_check_out) {
@@ -69,11 +75,20 @@
Alle Abfahrten –
% }
% if ($user_status->{checked_in} and not $can_check_out) {
- Diese Station liegt nicht auf der Route deines aktuellen Checkins.
+ Diese Station liegt nicht auf der Route deines <a href="/">aktuellen Checkins</a>.
Falls du aktuell nicht mit <b><%= $user_status->{train_type} %> <%= $user_status->{train_no} %></b> unterwegs bist, kannst du den Checkin rückgängig machen.
Falls es sich bei <b><%= $station %></b> 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 ($user_status->{checked_in} and not $user_status->{arr_eva}) {
+ Du bist bereits eingecheckt und hast noch kein Fahrtziel angegeben.
+ Bitte <a href="/">wähle zunächst ein Ziel</a>.
+ Neue Checkins sind erst nach Ankunft der aktuellen Fahrt möglich.
+ % }
+ % elsif ($user_status->{checked_in} and $user_status->{arrival_countdown} > 0) {
+ Deine aktuelle Fahrt ist <a href="/">noch unterwegs</a>.
+ Ein neuer Checkin ist erst nach Ankunft am ausgewählten Ziel möglich.
+ % }
% elsif (@{$results}) {
Zug auswählen zum Einchecken.
% }
@@ -82,7 +97,7 @@
und maximal 120 Minuten nach Abfahrt möglich.
% }
</p>
- % if (not ($user_status->{checked_in} and not $can_check_out)) {
+ % if (not $user_status->{checked_in} or ($can_check_out and $user_status->{arr_eva} and $user_status->{arrival_countdown} <= 0)) {
% if ($hafas) {
%= include '_departures_hafas', results => $results;
% }