blob: 45f2772616e865f2b4d5ab4faa06a35bca77d314 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
<!DOCTYPE html>
<html>
<head>
<title><%= $title %></title>
<meta charset="utf-8">
% if ($self->stash('refresh_interval')) {
<meta http-equiv="refresh" content="<%= $self->stash('refresh_interval') %>"/>
% }
%= stylesheet '/infoscreen.css'
%= javascript '/jquery-2.1.1.min.js'
</head>
<body>
% if (my $error = stash 'error') {
<div class="error">Received an error from the backend service:</div>
<div>
<pre>
%= $error
</pre>
</div>
% }
<div class="displayclean">
<ul>
% for my $departure (@{$raw}) {
% my $linetype = q{};
% 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->can('lineref') and $departure->lineref) {
%= $departure->lineref->route
% }
% elsif ($departure->can('route_timetable')) {
% my @first_deps = ($departure->route_timetable)[0..2];
% delete $first_deps[2] unless defined $first_deps[2];
% delete $first_deps[1] unless defined $first_deps[1];
% delete $first_deps[0] unless defined $first_deps[0];
%= join(' - ', map { $_->[1] } @first_deps );
% }
</span>
<span class="dest">
%= $departure->destination
</span>
<span class="countdown">
% if ($departure->can('delay') and $departure->delay) {
<span class="delay"> (+<%= $departure->delay %>) </span>
% }
% if ($departure->can('is_cancelled') and $departure->is_cancelled) {
<span class="delay"> FÄLLT AUS </span>
% }
% else {
<%= $departure->countdown %> min
% }
</span>
<span class="time">
%= $departure->time
</span>
</li>
% }
</ul>
</div>
<div class="about">
<a href="http://finalrewind.org/projects/db-fakedisplay/">db-fakedisplay</a>
v<%= $version %>
</div>
</body>
</html>
|