summaryrefslogtreecommitdiff
path: root/templates/_connections_hafas.html.ep
blob: 93221161ad5d328ffec5a745abaef22b2adc3c49 (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
<div><table class="striped"><tbody>
	% for my $res (@{$connections}) {
		% my ($train, $via, $via_arr) = @{$res};
		% $via_arr = $via_arr ? $via_arr->strftime('%H:%M') : q{};
		% my $td_class = '';
		% my $link_class = 'action-checkin';
		% if ($train->is_cancelled) {
			% $td_class = 'cancelled';
			% $link_class = 'action-cancelled-from';
		% }
		% if ($checkin_from) {
			<tr class="<%= $link_class %>" data-station="<%= $train->station_eva %>" data-train="<%= $train->id %>" data-dest="<%= $via->{name} %>">
		% }
		% else {
			<tr>
		% }
			<td class="<%= $td_class %>">
				% if ($train->platform) {
					% if ($checkin_from) {
						<a>Gleis <%= $train->platform %></a>
					% }
					% else {
						Gleis <%= $train->platform %>
					% }
					<br/>
				% }
				% if ($checkin_from) {
					<a><%= $train->line %></a>
				% }
				% else {
					%= $train->line
				% }
			</td>
			<td class="<%= $td_class %>">
				% if ($checkin_from) {
					<a><%= $via->{name} %></a>
				% }
				% else {
					%= $via->{name}
				% }
			</td>
			<td>
				% if ($train->is_cancelled) {
					%= $train->sched_datetime->strftime('%H:%M')
					⊖
				% }
				% else {
					%= $train->datetime->strftime('%H:%M')
				% }
				% if ($via_arr) {
					→ <%= $via_arr %>
				% }
				% if ($train->delay) {
					%= sprintf('(%+d)', $train->delay)
				% }
			</td>
		</tr>
	% }
</tbody></table></div>