summaryrefslogtreecommitdiff
path: root/lib/Travelynx
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-07-16 10:30:47 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-07-16 10:30:47 +0200
commitb0bb69d87ed0d807946474ec66f4f07935a2b147 (patch)
treefe0e24f971637fab380116d53f3841cfa92fd610 /lib/Travelynx
parent40bec7774b53b1f127a5a5d47ff3fafc9650205f (diff)
show followee checkins in departure board
Diffstat (limited to 'lib/Travelynx')
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm12
-rw-r--r--lib/Travelynx/Model/InTransit.pm2
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index c69d517..fc59b68 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -799,6 +799,18 @@ sub station {
my ($self) = @_;
my $station = $self->stash('station');
my $train = $self->param('train');
+ my $uid = $self->current_user->{id};
+
+ my @timeline = $self->in_transit->get_timeline(
+ uid => $uid,
+ short => 1
+ );
+ my %checkin_by_train;
+ for my $checkin (@timeline) {
+ say $checkin->{train_id};
+ push( @{ $checkin_by_train{ $checkin->{train_id} } }, $checkin );
+ }
+ $self->stash( checkin_by_train => \%checkin_by_train );
$self->render_later;
diff --git a/lib/Travelynx/Model/InTransit.pm b/lib/Travelynx/Model/InTransit.pm
index 0fb8e1d..26f689f 100644
--- a/lib/Travelynx/Model/InTransit.pm
+++ b/lib/Travelynx/Model/InTransit.pm
@@ -316,7 +316,7 @@ sub get_timeline {
return $db->select(
'follows_in_transit',
[
- qw(followee_name train_type train_line train_no dep_eva dep_name arr_eva arr_name)
+ qw(followee_name train_type train_line train_no train_id dep_eva dep_name arr_eva arr_name)
],
$where
)->hashes->each;