recent targets: distinguish hafas/iris

This commit is contained in:
Birte Kristina Friesel 2023-08-16 09:31:01 +02:00
parent 2ce2291e94
commit 5d330a7738
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA
3 changed files with 6 additions and 5 deletions

View file

@ -800,7 +800,7 @@ sub get_latest_checkout_stations {
my $res = $db->select( my $res = $db->select(
'journeys_str', 'journeys_str',
[ 'arr_name', 'arr_eva' ], [ 'arr_name', 'arr_eva', 'train_id' ],
{ {
user_id => $uid, user_id => $uid,
cancelled => 0 cancelled => 0
@ -821,8 +821,9 @@ sub get_latest_checkout_stations {
push( push(
@ret, @ret,
{ {
name => $row->{arr_name}, name => $row->{arr_name},
eva => $row->{arr_eva} eva => $row->{arr_eva},
hafas => ( $row->{train_id} =~ m{[|]} ? 1 : 0 ),
} }
); );
} }

View file

@ -24,7 +24,7 @@ $(document).ready(function() {
const res = $(document.createElement('p')); const res = $(document.createElement('p'));
$.each(stops, function(i, stop) { $.each(stops, function(i, stop) {
const parts = stop.split(';'); 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() { node.click(function() {
$('nav .preloader-wrapper').addClass('active'); $('nav .preloader-wrapper').addClass('active');
}); });

View file

@ -55,7 +55,7 @@
<div class="card-content"> <div class="card-content">
<span class="card-title">Hallo, <%= current_user->{name} %>!</span> <span class="card-title">Hallo, <%= current_user->{name} %>!</span>
<p>Du bist gerade nicht eingecheckt.</p> <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> <button class="btn waves-effect waves-light btn-flat">Stationen in der Umgebung abfragen</button>
</div> </div>
%= form_for 'list_departures' => begin %= form_for 'list_departures' => begin