$render(status => ...) is a special variable. derp.
This commit is contained in:
parent
fd314e327d
commit
b992a6dc75
5 changed files with 34 additions and 34 deletions
|
@ -26,10 +26,10 @@ sub status_card {
|
||||||
delete $self->stash->{layout};
|
delete $self->stash->{layout};
|
||||||
|
|
||||||
if ( $status->{checked_in} ) {
|
if ( $status->{checked_in} ) {
|
||||||
$self->render( '_checked_in', status => $status );
|
$self->render( '_checked_in', journey => $status );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$self->render( '_checked_out', status => $status );
|
$self->render( '_checked_out', journey => $status );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,24 +2,24 @@
|
||||||
<div class="card-content white-text">
|
<div class="card-content white-text">
|
||||||
<span class="card-title">Eingecheckt</span>
|
<span class="card-title">Eingecheckt</span>
|
||||||
<p>
|
<p>
|
||||||
In <b><%= $status->{train_type} %> <%= $status->{train_no} %></b>
|
In <b><%= $journey->{train_type} %> <%= $journey->{train_no} %></b>
|
||||||
% if ($status->{arr_name}) {
|
% if ($journey->{arr_name}) {
|
||||||
von <b><%= $status->{dep_name} %></b> nach <b><%= $status->{arr_name} %></b>.
|
von <b><%= $journey->{dep_name} %></b> nach <b><%= $journey->{arr_name} %></b>.
|
||||||
% }
|
% }
|
||||||
% else {
|
% else {
|
||||||
ab <b><%= $status->{dep_name} %></b>.
|
ab <b><%= $journey->{dep_name} %></b>.
|
||||||
% }
|
% }
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<b><%= $status->{real_departure}->strftime('%H:%M') %></b>
|
<b><%= $journey->{real_departure}->strftime('%H:%M') %></b>
|
||||||
% if ($status->{real_departure}->epoch != $status->{sched_departure}->epoch) {
|
% if ($journey->{real_departure}->epoch != $journey->{sched_departure}->epoch) {
|
||||||
(<%= sprintf('%+d', ($status->{real_departure}->epoch - $status->{sched_departure}->epoch)/60) %>)
|
(<%= sprintf('%+d', ($journey->{real_departure}->epoch - $journey->{sched_departure}->epoch)/60) %>)
|
||||||
% }
|
% }
|
||||||
→
|
→
|
||||||
% if ($status->{real_arrival}->epoch) {
|
% if ($journey->{real_arrival}->epoch) {
|
||||||
<b><%= $status->{real_arrival}->strftime('%H:%M') %></b>
|
<b><%= $journey->{real_arrival}->strftime('%H:%M') %></b>
|
||||||
% if ($status->{real_arrival}->epoch != $status->{sched_arrival}->epoch) {
|
% if ($journey->{real_arrival}->epoch != $journey->{sched_arrival}->epoch) {
|
||||||
(<%= sprintf('%+d', ($status->{real_arrival}->epoch - $status->{sched_arrival}->epoch)/60) %>)
|
(<%= sprintf('%+d', ($journey->{real_arrival}->epoch - $journey->{sched_arrival}->epoch)/60) %>)
|
||||||
% }
|
% }
|
||||||
% }
|
% }
|
||||||
% else {
|
% else {
|
||||||
|
@ -28,37 +28,37 @@
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<div class="center">
|
<div class="center">
|
||||||
% if ($status->{departure_countdown} > 120) {
|
% if ($journey->{departure_countdown} > 120) {
|
||||||
Abfahrt in <%= sprintf('%.f', $status->{departure_countdown} / 60) %> Minuten
|
Abfahrt in <%= sprintf('%.f', $journey->{departure_countdown} / 60) %> Minuten
|
||||||
% }
|
% }
|
||||||
% elsif (defined $status->{arrival_countdown}) {
|
% elsif (defined $journey->{arrival_countdown}) {
|
||||||
% if ($status->{arrival_countdown} > 60) {
|
% if ($journey->{arrival_countdown} > 60) {
|
||||||
Ankunft in <%= sprintf('%.f', $status->{arrival_countdown} / 60) %>
|
Ankunft in <%= sprintf('%.f', $journey->{arrival_countdown} / 60) %>
|
||||||
Minute<%= sprintf('%.f', $status->{arrival_countdown} / 60) == 1 ? '' : 'n' %>
|
Minute<%= sprintf('%.f', $journey->{arrival_countdown} / 60) == 1 ? '' : 'n' %>
|
||||||
% }
|
% }
|
||||||
% elsif ($status->{arrival_countdown} > 0) {
|
% elsif ($journey->{arrival_countdown} > 0) {
|
||||||
Ankunft in weniger als einer Minute
|
Ankunft in weniger als einer Minute
|
||||||
% }
|
% }
|
||||||
% else {
|
% else {
|
||||||
Ziel erreicht
|
Ziel erreicht
|
||||||
% }
|
% }
|
||||||
% }
|
% }
|
||||||
% elsif ($status->{arr_name}) {
|
% elsif ($journey->{arr_name}) {
|
||||||
Ankunft in mehr als zwei Stunden
|
Ankunft in mehr als zwei Stunden
|
||||||
% }
|
% }
|
||||||
</div>
|
</div>
|
||||||
<div class="progress green darken-3" style="height: 1ex;">
|
<div class="progress green darken-3" style="height: 1ex;">
|
||||||
<div class="determinate white" style="width: <%= sprintf('%.2f', 100 * ($status->{journey_completion} // 0)); %>%;"></div>
|
<div class="determinate white" style="width: <%= sprintf('%.2f', 100 * ($journey->{journey_completion} // 0)); %>%;"></div>
|
||||||
</div>
|
</div>
|
||||||
</p>
|
</p>
|
||||||
% if (defined $status->{arrival_countdown} and $status->{arrival_countdown} <= 0) {
|
% if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} <= 0) {
|
||||||
<p>
|
<p>
|
||||||
Der automatische Checkout erfolgt in wenigen Minuten. Zum Umsteigen:
|
Der automatische Checkout erfolgt in wenigen Minuten. Zum Umsteigen:
|
||||||
Aktuelle Station in der Liste auswählen. Zum Weiterfahren: Neues
|
Aktuelle Station in der Liste auswählen. Zum Weiterfahren: Neues
|
||||||
Ziel wählen.
|
Ziel wählen.
|
||||||
</p>
|
</p>
|
||||||
% }
|
% }
|
||||||
% if ($status->{arr_name}) {
|
% if ($journey->{arr_name}) {
|
||||||
<p>Ziel ändern?</p>
|
<p>Ziel ändern?</p>
|
||||||
% }
|
% }
|
||||||
% else {
|
% else {
|
||||||
|
@ -67,8 +67,8 @@
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
% my $is_after = 0;
|
% my $is_after = 0;
|
||||||
% for my $station (@{$status->{route_after}}) {
|
% for my $station (@{$journey->{route_after}}) {
|
||||||
% if ($status->{arr_name} and $station eq $status->{arr_name}) {
|
% if ($journey->{arr_name} and $station eq $journey->{arr_name}) {
|
||||||
<tr><td><b><a class="action-checkout" data-station="<%= $station %>"><%= $station %></a></b></td></tr>
|
<tr><td><b><a class="action-checkout" data-station="<%= $station %>"><%= $station %></a></b></td></tr>
|
||||||
% }
|
% }
|
||||||
% else {
|
% else {
|
||||||
|
@ -77,12 +77,12 @@
|
||||||
% }
|
% }
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
% if ($status->{arr_name}) {
|
% if ($journey->{arr_name}) {
|
||||||
<p>
|
<p>
|
||||||
Falls das Backend ausgefallen ist oder der Zug aus anderen
|
Falls das Backend ausgefallen ist oder der Zug aus anderen
|
||||||
Gründen verloren ging: <a class="action-checkout"
|
Gründen verloren ging: <a class="action-checkout"
|
||||||
data-force="1" data-station="<%= $status->{arr_name}
|
data-force="1" data-station="<%= $journey->{arr_name}
|
||||||
%>">Ohne Echtzeitdaten in <%= $status->{arr_name} %>
|
%>">Ohne Echtzeitdaten in <%= $journey->{arr_name} %>
|
||||||
auschecken</a>.
|
auschecken</a>.
|
||||||
</p>
|
</p>
|
||||||
% }
|
% }
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<div class="card grey darken-4">
|
<div class="card grey darken-4">
|
||||||
<div class="card-content white-text">
|
<div class="card-content white-text">
|
||||||
<span class="card-title">Ausgecheckt</span>
|
<span class="card-title">Ausgecheckt</span>
|
||||||
<p>Aus <%= $status->{train_type} %> <%= $status->{train_no} %>
|
<p>Aus <%= $journey->{train_type} %> <%= $journey->{train_no} %>
|
||||||
bis <a href="/s/<%= $status->{arr_ds100} %>"><%= $status->{arr_name} %></a></p>
|
bis <a href="/s/<%= $journey->{arr_ds100} %>"><%= $journey->{arr_name} %></a></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-action">
|
<div class="card-action">
|
||||||
<a class="action-undo" data-id="<%= $status->{journey_id} %>">
|
<a class="action-undo" data-id="<%= $journey->{journey_id} %>">
|
||||||
<i class="material-icons">undo</i> Rückgängig?
|
<i class="material-icons">undo</i> Rückgängig?
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
</div>
|
</div>
|
||||||
% }
|
% }
|
||||||
% elsif ($status->{timestamp_delta} < 180) {
|
% elsif ($status->{timestamp_delta} < 180) {
|
||||||
%= include '_checked_out', status => $status;
|
%= include '_checked_out', journey => $status;
|
||||||
% }
|
% }
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<div class="col s12 statuscol">
|
<div class="col s12 statuscol">
|
||||||
% my $status = get_user_status();
|
% my $status = get_user_status();
|
||||||
% if ($status->{checked_in}) {
|
% if ($status->{checked_in}) {
|
||||||
%= include '_checked_in', status => $status;
|
%= include '_checked_in', journey => $status;
|
||||||
% }
|
% }
|
||||||
% elsif ($status->{cancelled}) {
|
% elsif ($status->{cancelled}) {
|
||||||
<div class="card yellow lighten-4">
|
<div class="card yellow lighten-4">
|
||||||
|
|
Loading…
Reference in a new issue