travelynx/templates/_connections.html.ep

79 lines
2.5 KiB
Text
Raw Normal View History

<div><table class="striped"><tbody>
2019-05-19 08:32:57 +00:00
% 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_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via %>">
% }
% else {
<tr>
% }
<td class="<%= $td_class %>">
2019-05-19 08:32:57 +00:00
% if ($checkin_from) {
2022-07-14 19:05:07 +00:00
<a><%= $train->line %></a>
2019-05-19 08:32:57 +00:00
% }
% else {
%= $train->line
% }
<br/>
% if ($train->platform) {
% if ($checkin_from) {
<a>Gleis <%= $train->platform %></a>
% }
% else {
Gleis <%= $train->platform %>
% }
2022-09-24 16:57:23 +00:00
% }
2019-05-19 08:32:57 +00:00
</td>
<td class="<%= $td_class %>">
2019-05-19 08:32:57 +00:00
% if ($checkin_from) {
<a><%= $via %></a>
2019-05-19 08:32:57 +00:00
% }
% else {
%= $via
2019-05-19 08:32:57 +00:00
% }
<br/>
% if ($train->{interchange_icon}) {
<i class="material-icons tiny" aria-label="<%= $train->{interchange_text} %>"><%= $train->{interchange_icon} %></i>
% }
% 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>
2020-03-03 17:29:37 +00:00
% }
% 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>
2020-03-03 17:29:37 +00:00
% }
% 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>
2020-03-03 17:29:37 +00:00
% }
% if ($train->{message_id}{70} or $train->{message_id}{71}) {
<i class="material-icons tiny" aria-label="Ohne WLAN">portable_wifi_off</i>
2020-03-03 17:29:37 +00:00
% }
2019-05-19 08:32:57 +00:00
</td>
<td>
% if ($train->departure_is_cancelled) {
%= $train->sched_departure->strftime('%H:%M')
% }
% else {
%= $train->departure->strftime('%H:%M')
% }
% if ($via_arr) {
→ <%= $via_arr %>
% }
% if ($train->departure_delay) {
%= sprintf('(%+d)', $train->departure_delay)
2019-05-19 08:32:57 +00:00
% }
</td>
2019-05-19 08:32:57 +00:00
</tr>
% }
</tbody></table></div>