summaryrefslogtreecommitdiff
path: root/templates/_connections.html.ep
blob: d4f5bb158ad6f0cea36fbd4c16e8afad9ffb423d (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<div class="hide-on-med-and-up"><table class="striped"><tbody>
	% for my $res (@{$connections}) {
		% my ($train, $via) = @{$res};
		% my $td_class = '';
		% my $link_class = 'action-checkin';
		% if ($train->is_cancelled) {
			% $td_class = 'cancelled';
			% $link_class = 'action-cancelled-from';
		% }
		<tr>
			<td class="<%= $td_class %>">
				% if ($checkin_from) {
					<a class="<%= $link_class %>" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via %>"><%= $train->line %></a>
				% }
				% else {
					%= $train->line
				% }
			</td>
			<td class="<%= $td_class %>">
				% if ($checkin_from) {
					<a class="<%= $link_class %>" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via %>"><%= $via %></a>
				% }
				% else {
					%= $via
				% }
				<br/>
				% if ($train->{message_id}{96} or $train->{message_id}{97}) {
					<i class="material-icons tiny" aria-label="Zug ist überbesetzt">warning</i>
				% }
				% if ($train->{message_id}{82} or $train->{message_id}{85}) {
					<i class="material-icons tiny" aria-label="Fehlende Wagen">people</i>
				% }
				% if (($train->{message_id}{73} or $train->{message_id}{74} or $train->{message_id}{75} or $train->{message_id}{76} or $train->{message_id}{80}) and not $train->{message_id}{84}) {
					<i class="material-icons tiny" aria-label="Abweichende Wagenreihung">compare_arrows</i>
				% }
				% if ($train->{message_id}{83} or $train->{message_id}{93} or $train->{message_id}{95}) {
					<i class="material-icons tiny" aria-label="Eingeschränkte Barrierefreiheit">info_outline</i>
				% }
				% if ($train->{message_id}{70} or $train->{message_id}{71}) {
					<i class="material-icons tiny" aria-label="Ohne WLAN">portable_wifi_off</i>
				% }
			</td>
			<td>
				% if ($train->departure_is_cancelled) {
					%= $train->sched_departure->strftime('%H:%M')
					⊖
				% }
				% else {
					%= $train->departure->strftime('%H:%M')
					% if ($train->departure_delay) {
						%= sprintf('(%+d)', $train->departure_delay)
					% }
					<br/>Gleis <%= $train->platform || '?' %>
				% }
			</td>
		</tr>
	% }
</tbody></table></div>
<div class="hide-on-small-only"><table class="striped"><tbody>
	% for my $res (@{$connections}) {
		% my ($train, $via) = @{$res};
		% my $td_class = '';
		% my $link_class = 'action-checkin';
		% if ($train->departure_is_cancelled) {
			% $td_class = 'cancelled';
			% $link_class = 'action-cancelled-from';
		% }
		<tr>
			<td class="<%= $td_class %>">
				% if ($checkin_from) {
					<a class="<%= $link_class %>" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via %>"><%= $train->line %></a>
				% }
				% else {
					%= $train->line
				% }
			</td>
			<td class="<%= $td_class %>">
				% if ($checkin_from) {
					<a class="<%= $link_class %>" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via %>"><%= $via %></a>
				% }
				% else {
					%= $via
				% }
				% if ($train->{message_id}{96} or $train->{message_id}{97}) {
					<i class="material-icons tiny" aria-label="Zug ist überbesetzt">warning</i>
				% }
				% if ($train->{message_id}{82} or $train->{message_id}{85}) {
					<i class="material-icons tiny" aria-label="Fehlende Wagen">people</i>
				% }
				% if (($train->{message_id}{73} or $train->{message_id}{74} or $train->{message_id}{75} or $train->{message_id}{76} or $train->{message_id}{80}) and not $train->{message_id}{84}) {
					<i class="material-icons tiny" aria-label="Abweichende Wagenreihung">compare_arrows</i>
				% }
				% if ($train->{message_id}{83} or $train->{message_id}{93} or $train->{message_id}{95}) {
					<i class="material-icons tiny" aria-label="Eingeschränkte Barrierefreiheit">info_outline</i>
				% }
				% if ($train->{message_id}{70} or $train->{message_id}{71}) {
					<i class="material-icons tiny" aria-label="Ohne WLAN">portable_wifi_off</i>
				% }
			</td>
			<td>
				% if ($train->departure_is_cancelled) {
					%= $train->sched_departure->strftime('%H:%M')
				% }
				% else {
					%= $train->departure->strftime('%H:%M')
					% if ($train->departure_delay) {
						%= sprintf('(%+d)', $train->departure_delay)
					% }
				% }
			</td><td>
				% if (not $train->departure_is_cancelled) {
					Gleis <%= $train->platform || '?' %>
				% }
				% else {
					fällt aus
				% }
			</td>
		</tr>
	% }
</tbody></table></div>