From 3aeaacdf28285b8d8294370a1eb6c3ab21f7dc56 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 6 Apr 2019 21:51:16 +0200 Subject: wagenreihung: Check for backend error --- templates/wagenreihung.html.ep | 194 ++++++++++++++++++++++------------------- 1 file changed, 102 insertions(+), 92 deletions(-) (limited to 'templates/wagenreihung.html.ep') diff --git a/templates/wagenreihung.html.ep b/templates/wagenreihung.html.ep index 393adbf..8d0cb23 100644 --- a/templates/wagenreihung.html.ep +++ b/templates/wagenreihung.html.ep @@ -1,106 +1,116 @@ -
-
-%= join(' / ', map { $wr->train_type . ' ' . $_ } $wr->train_numbers ) -
-
-%= join( ' / ', $wr->origins ) - → -%= join( ' / ', $wr->destinations ) -
- <%= $wr->station_name %> Gleis <%= $wr->platform %>
- Zugtyp: <%= $wr->train_subtype // 'IC?' %> -
- -% if ($wr->train_type ne 'ICE') { +% if ($wr->errstr) {
-
- ⚠ Keine zuverlässigen Daten vorhanden. - IC/EC-Wagenreihungen werden vom Backend noch nicht offiziell unterstützt. - Sowohl die hier angegebenen Daten als auch die am Bahnsteig angezeigte - Wagenreihung können fehlerhaft sein. +
+ Fehler bei der Abfrage der Wagenreihung: + <%= $wr->errstr %>
% } -
-
-% for my $section ($wr->sections) { -
-%= $section->{name} +% else { +
+
+%= join(' / ', map { $wr->train_type . ' ' . $_ } $wr->train_numbers ) +
+
+%= join( ' / ', $wr->origins ) + → +%= join( ' / ', $wr->destinations ) +
+ <%= $wr->station_name %> Gleis <%= $wr->platform %>
+ Zugtyp: <%= $wr->train_subtype // 'IC?' %> +
+
+% if ($wr->train_type ne 'ICE') { +
+
+ ⚠ Keine zuverlässigen Daten vorhanden. + IC/EC-Wagenreihungen werden vom Backend noch nicht offiziell unterstützt. + Sowohl die hier angegebenen Daten als auch die am Bahnsteig angezeigte + Wagenreihung können fehlerhaft sein.
+
% } -% for my $wagon ($wr->wagons) { -% my $bg = ''; -% if ($wagon->is_first_class) { -% $bg = 'background-color: #ffff99;'; -% } -% if ($wagon->is_locomotive or $wagon->is_powercar) { -% $bg = 'background-color: #cccccc;'; +
+
+% for my $section ($wr->sections) { +
+%= $section->{name} +
% } -
-% if ($wr->direction == 100) { - ↓ -% } -% else { - ↑ -% } -
-
-% if ($wagon->is_locomotive or $wagon->is_powercar) { - LOK -% } -% else { -%= $wagon->number // '?' -% } -
-
+% for my $wagon ($wr->wagons) { +% my $bg = ''; % if ($wagon->is_first_class) { - 1 -% } -% if ($wagon->is_second_class) { - 2 +% $bg = 'background-color: #ffff99;'; % } -% if ($wagon->has_accessibility) { - ♿ -% } -% if ($wagon->has_bistro) { - 🍴 -% } -% if ($wagon->has_compartments) { - 🚪 -% } -% if ($wagon->has_quiet_area) { - 🔇 -% } -% if ($wagon->has_phone_area) { - 📱 -% } -% if ($wagon->has_family_area) { - 👪 -% } -% if ($wagon->has_bahn_comfort) { - bahn.comfort -% } -% if ($wagon->is_interregio) { - Interregio +% if ($wagon->is_locomotive or $wagon->is_powercar) { +% $bg = 'background-color: #cccccc;'; % } - -%= $wagon->type - +
+% if ($wr->direction == 100) { + ↓ +% } +% else { + ↑ +% } +
+
+% if ($wagon->is_locomotive or $wagon->is_powercar) { + LOK +% } +% else { +%= $wagon->number // '?' +% } +
+
+% if ($wagon->is_first_class) { + 1 +% } +% if ($wagon->is_second_class) { + 2 +% } +% if ($wagon->has_accessibility) { + ♿ +% } +% if ($wagon->has_bistro) { + 🍴 +% } +% if ($wagon->has_compartments) { + 🚪 +% } +% if ($wagon->has_quiet_area) { + 🔇 +% } +% if ($wagon->has_phone_area) { + 📱 +% } +% if ($wagon->has_family_area) { + 👪 +% } +% if ($wagon->has_bahn_comfort) { + bahn.comfort +% } +% if ($wagon->is_interregio) { + Interregio +% } + +%= $wagon->type + +
+% }
-% } -
-
- Angaben ohne Gewähr – Echtzeitdaten sind möglicherweise nicht berücksichtigt. -
+
+ Angaben ohne Gewähr – Echtzeitdaten sind möglicherweise nicht berücksichtigt. +
-
+
+% } -- cgit v1.2.3