mirror of
https://github.com/derf/travelynx
synced 2024-11-29 16:00:20 +00:00
47f76da4f8
Squashed commit of the following: commit92518024ba
Author: Birte Kristina Friesel <birte.friesel@uos.de> Date: Fri Jul 26 18:39:46 2024 +0200 add_or_update station: remove superfluos 'new backend id := old backend id' commitdf21c20c6e
Author: Birte Kristina Friesel <birte.friesel@uos.de> Date: Fri Jul 26 18:35:51 2024 +0200 revert connection targets min_count to 3 commitbe335cef07
Author: Birte Kristina Friesel <birte.friesel@uos.de> Date: Fri Jul 26 18:20:05 2024 +0200 mention backend selection in API documentation commit9f41828fb4
Author: Birte Kristina Friesel <derf@finalrewind.org> Date: Thu Jul 25 20:19:23 2024 +0200 use_history: not all backends provide route data in departure monitor commit09714b4d89
Author: Birte Kristina Friesel <derf@finalrewind.org> Date: Thu Jul 25 20:11:44 2024 +0200 disambiguation: pass correct hafas parameter commit8cdf1120fc
Author: Birte Kristina Friesel <derf@finalrewind.org> Date: Thu Jul 25 20:11:28 2024 +0200 _checked_in: hide Zuglauf link for non-db checkins commit7455653f54
Author: Birte Kristina Friesel <derf@finalrewind.org> Date: Thu Jul 25 20:01:47 2024 +0200 debug output commitb9cda07f85
Author: Birte Kristina Friesel <derf@finalrewind.org> Date: Thu Jul 25 19:09:07 2024 +0200 fix remaining get_connection_targets / get_connecting_trains_p invocations commit2759d7258c
Author: Birte Kristina Friesel <derf@finalrewind.org> Date: Wed Jul 24 20:50:12 2024 +0200 support non-DB HAFAS backends (WiP)
150 lines
6.1 KiB
Text
150 lines
6.1 KiB
Text
<div class="row">
|
||
<div class="col s8">
|
||
<strong style="font-size: 120%;">
|
||
<%= $station %>
|
||
</strong>
|
||
% for my $related_station (sort { $a->{name} cmp $b->{name} } @{$related_stations}) {
|
||
+ <%= $related_station->{name} %> <br/>
|
||
% }
|
||
</div>
|
||
<div class="col s4 center-align">
|
||
% my $self_link = url_for('sstation', station => param('station'));
|
||
% if (param('hafas')) {
|
||
<span class="btn-small disabled"><i class="material-icons left" aria-hidden="true">directions</i> <%= param('hafas') %> (HAFAS)</span>
|
||
% }
|
||
% else {
|
||
% if ($user->{backend_id}) {
|
||
<a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small"><i class="material-icons left" aria-hidden="true">directions</i><%= $user->{backend_name} %> (<%= $user->{backend_hafas} ? 'HAFAS' : q{} %>)</a>
|
||
% }
|
||
% else {
|
||
<a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small"><i class="material-icons left" aria-hidden="true">train</i>DB (IRIS-TTS)</a>
|
||
% }
|
||
% }
|
||
</div>
|
||
</div>
|
||
|
||
% my $have_connections = 0;
|
||
% if ($user_status->{checked_in}) {
|
||
<div class="row">
|
||
<div class="col s12">
|
||
<div class="card">
|
||
<div class="card-content">
|
||
<span class="card-title">Aktuell eingecheckt</span>
|
||
<p>In <%= $user_status->{train_type} %> <%= $user_status->{train_no} %>
|
||
% if ( $user_status->{arr_name}) {
|
||
von <%= $user_status->{dep_name} %> nach <%= $user_status->{arr_name} %>
|
||
% }
|
||
% else {
|
||
ab <%= $user_status->{dep_name} %>
|
||
% }
|
||
</p>
|
||
</div>
|
||
<div class="card-action">
|
||
% if ($can_check_out) {
|
||
<a class="action-undo" data-hafas="<%= param('hafas') // q{} %>" data-id="in_transit" data-checkints="<%= $user_status->{timestamp}->epoch %>" style="margin-right: 0;">
|
||
<i class="material-icons left" aria-hidden="true">undo</i> Rückgängig
|
||
</a>
|
||
<a class="action-checkout right" data-hafas="<%= param('hafas') // q{} %>" data-station="<%= $eva %>" data-force="1">
|
||
Hier auschecken
|
||
</a>
|
||
% }
|
||
% else {
|
||
<a class="action-undo" data-id="in_transit" data-checkints="<%= $user_status->{timestamp}->epoch %>" style="margin-right: 0;">
|
||
<i class="material-icons left" aria-hidden="true">undo</i> Rückgängig
|
||
</a>
|
||
<a class="action-checkout right" data-hafas="<%= param('hafas') // q{} %>" data-station="<%= $eva %>" data-force="1">
|
||
<i class="material-icons left" aria-hidden="true">gps_off</i>
|
||
Hier auschecken
|
||
</a>
|
||
% }
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
% }
|
||
% elsif ($user_status->{cancellation} and $station eq $user_status->{cancellation}{dep_name}) {
|
||
<div class="row">
|
||
<div class="col s12">
|
||
%= include '_cancelled_departure', journey => $user_status->{cancellation};
|
||
</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') // []}) ) {
|
||
% $have_connections = 1;
|
||
<div class="row">
|
||
<div class="col s12">
|
||
<p>Häufig genutzte Verbindungen – Fahrt auswählen zum Einchecken mit Zielwahl</p>
|
||
% if (@{stash('connections_iris') // []}) {
|
||
%= include '_connections', connections => stash('connections_iris'), checkin_from => $eva;
|
||
% }
|
||
% if (@{stash('connections_hafas') // []}) {
|
||
%= include '_connections_hafas', connections => stash('connections_hafas'), checkin_from => $eva;
|
||
% }
|
||
</div>
|
||
</div>
|
||
% }
|
||
|
||
<div class="row">
|
||
<div class="col s4 center-align">
|
||
% if ($hafas) {
|
||
<a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({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">
|
||
% if ($now_in_range) {
|
||
<a class="btn-small" href="#now"><i class="material-icons left" aria-hidden="true">vertical_align_center</i><span class="hide-on-small-only">Jetzt</span></a>
|
||
% }
|
||
</div>
|
||
<div class="col s4 center-align">
|
||
% if ($hafas) {
|
||
<a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({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>
|
||
|
||
<div class="row">
|
||
<div class="col s12">
|
||
<p>
|
||
% if ($have_connections) {
|
||
Alle Abfahrten –
|
||
% }
|
||
% if ($user_status->{checked_in} and not $can_check_out) {
|
||
Diese Station liegt nicht auf der Route deines <a href="/">aktuellen Checkins</a>.
|
||
Falls du aktuell nicht mit <b><%= $user_status->{train_type} %> <%= $user_status->{train_no} %></b> unterwegs bist, kannst du den Checkin rückgängig machen.
|
||
Falls es sich bei <b><%= $station %></b> um einen nicht in den Echtzeitdaten abgebildeten Zusatzhalt handelt, kannst du hier auchecken.
|
||
Da travelynx nicht weiß, welcher der beiden Fälle zutrifft, sind bis dahin keine neuen Checkins möglich.
|
||
% }
|
||
% elsif ($user_status->{checked_in} and not $user_status->{arr_eva}) {
|
||
Du bist bereits eingecheckt und hast noch kein Fahrtziel angegeben.
|
||
Bitte <a href="/">wähle zunächst ein Ziel</a>.
|
||
Neue Checkins sind erst nach Ankunft der aktuellen Fahrt möglich.
|
||
% }
|
||
% elsif ($user_status->{checked_in} and $user_status->{arrival_countdown} > 0) {
|
||
Deine aktuelle Fahrt ist <a href="/">noch unterwegs</a>.
|
||
Ein neuer Checkin ist erst nach Ankunft am ausgewählten Ziel möglich.
|
||
% }
|
||
% elsif (@{$results}) {
|
||
Fahrt auswählen zum Einchecken.
|
||
% }
|
||
% else {
|
||
Keine Abfahrten gefunden. Ein Checkin ist frühestens 30 Minuten vor
|
||
und maximal 120 Minuten nach Abfahrt möglich.
|
||
% }
|
||
</p>
|
||
% if (not $user_status->{checked_in} or ($can_check_out and $user_status->{arr_eva} and $user_status->{arrival_countdown} <= 0)) {
|
||
% if ($hafas) {
|
||
%= include '_departures_hafas', results => $results, hafas => $hafas;
|
||
% }
|
||
% else {
|
||
%= include '_departures_iris', results => $results;
|
||
% }
|
||
% }
|
||
</div>
|
||
</div>
|