summaryrefslogtreecommitdiff
path: root/templates/infoscreen.html.ep
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-01-15 17:52:48 +0100
committerDaniel Friesel <derf@finalrewind.org>2015-01-15 17:52:48 +0100
commitc7aa0f86a873a3f86d5eab1be4a0d40d49181b00 (patch)
treeaae7a63ad55722cec8733f771ceb094da243b698 /templates/infoscreen.html.ep
parent334cdd809e665db47dde838765c2669f9a52d3cf (diff)
initial ASEAG support (more to follow)
Diffstat (limited to 'templates/infoscreen.html.ep')
-rw-r--r--templates/infoscreen.html.ep18
1 files changed, 10 insertions, 8 deletions
diff --git a/templates/infoscreen.html.ep b/templates/infoscreen.html.ep
index 47c435c..6d4ff72 100644
--- a/templates/infoscreen.html.ep
+++ b/templates/infoscreen.html.ep
@@ -25,18 +25,20 @@
<ul>
% for my $departure (@{$raw}) {
% my $linetype = q{};
-% given ($departure->type) {
-% when ($_ =~ m{enbahn$}) { $linetype = 'tram' }
-% when ('S-Bahn') { $linetype = 'sbahn' }
-% when ([qw[NE Niederflurbus SB Bus]]) { $linetype = 'bus' }
-% when ('U-Bahn') { $linetype = 'ubahn' }
+% if ($departure->can('type')) {
+% given ($departure->type) {
+% when ($_ =~ m{enbahn$}) { $linetype = 'tram' }
+% when ('S-Bahn') { $linetype = 'sbahn' }
+% when ([qw[NE Niederflurbus SB Bus]]) { $linetype = 'bus' }
+% when ('U-Bahn') { $linetype = 'ubahn' }
+% }
% }
<li>
<span class="line <%= $linetype %>">
%= $departure->line
</span>
<span class="route">
-% if ($departure->lineref) {
+% if ($departure->can('lineref') and $departure->lineref) {
%= $departure->lineref->route
% }
</span>
@@ -44,10 +46,10 @@
%= $departure->destination
</span>
<span class="countdown">
-% if ($departure->delay) {
+% if ($departure->can('delay') and $departure->delay) {
<span class="delay"> (+<%= $departure->delay %>) </span>
% }
-% if ($departure->is_cancelled) {
+% if ($departure->can('is_cancelled') and $departure->is_cancelled) {
<span class="delay"> FĂ„LLT AUS </span>
% }
% else {