summaryrefslogtreecommitdiff
path: root/templates/_connections_hafas.html.ep
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-09-24 18:19:17 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-09-24 18:19:17 +0200
commitde074342de0bdc3604a0610a0c5f9cce5338bb85 (patch)
tree721c6c7415945ca57779e51db5dde00e136a62c2 /templates/_connections_hafas.html.ep
parent8810acf742629294713448408ab6f0719f17952f (diff)
add support for HAFAS connection suggestions; drop manual destination list
Still TODO: handle stations that have several EVAs
Diffstat (limited to 'templates/_connections_hafas.html.ep')
-rw-r--r--templates/_connections_hafas.html.ep59
1 files changed, 59 insertions, 0 deletions
diff --git a/templates/_connections_hafas.html.ep b/templates/_connections_hafas.html.ep
new file mode 100644
index 0000000..9322116
--- /dev/null
+++ b/templates/_connections_hafas.html.ep
@@ -0,0 +1,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>