summaryrefslogtreecommitdiff
path: root/templates/departures.html.ep
diff options
context:
space:
mode:
Diffstat (limited to 'templates/departures.html.ep')
-rw-r--r--templates/departures.html.ep57
1 files changed, 44 insertions, 13 deletions
diff --git a/templates/departures.html.ep b/templates/departures.html.ep
index bbae40f..0d57039 100644
--- a/templates/departures.html.ep
+++ b/templates/departures.html.ep
@@ -15,6 +15,9 @@
% elsif (param('hafas')) {
<a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= param('hafas') %></a>
% }
+ % elsif (param('motis')) {
+ <a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= param('motis') %></a>
+ % }
% else {
% if ($user->{backend_id}) {
<a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= $user->{backend_name} %></a>
@@ -33,7 +36,13 @@
<div class="card">
<div class="card-content">
<span class="card-title">Aktuell eingecheckt</span>
- <p>In <%= $user_status->{train_type} %> <%= $user_status->{train_no} %>
+ <p>In
+ % if ( not $user_status->{is_motis} ) {
+ <%= $user_status->{train_type} %>
+ % }
+
+ <%= $user_status->{train_line} // $user_status->{train_no} %>
+
% if ( $user_status->{arr_name}) {
von <%= $user_status->{dep_name} %> nach <%= $user_status->{arr_name} %>
% }
@@ -72,14 +81,7 @@
</div>
</div>
% }
-% elsif ($user_status->{timestamp_delta} < 180) {
- <div class="row">
- <div class="col s12">
- %= include '_checked_out', journey => $user_status;
- </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">
@@ -90,13 +92,28 @@
% 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;
+ % }
+ % elsif ($efa) {
+ %= include '_suggestions_efa', suggestions => stash('suggestions'), checkin_from => $eva;
+ % }
+ % }
+ </div>
+ </div>
+% }
+% if (not $user_status->{checked_in} and $user_status->{timestamp_delta} < 180) {
+ <div class="row">
+ <div class="col s12">
+ %= include '_checked_out', journey => $user_status;
</div>
</div>
% }
<div class="row">
<div class="col s4 center-align">
- % if ($dbris or $hafas) {
+ % if ($dbris or $efa or $hafas or $motis) {
<a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({dbris => $dbris, hafas => $hafas, timestamp => $datetime->clone->subtract(hours => 1)->epoch}) %>"><i class="material-icons left" aria-hidden="true">chevron_left</i><span class="hide-on-small-only">früher</span></a>
% }
</div>
@@ -106,7 +123,7 @@
% }
</div>
<div class="col s4 center-align">
- % if ($dbris or $hafas) {
+ % if ($dbris or $efa or $hafas or $motis) {
<a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({dbris => $dbris, hafas => $hafas, timestamp => $datetime->clone->add(hours => 1)->epoch}) %>"><span class="hide-on-small-only">später</span><i class="material-icons right" aria-hidden="true">chevron_right</i></a>
% }
</div>
@@ -151,9 +168,15 @@
% if ($dbris) {
%= include '_departures_dbris', results => $results, dbris => $dbris;
% }
+ % elsif ($efa) {
+ %= include '_departures_efa', results => $results, efa => $efa;
+ % }
% elsif ($hafas) {
%= include '_departures_hafas', results => $results, hafas => $hafas;
% }
+ % elsif ($motis) {
+ %= include '_departures_motis', results => $results, motis => $motis;
+ % }
% else {
%= include '_departures_iris', results => $results;
% }
@@ -163,15 +186,23 @@
<div class="row">
<div class="col s4 center-align">
- % if ($dbris or $hafas) {
+ % if ($dbris or $efa or $hafas or $motis) {
<a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({dbris => $dbris, hafas => $hafas, timestamp => $datetime->clone->subtract(hours => 1)->epoch}) %>"><i class="material-icons left" aria-hidden="true">chevron_left</i><span class="hide-on-small-only">früher</span></a>
% }
</div>
<div class="col s4 center-align">
</div>
<div class="col s4 center-align">
- % if ($dbris or $hafas) {
+ % if ($dbris or $efa or $hafas or $motis) {
<a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({dbris => $dbris, hafas => $hafas, timestamp => $datetime->clone->add(hours => 1)->epoch}) %>"><span class="hide-on-small-only">später</span><i class="material-icons right" aria-hidden="true">chevron_right</i></a>
% }
</div>
</div>
+
+% if (not $user_status->{checked_in}) {
+ <div class="row">
+ <div class="col s12 center-align">
+ <a class="btn-small" href="<%= url_for('checkinadd')->query({dbris => $dbris, efa => $efa, hafas => $hafas, motis => $motis, dep_station => $station}) %>"><i class="material-icons left" aria-hidden="true">add</i><span>manuell einchecken</span></a>
+ </div>
+ </div>
+% }