diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-11-25 21:18:57 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-11-25 21:18:57 +0100 |
commit | 4f0fee7783d3919110287ee9edd0c3a86e961814 (patch) | |
tree | 5080e355e0f1d268c526073b0a12b84aff6295cd /templates/_connections.html.ep | |
parent | 613f7d6087ab62f9fd36d3cb2c42da1f91ebb48e (diff) |
show cancelled trains in connections list
Diffstat (limited to 'templates/_connections.html.ep')
-rw-r--r-- | templates/_connections.html.ep | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/templates/_connections.html.ep b/templates/_connections.html.ep index f1d8c2b..a30e896 100644 --- a/templates/_connections.html.ep +++ b/templates/_connections.html.ep @@ -1,28 +1,42 @@ <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> + <td class="<%= $td_class %>"> % if ($checkin_from) { - <a class="action-checkin" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via %>"><%= $train->line %></a> + <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> + <td class="<%= $td_class %>"> % if ($checkin_from) { - <a class="action-checkin" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via %>"><%= $via %></a> + <a class="<%= $link_class %>" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via %>"><%= $via %></a> % } % else { %= $via % } </td> - <td><%= $train->departure->strftime('%H:%M') %> - % if ($train->departure_delay) { - %= sprintf('(%+d)', $train->departure_delay) + <td> + % if ($train->departure_is_cancelled) { + %= $train->sched_departure->strftime('%H:%M') + ⊖ % } - <br/>Gleis <%= $train->platform || '?' %></td> + % else { + %= $train->departure->strftime('%H:%M') + % if ($train->departure_delay) { + %= sprintf('(%+d)', $train->departure_delay) + % } + <br/>Gleis <%= $train->platform || '?' %> + % } + </td> </tr> % } </tbody></table></div> @@ -52,11 +66,22 @@ %= $via % } </td> - <td><%= $train->departure->strftime('%H:%M') %> - % if ($train->departure_delay) { - %= sprintf('(%+d)', $train->departure_delay) + <td> + % if ($train->departure_is_cancelled) { + %= $train->sched_departure->strftime('%H:%M') + (fällt aus) + % } + % else { + %= $train->departure->strftime('%H:%M') + % if ($train->departure_delay) { + %= sprintf('(%+d)', $train->departure_delay) + % } % } - </td><td>Gleis <%= $train->platform || '?' %></td> + </td><td> + % if (not $train->departure_is_cancelled) { + Gleis <%= $train->platform || '?' %> + % } + </td> </tr> % } </tbody></table></div> |