summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/_suggestions_dbris.html.ep54
-rw-r--r--templates/departures.html.ep7
2 files changed, 60 insertions, 1 deletions
diff --git a/templates/_suggestions_dbris.html.ep b/templates/_suggestions_dbris.html.ep
new file mode 100644
index 0000000..175a57b
--- /dev/null
+++ b/templates/_suggestions_dbris.html.ep
@@ -0,0 +1,54 @@
+<ul class="collection departures connections">
+ % for my $res (@{$suggestions}) {
+ % my ($dep, $dest) = @{$res};
+ % my $row_class = '';
+ % my $link_class = 'action-checkin';
+ % if ($dep->is_cancelled) {
+ % $row_class = 'cancelled';
+ % $link_class = 'action-cancelled-from';
+ % }
+ % if ($checkin_from) {
+ <li class="collection-item <%= $row_class %> <%= $link_class %>"
+ data-dbris="<%= $dbris %>"
+ data-station="<%= $dep->stop_eva %>"
+ data-train="<%= $dep->id %>"
+ data-suffix="<%= $dep->maybe_line_no %>"
+ data-ts="<%= ($dep->sched_dep // $dep->dep)->epoch %>"
+ data-dest="<%= $dest->{name} %>">
+ % }
+ % else {
+ <li class="collection-item <%= $row_class %>">
+ % }
+ <a class="dep-time" href="#">
+ % if ($dep->is_cancelled) {
+ %= $dep->sched_dep->strftime('%H:%M')
+ % }
+ % else {
+ %= $dep->dep->strftime('%H:%M')
+ % }
+ % if ($dep->delay) {
+ %= sprintf('(%+d)', $dep->delay)
+ % }
+ </a>
+ <span class="connect-platform-wrapper">
+ % if ($dep->platform) {
+ <span>
+ % if (($dep->type // q{}) =~ m{ ast | bus | ruf }ix) {
+ Steig
+ % }
+ % else {
+ Gleis
+ % }
+ %= $dep->platform
+ </span>
+ % }
+ <span class="dep-line <%= $dep->type // q{} %>">
+ %= $dep->line
+ </span>
+ </span>
+ <span class="dep-dest">
+ %= $dest->{name}
+ </span>
+ </li>
+ % }
+</ul>
diff --git a/templates/departures.html.ep b/templates/departures.html.ep
index 6df48a8..db12422 100644
--- a/templates/departures.html.ep
+++ b/templates/departures.html.ep
@@ -88,7 +88,7 @@
</div>
</div>
% }
-% elsif (not param('train') and (@{stash('connections_iris') // []} or @{stash('connections_hafas') // []}) ) {
+% elsif (not param('train') and (@{stash('connections_iris') // []} or @{stash('connections_hafas') // []} or @{stash('suggestions') // []}) ) {
% $have_connections = 1;
<div class="row">
<div class="col s12">
@@ -99,6 +99,11 @@
% if (@{stash('connections_hafas') // []}) {
%= include '_connections_hafas', connections => stash('connections_hafas'), checkin_from => $eva;
% }
+ % if (@{stash('suggestions') // []}) {
+ % if ($dbris) {
+ %= include '_suggestions_dbris', suggestions => stash('suggestions'), checkin_from => $eva;
+ % }
+ % }
</div>
</div>
% }