summaryrefslogtreecommitdiff
path: root/templates/departures.html.ep
blob: 6a6f1595e408f3d77e49d7bea82e715f50b51d1f (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
<div class="row">
	<div class="col s12">
		% my $status = $self->get_user_status;
		% if ($status->{checked_in}) {
			<div class="card grey darken-4">
				<div class="card-content white-text">
					<span class="card-title">Aktuell eingecheckt</span>
					<p>In <%= $status->{train_type} %> <%= $status->{train_no} %>
						ab <%= $status->{station_name} %></p>
				</div>
				<div class="card-action">
					<a class="action-checkout" data-station="<%= $ds100 %>">
						Hier auschecken
					</a>
				</div>
			</div>
		% }
		% elsif ($status->{timestamp_delta} < 600) {
			<div class="card grey darken-4">
				<div class="card-content white-text">
					<span class="card-title">Ausgecheckt</span>
					<p>Aus <%= $status->{train_type} %> <%= $status->{train_no} %>
						bis <%= $status->{station_name} %></p>
				</div>
				<div class="card-action">
					<a class="action-undo">
						<i class="material-icons">undo</i> Rückgängig?
					</a>
				</div>
			</div>
		% }
	</div>
</div>
<div class="row">
	<div class="col s12">
		Zug auswählen zum Einchecken.<br/>
		<table class="striped">
			<thead>
				<tr>
					<th>Zug</th>
					<th></th>
					<th>Abfahrt</th>
				</tr>
			</thead>
			<tbody>
				% for my $result (@{$results}) {
					<tr>
						<td>
							<a class="action-checkin" data-station="<%= $ds100 %>" data-train="<%= $result->train_id %>">
								<%= $result->line %>
							</a>
						</td>
						<td>
							<a class="action-checkin" data-station="<%= $ds100 %>" data-train="<%= $result->train_id %>">
								<%= $result->destination %>
							</a>
						</td>
						<td><%= $result->departure->strftime('%H:%M') %>
							% if ($result->departure_delay) {
								(+<%= $result->departure_delay %>)
							% }
						</td>
					</tr>
				% }
			</tbody>
		</table>
	</div>
</div>