diff --git a/lib/Travelynx/Model/InTransit.pm b/lib/Travelynx/Model/InTransit.pm index d06b94e5f3c92a404e1b25c8d4e315564fdeb647..9899676f5f5bdfd73e5a81f21094fdbe05dd3b9f 100644 --- a/lib/Travelynx/Model/InTransit.pm +++ b/lib/Travelynx/Model/InTransit.pm @@ -96,8 +96,7 @@ sub add { 'in_transit', { user_id => $uid, - cancelled => $train->departure_is_cancelled - ? 1 + cancelled => $train->departure_is_cancelled ? 1 : 0, checkin_station_id => $checkin_station_id, checkin_time => DateTime->now( time_zone => 'Europe/Berlin' ), @@ -111,7 +110,13 @@ sub add { route => $json->encode($route), messages => $json->encode( [ map { [ $_->[0]->epoch, $_->[1] ] } $train->messages ] - ) + ), + data => JSON->new->encode( + { + rt => $train->departure_has_realtime ? 1 + : 0 + } + ), } ); } @@ -152,6 +157,7 @@ sub add { sched_departure => $stop->{sched_dep}, real_departure => $stop->{rt_dep} // $stop->{sched_dep}, route => $json->encode( [@route] ), + data => JSON->new->encode( { rt => $stop->{rt_dep} ? 1 : 0 } ), } ); } diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep index e5e0bafa3ae071dd591e58d3ba80a7bfe32461d9..f3ecda42f75f3bf98982050fc205dea6506a969e 100644 --- a/templates/_checked_in.html.ep +++ b/templates/_checked_in.html.ep @@ -2,7 +2,7 @@
- + % if (not $journey->{arr_name}) { Ziel wählen % } @@ -180,9 +180,12 @@ Bitte wähle ein neues Reiseziel.

% } - % if (@{$journey->{messages} // []} or @{$journey->{extra_data}{qos_msg} // []}) { + % if (@{$journey->{messages} // []} or @{$journey->{extra_data}{qos_msg} // []} or not $journey->{extra_data}{rt}) {

    + % if (not $journey->{extra_data}{rt}) { +
  • gps_off Keine Echtzeitdaten vorhanden + % } % for my $message (reverse @{$journey->{messages} // []}) { % if ($journey->{sched_departure}->epoch - $message->[0]->epoch < 1800) {
  • warning <%= $message->[0]->strftime('%H:%M') %>: <%= $message->[1] %>
  • diff --git a/templates/_public_status_card.html.ep b/templates/_public_status_card.html.ep index f031e150516e3ba5c6d114ac33d936a20dddaa8b..055e15abf3e959bc26b88a469ff3070f4b6a7bf8 100644 --- a/templates/_public_status_card.html.ep +++ b/templates/_public_status_card.html.ep @@ -2,7 +2,7 @@ % if ($journey->{checked_in}) {
    - + % if (stash('from_profile')) { Unterwegs mit <%= include '_format_train', journey => $journey %> @@ -14,6 +14,9 @@ <%= $name %> ist unterwegs % } <%= visibility_icon($journey->{effective_visibility_str}) %> + % if (not $journey->{extra_data}{rt}) { + gps_off + % } % if ($privacy->{comments_visible} and $journey->{comment}) {

    „<%= $journey->{comment} %>“