From 1dc04eb45ad9d7208cbfa1d7eb046861ff43e0c2 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 20 May 2019 19:15:21 +0200 Subject: show journey suggestions on departure board as well --- templates/_checked_in.html.ep | 4 +++ templates/_checked_out.html.ep | 2 ++ templates/_connections.html.ep | 8 ++---- templates/account.html.ep | 16 +++++++++++ templates/changelog.html.ep | 17 ++++++++++++ templates/departures.html.ep | 61 +++++++++++++++++++++++++---------------- templates/use_history.html.ep | 62 ++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 141 insertions(+), 29 deletions(-) create mode 100644 templates/use_history.html.ep (limited to 'templates') diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep index d5b14e5..ebe84e8 100644 --- a/templates/_checked_in.html.ep +++ b/templates/_checked_in.html.ep @@ -79,6 +79,10 @@ % } % if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} < (20*60)) { % if (my @connections = get_connecting_trains()) { + Verbindungen + % if ($journey->{arrival_countdown} < 0) { +

Zug auswählen zum Einchecken mit Zielwahl.

+ % } %= include '_connections', connections => \@connections, checkin_from => $journey->{arrival_countdown} < 0 ? $journey->{arr_ds100} : undef; % } % } diff --git a/templates/_checked_out.html.ep b/templates/_checked_out.html.ep index 18b613b..ca9373d 100644 --- a/templates/_checked_out.html.ep +++ b/templates/_checked_out.html.ep @@ -5,6 +5,8 @@ bis <%= $journey->{arr_name} %>

% if (now()->epoch - $journey->{timestamp}->epoch < (30*60)) { % if (my @connections = get_connecting_trains()) { + Verbindungen +

Zug auswählen zum Einchecken mit Zielwahl.

%= include '_connections', connections => \@connections, checkin_from => $journey->{arr_ds100}; % } % } diff --git a/templates/_connections.html.ep b/templates/_connections.html.ep index 1c7f003..d421d4e 100644 --- a/templates/_connections.html.ep +++ b/templates/_connections.html.ep @@ -1,8 +1,4 @@ -Verbindungen -% if ($checkin_from) { -

Zug auswählen zum Einchecken mit Zielwahl.

-% } -
+
% for my $res (@{$connections}) { % my ($train, $via) = @{$res}; @@ -30,7 +26,7 @@ % }
-
+
% for my $res (@{$connections}) { % my ($train, $via) = @{$res}; diff --git a/templates/account.html.ep b/templates/account.html.ep index 2c58a7b..627be85 100644 --- a/templates/account.html.ep +++ b/templates/account.html.ep @@ -16,6 +16,9 @@ % elsif ($success eq 'privacy') { Einstellungen zu öffentliche Account-Daten geändert % } + % elsif ($success eq 'use_history') { + Einstellungen zu vorgeschlagenen Verbindungen geändert + % } % elsif ($success eq 'webhook') { Web Hook aktualisiert % } @@ -28,6 +31,7 @@

Account

% my $acc = current_user(); % my $hook = get_webhook(); +% my $use_history = account_use_history($acc->{id});
@@ -43,6 +47,18 @@ + + + +
Passwort edit
Verbindungen + edit + % if ($use_history & 0x03) { + Vorschläge aktiv + % } + % else { + Vorschläge deaktiviert + % } +
Öffentliche Daten diff --git a/templates/changelog.html.ep b/templates/changelog.html.ep index fec21a3..9c3d13f 100644 --- a/templates/changelog.html.ep +++ b/templates/changelog.html.ep @@ -1,5 +1,22 @@

Changelog

+
+
+ 1.6 +
+
+

+ add Anzeige von häufig genutzten + Verbindungen in der Abfahrtstafel. Wie bei den Anschlusszügen kann + darüber direkt (inkl. Vorauswahl des Ziels) eingecheckt werden. +

+

+ add Konfigurationsseite, um die + Heuristik für Anschlusszüge und häufige Verbindungen zu deaktivieren. +

+
+
+
1.5 diff --git a/templates/departures.html.ep b/templates/departures.html.ep index 3c9638e..7e98d9c 100644 --- a/templates/departures.html.ep +++ b/templates/departures.html.ep @@ -1,7 +1,13 @@
-
- % my $status = $self->get_user_status; - % if ($status->{checked_in}) { +
+ %= $station +
+
+% my $status = $self->get_user_status; +% my $have_connections = 0; +% if ($status->{checked_in}) { +
+
Aktuell eingecheckt @@ -14,31 +20,40 @@
- % } - % elsif ($status->{timestamp_delta} < 180) { +
+
+% } +% elsif ($status->{timestamp_delta} < 180) { +
+
%= include '_checked_out', journey => $status; - % } +
-
+% } +% elsif (not param('train') and my @connections = get_connecting_trains(ds100 => $ds100)) { + % $have_connections = 1; +
+
+

Häufig genutzte Verbindungen – Zug auswählen zum Einchecken mit Zielwahl

+ %= include '_connections', connections => \@connections, checkin_from => $ds100; +
+
+% }
- %= $station - % if (@{$results}) { - – Zug auswählen zum Einchecken. - % } - % else { - – Keine Abfahrten gefunden. Ein Checkin ist frühestens 30 Minuten vor - und maximal 120 Minuten nach Abfahrt möglich. - % } -
+

+ % if ($have_connections) { + Alle Abfahrten – + % } + % if (@{$results}) { + Zug auswählen zum Einchecken. + % } + % else { + Keine Abfahrten gefunden. Ein Checkin ist frühestens 30 Minuten vor + und maximal 120 Minuten nach Abfahrt möglich. + % } +

- - - - - - - % for my $result (@{$results}) { % my $td_class = ''; diff --git a/templates/use_history.html.ep b/templates/use_history.html.ep new file mode 100644 index 0000000..e8e129f --- /dev/null +++ b/templates/use_history.html.ep @@ -0,0 +1,62 @@ +

Bevorzugte Verbindungen

+
+
+

+ Travelynx kann anhand deiner vergangenen Fahrten Verbindungen zum + Einchecken vorschlagen. Fährst zu z.B regelmäßig von Dortmund Hbf + nach Essen Hbf, werden dir in Dortmund bevorzugt Züge angezeigt, die über + Essen fahren. Bei Auswahl dieser wird nicht nur in den Zug eingecheckt, + sondern auch direkt Essen Hbf als Ziel eingetragen. +

+ +

+
+

Vorschläge aktiv für:

+%= form_for '/account/insight' => (method => 'POST') => begin + %= csrf_field +
+
+ +
+
+
+
+ Zeige häufige Fahrten im Abfahrtsmonitor. +
+
+
+
+ +
+
+
+
+ Zeige Anschlussmöglichkeiten kurz vor Ankunft am Ziel der aktuellen + Reise. Sobald es erreicht wurde, ist über diese Liste auch ein Checkin + ohne Umweg über die Abfahrtstafel möglich. +
+
+
+
+
+
+ +
+
+
+
+%= end -- cgit v1.2.3
ZugAbfahrt