summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-08-16 09:31:01 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-08-16 09:31:01 +0200
commit5d330a773810f6801c94cd5469f5cec8adf5a420 (patch)
tree1608350d8149179c0a00dda787fb496692f1979e
parent2ce2291e9414e30f3727cf3bac12e6fb8b33564d (diff)
recent targets: distinguish hafas/iris
-rwxr-xr-xlib/Travelynx/Model/Journeys.pm7
-rw-r--r--public/static/js/geolocation.js2
-rw-r--r--templates/landingpage.html.ep2
3 files changed, 6 insertions, 5 deletions
diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm
index a4fe12c..532f9cd 100755
--- a/lib/Travelynx/Model/Journeys.pm
+++ b/lib/Travelynx/Model/Journeys.pm
@@ -800,7 +800,7 @@ sub get_latest_checkout_stations {
my $res = $db->select(
'journeys_str',
- [ 'arr_name', 'arr_eva' ],
+ [ 'arr_name', 'arr_eva', 'train_id' ],
{
user_id => $uid,
cancelled => 0
@@ -821,8 +821,9 @@ sub get_latest_checkout_stations {
push(
@ret,
{
- name => $row->{arr_name},
- eva => $row->{arr_eva}
+ name => $row->{arr_name},
+ eva => $row->{arr_eva},
+ hafas => ( $row->{train_id} =~ m{[|]} ? 1 : 0 ),
}
);
}
diff --git a/public/static/js/geolocation.js b/public/static/js/geolocation.js
index d2fa18d..42c7f1e 100644
--- a/public/static/js/geolocation.js
+++ b/public/static/js/geolocation.js
@@ -24,7 +24,7 @@ $(document).ready(function() {
const res = $(document.createElement('p'));
$.each(stops, function(i, stop) {
const parts = stop.split(';');
- const node = $('<a class="tablerow" href="/s/' + parts[0] + '"><span>' + parts[1] + '</span></a>');
+ const node = $('<a class="tablerow" href="/s/' + parts[0] + '?hafas=' + parts[2] + '"><span>' + parts[1] + '</span></a>');
node.click(function() {
$('nav .preloader-wrapper').addClass('active');
});
diff --git a/templates/landingpage.html.ep b/templates/landingpage.html.ep
index 951e39b..bf2835e 100644
--- a/templates/landingpage.html.ep
+++ b/templates/landingpage.html.ep
@@ -55,7 +55,7 @@
<div class="card-content">
<span class="card-title">Hallo, <%= current_user->{name} %>!</span>
<p>Du bist gerade nicht eingecheckt.</p>
- <div class="geolocation" data-recent="<%= join('|', map { $_->{eva} . ';' . $_->{name} } @{stash('recent_targets') // []} ) %>">
+ <div class="geolocation" data-recent="<%= join('|', map { $_->{eva} . ';' . $_->{name} . ';' . $_->{hafas} } @{stash('recent_targets') // []} ) %>">
<button class="btn waves-effect waves-light btn-flat">Stationen in der Umgebung abfragen</button>
</div>
%= form_for 'list_departures' => begin