show followee checkins in departure board
This commit is contained in:
parent
40bec7774b
commit
b0bb69d87e
3 changed files with 16 additions and 1 deletions
|
@ -799,6 +799,18 @@ sub station {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
my $station = $self->stash('station');
|
my $station = $self->stash('station');
|
||||||
my $train = $self->param('train');
|
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;
|
$self->render_later;
|
||||||
|
|
||||||
|
|
|
@ -316,7 +316,7 @@ sub get_timeline {
|
||||||
return $db->select(
|
return $db->select(
|
||||||
'follows_in_transit',
|
'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
|
$where
|
||||||
)->hashes->each;
|
)->hashes->each;
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
<a>
|
<a>
|
||||||
<%= $result->destination %>
|
<%= $result->destination %>
|
||||||
</a>
|
</a>
|
||||||
|
% for my $checkin (@{$checkin_by_train->{$result->train_id} // []}) {
|
||||||
|
<br/>(<%= $checkin->{followee_name} %> → <%= $checkin->{arr_name} // '???' %>)
|
||||||
|
% }
|
||||||
</td>
|
</td>
|
||||||
<td class="<%= $td_class %>">
|
<td class="<%= $td_class %>">
|
||||||
% if ($result->departure_hidden) {
|
% if ($result->departure_hidden) {
|
||||||
|
|
Loading…
Reference in a new issue