2019-03-17 17:34:33 +00:00
|
|
|
|
% if ($error) {
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col s12">
|
2019-05-16 14:10:53 +00:00
|
|
|
|
<div class="card caution-color">
|
2019-03-17 17:34:33 +00:00
|
|
|
|
<div class="card-content white-text">
|
|
|
|
|
<span class="card-title">Fehler</span>
|
2019-04-07 17:19:50 +00:00
|
|
|
|
<p>Zugfahrt nicht gefunden.</p>
|
2019-03-17 17:34:33 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col s12">
|
|
|
|
|
<p>
|
2019-03-19 20:23:06 +00:00
|
|
|
|
% if ($journey->{cancelled}) {
|
2019-12-08 18:46:45 +00:00
|
|
|
|
Ausgefallene Fahrt
|
2019-03-19 20:23:06 +00:00
|
|
|
|
% }
|
|
|
|
|
% else {
|
2019-12-08 18:46:45 +00:00
|
|
|
|
Fahrt
|
2019-03-19 20:23:06 +00:00
|
|
|
|
% }
|
2019-12-08 18:46:45 +00:00
|
|
|
|
% if ($journey->{edited} & 0x0020) {
|
|
|
|
|
∗
|
|
|
|
|
% }
|
|
|
|
|
von
|
2019-03-17 17:34:33 +00:00
|
|
|
|
<b><%= $journey->{from_name} %></b>
|
2020-02-01 15:15:20 +00:00
|
|
|
|
% if ($journey->{edited} & 0x0004) {
|
|
|
|
|
∗
|
|
|
|
|
% }
|
2019-03-17 17:34:33 +00:00
|
|
|
|
nach
|
|
|
|
|
<b><%= $journey->{to_name} %></b>
|
2020-02-01 15:15:20 +00:00
|
|
|
|
% if ($journey->{edited} & 0x0400) {
|
|
|
|
|
∗
|
|
|
|
|
% }
|
2019-03-17 17:34:33 +00:00
|
|
|
|
am
|
|
|
|
|
<b><%= $journey->{sched_departure}->strftime('%d.%m.%Y') %></b>
|
|
|
|
|
</p>
|
2019-04-08 19:20:04 +00:00
|
|
|
|
% if ($journey->{edited}) {
|
2019-04-09 16:37:21 +00:00
|
|
|
|
<p>
|
|
|
|
|
∗ Daten wurden manuell eingetragen
|
|
|
|
|
</p>
|
2019-04-08 19:20:04 +00:00
|
|
|
|
% }
|
2019-09-12 16:07:21 +00:00
|
|
|
|
% if ($journey->{cancelled} or ($journey->{rt_arrival} and ($journey->{rt_arrival}->epoch - $journey->{sched_arrival}->epoch) >= 3600)) {
|
|
|
|
|
<div style="text-align: center; margin-bottom: 1em;">
|
2019-09-12 16:23:23 +00:00
|
|
|
|
% my $form_target = sprintf('/journey/passenger_rights/FGR %s %s %s.pdf', $journey->{sched_departure}->ymd, $journey->{type}, $journey->{no});
|
|
|
|
|
%= form_for $form_target => (method => 'POST') => begin
|
2019-09-12 16:07:21 +00:00
|
|
|
|
%= csrf_field
|
|
|
|
|
%= hidden_field id => $journey->{id}
|
|
|
|
|
<button class="btn waves-effect waves-light grey darken-3" type="submit" name="action" value="generate">
|
|
|
|
|
<i class="material-icons left">file_download</i>
|
|
|
|
|
Fahrgastrechte
|
|
|
|
|
</button>
|
|
|
|
|
%= end
|
|
|
|
|
</div>
|
|
|
|
|
% }
|
2019-03-17 17:34:33 +00:00
|
|
|
|
<table class="striped">
|
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Zug</th>
|
|
|
|
|
<td>
|
|
|
|
|
<%= $journey->{type} %> <%= $journey->{no} %>
|
|
|
|
|
% if ($journey->{line}) {
|
2019-03-20 17:20:23 +00:00
|
|
|
|
(Linie <%= $journey->{line} %>)
|
2019-03-17 17:34:33 +00:00
|
|
|
|
% }
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Abfahrt</th>
|
|
|
|
|
<td>
|
2019-03-19 20:23:06 +00:00
|
|
|
|
% if ($journey->{cancelled}) {
|
|
|
|
|
<i class="material-icons">cancel</i>
|
|
|
|
|
(Plan: <%= $journey->{sched_departure}->strftime('%H:%M'); %>)
|
|
|
|
|
% }
|
|
|
|
|
% elsif ($journey->{rt_departure} != $journey->{sched_departure}) {
|
2019-03-17 17:34:33 +00:00
|
|
|
|
%= $journey->{rt_departure}->strftime('%H:%M');
|
2019-03-20 16:50:14 +00:00
|
|
|
|
(<%= sprintf('%+d', ($journey->{rt_departure}->epoch - $journey->{sched_departure}->epoch) / 60) %>,
|
2019-03-17 17:34:33 +00:00
|
|
|
|
Plan: <%= $journey->{sched_departure}->strftime('%H:%M'); %>)
|
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
%= $journey->{sched_departure}->strftime('%H:%M');
|
|
|
|
|
% }
|
2019-04-09 16:37:21 +00:00
|
|
|
|
% if ($journey->{edited} & 0x0003) {
|
|
|
|
|
∗
|
|
|
|
|
% }
|
2019-03-17 17:34:33 +00:00
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Ankunft</th>
|
|
|
|
|
<td>
|
2019-03-19 20:23:06 +00:00
|
|
|
|
% if ($journey->{cancelled}) {
|
|
|
|
|
<i class="material-icons">cancel</i>
|
|
|
|
|
% if ($journey->{sched_arrival}->epoch != 0) {
|
|
|
|
|
(Plan: <%= $journey->{sched_arrival}->strftime('%H:%M'); %>)
|
|
|
|
|
% }
|
|
|
|
|
% }
|
|
|
|
|
% elsif ($journey->{rt_arrival}->epoch == 0 and $journey->{sched_arrival}->epoch == 0) {
|
2019-03-17 17:34:33 +00:00
|
|
|
|
<i class="material-icons">timer_off</i>
|
|
|
|
|
% }
|
|
|
|
|
% elsif ($journey->{rt_arrival} != $journey->{sched_arrival}) {
|
|
|
|
|
%= $journey->{rt_arrival}->strftime('%H:%M');
|
2019-03-20 16:50:14 +00:00
|
|
|
|
(<%= sprintf('%+d', ($journey->{rt_arrival}->epoch - $journey->{sched_arrival}->epoch) / 60) %>,
|
2019-03-17 17:34:33 +00:00
|
|
|
|
Plan: <%= $journey->{sched_arrival}->strftime('%H:%M'); %>)
|
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
%= $journey->{sched_arrival}->strftime('%H:%M');
|
|
|
|
|
% }
|
2019-04-09 16:37:21 +00:00
|
|
|
|
% if ($journey->{edited} & 0x0300) {
|
|
|
|
|
∗
|
|
|
|
|
% }
|
2019-03-17 17:34:33 +00:00
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2019-03-20 17:20:23 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Entfernung</th>
|
|
|
|
|
<td>
|
2019-04-21 13:46:19 +00:00
|
|
|
|
% if ($journey->{skip_route}) {
|
2019-04-21 15:25:22 +00:00
|
|
|
|
<i class="material-icons right">location_off</i>
|
2019-04-21 13:46:19 +00:00
|
|
|
|
<%= numify_skipped_stations($journey->{skip_route}) %><br/>
|
|
|
|
|
% }
|
2019-03-20 17:33:51 +00:00
|
|
|
|
% if ($journey->{km_route} > 0.1) {
|
|
|
|
|
ca. <%= sprintf('%.f', $journey->{km_route}) %> km
|
2019-04-21 13:46:19 +00:00
|
|
|
|
(Luftlinie: <%= sprintf('%.f', $journey->{km_beeline}) %> km)
|
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
?
|
2019-03-20 17:20:23 +00:00
|
|
|
|
% }
|
2019-11-19 18:46:21 +00:00
|
|
|
|
% if ($journey->{edited} & 0x0010) {
|
|
|
|
|
∗
|
|
|
|
|
% }
|
2019-03-20 17:33:51 +00:00
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Geschwindigkeit</th>
|
|
|
|
|
<td>
|
2019-04-21 13:46:19 +00:00
|
|
|
|
% if ($journey->{skip_route}) {
|
2019-04-21 15:25:22 +00:00
|
|
|
|
<i class="material-icons right">location_off</i>
|
2019-04-21 13:46:19 +00:00
|
|
|
|
<%= numify_skipped_stations($journey->{skip_route}) %><br/>
|
|
|
|
|
% }
|
|
|
|
|
% if ($journey->{km_route} > 0.1 and $journey->{kmh_route} > 0.01) {
|
|
|
|
|
∅ <%= sprintf('%.f', $journey->{kmh_route}) %> km/h
|
|
|
|
|
(<%= sprintf('%.f', $journey->{kmh_beeline}) %> km/h)
|
|
|
|
|
% if ($journey->{edited} & 0x0303) {
|
|
|
|
|
∗
|
|
|
|
|
% }
|
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
?
|
2019-04-09 16:37:21 +00:00
|
|
|
|
% }
|
2019-03-20 17:20:23 +00:00
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2019-08-23 10:02:22 +00:00
|
|
|
|
% if ($journey->{messages} and @{$journey->{messages}}) {
|
2019-04-26 17:53:01 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Meldungen</th>
|
|
|
|
|
<td>
|
|
|
|
|
% for my $message (@{$journey->{messages} // []}) {
|
|
|
|
|
% my ($ts, $msg) = @{$message};
|
|
|
|
|
<%= $ts->strftime('%d.%m.%Y %H:%M') %> : <%= $msg %><br/>
|
|
|
|
|
% }
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
% }
|
2019-08-23 10:02:22 +00:00
|
|
|
|
% if ($journey->{user_data} and $journey->{user_data}{comment}) {
|
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Kommentar</th>
|
|
|
|
|
<td>
|
|
|
|
|
<%= $journey->{user_data}{comment} %>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
% }
|
2019-03-17 17:34:33 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Route</th>
|
|
|
|
|
<td>
|
|
|
|
|
% my $within = 0;
|
|
|
|
|
% my $at_startstop = 0;
|
|
|
|
|
% for my $station (@{$journey->{route}}) {
|
2019-05-26 15:28:21 +00:00
|
|
|
|
% if ($station->[0] eq $journey->{from_name}) {
|
2019-03-17 17:34:33 +00:00
|
|
|
|
% $within = 1; $at_startstop = 1;
|
|
|
|
|
% }
|
2019-05-26 15:28:21 +00:00
|
|
|
|
% elsif ($station->[0] eq $journey->{to_name}) {
|
2019-03-17 17:34:33 +00:00
|
|
|
|
% $within = 0; $at_startstop = 1;
|
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
% $at_startstop = 0;
|
|
|
|
|
% }
|
|
|
|
|
% if ($at_startstop or $within) {
|
2019-05-26 15:28:21 +00:00
|
|
|
|
<%= $station->[0] %>
|
2019-03-17 17:34:33 +00:00
|
|
|
|
% }
|
|
|
|
|
% else {
|
2019-12-14 05:47:21 +00:00
|
|
|
|
<span style="color: #808080;"><%= $station->[0] %></span>
|
2019-03-17 17:34:33 +00:00
|
|
|
|
% }
|
2019-11-19 18:46:21 +00:00
|
|
|
|
% if ($journey->{edited} & 0x0010) {
|
|
|
|
|
∗
|
|
|
|
|
% }
|
2019-03-17 17:34:33 +00:00
|
|
|
|
<br/>
|
|
|
|
|
% }
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2019-12-19 19:16:10 +00:00
|
|
|
|
% if ($journey->{user_data} and $journey->{user_data}{wagongroups} and not exists $journey->{user_data}{wagons}) {
|
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Rollmaterial</th>
|
|
|
|
|
<td class="wagons">
|
2019-12-19 19:25:38 +00:00
|
|
|
|
%= include '_wagons', wagongroups => $journey->{user_data}{wagongroups};
|
2019-12-19 19:16:10 +00:00
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
% }
|
|
|
|
|
% elsif ($journey->{user_data} and $journey->{user_data}{wagons}) {
|
2019-12-13 16:59:12 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Rollmaterial</th>
|
2019-12-14 05:47:21 +00:00
|
|
|
|
<td class="wagons">
|
2019-12-13 16:59:12 +00:00
|
|
|
|
% for my $wagongroup (@{$journey->{user_data}{wagongroups} // []}) {
|
2019-12-14 05:47:21 +00:00
|
|
|
|
Wagenverbund <%= $wagongroup %><br/>
|
2019-12-13 16:59:12 +00:00
|
|
|
|
% }
|
|
|
|
|
% for my $wagon (@{$journey->{user_data}{wagons}}) {
|
2019-12-14 05:47:21 +00:00
|
|
|
|
<span><%= substr($wagon->{id}, 0, 2) %></span><span><%= substr($wagon->{id}, 2, 2) %></span><span><%= substr($wagon->{id}, 4, 1) %></span><span class="wagonclass"><%= substr($wagon->{id}, 5, 3) %></span><span class="wagonnum"><%= substr($wagon->{id}, 8, 3) %></span><span class="checksum"><%= substr($wagon->{id}, 11) %></span>
|
2019-12-13 16:59:12 +00:00
|
|
|
|
%= $wagon->{type}
|
|
|
|
|
% if ($wagon->{number}) {
|
|
|
|
|
– Wagen <%= $wagon->{number} %>
|
|
|
|
|
% }
|
|
|
|
|
<br/>
|
|
|
|
|
% }
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
% }
|
2019-03-17 17:34:33 +00:00
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-05-03 19:39:50 +00:00
|
|
|
|
<div class="row hide-on-small-only">
|
|
|
|
|
<div class="col s12 m6 l6 center-align">
|
2019-04-04 16:26:53 +00:00
|
|
|
|
<a class="waves-effect waves-light red btn action-delete"
|
2019-04-23 16:08:07 +00:00
|
|
|
|
data-id="<%= $journey->{id} %>"
|
2019-04-04 16:26:53 +00:00
|
|
|
|
data-checkin="<%= $journey->{checkin}->epoch %>"
|
|
|
|
|
data-checkout="<%= $journey->{checkout}->epoch %>">
|
|
|
|
|
<i class="material-icons left">delete_forever</i>
|
|
|
|
|
Löschen
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
2019-05-03 19:39:50 +00:00
|
|
|
|
<div class="col s12 m6 l6 center-align">
|
|
|
|
|
%= form_for '/journey/edit' => (method => 'POST') => begin
|
|
|
|
|
%= hidden_field 'journey_id' => param('journey_id')
|
|
|
|
|
<button class="btn waves-effect waves-light" type="submit" name="action" value="edit">
|
2020-01-28 19:26:15 +00:00
|
|
|
|
<i class="material-icons left" aria-hidden="true">edit</i>
|
2019-05-03 19:39:50 +00:00
|
|
|
|
Bearbeiten
|
|
|
|
|
</button>
|
|
|
|
|
%= end
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row hide-on-med-and-up">
|
|
|
|
|
<div class="col s12 m6 l6 center-align">
|
2019-04-07 18:20:37 +00:00
|
|
|
|
%= form_for '/journey/edit' => (method => 'POST') => begin
|
|
|
|
|
%= hidden_field 'journey_id' => param('journey_id')
|
2019-04-08 19:20:04 +00:00
|
|
|
|
<button class="btn waves-effect waves-light" type="submit" name="action" value="edit">
|
2020-01-28 19:26:15 +00:00
|
|
|
|
<i class="material-icons left" aria-hidden="true">edit</i>
|
2019-04-07 18:20:37 +00:00
|
|
|
|
Bearbeiten
|
|
|
|
|
</button>
|
|
|
|
|
%= end
|
2019-04-04 16:26:53 +00:00
|
|
|
|
</div>
|
2019-05-03 19:39:50 +00:00
|
|
|
|
<div class="col s12 m6 l6 center-align" style="margin-top: 1em;">
|
|
|
|
|
<a class="waves-effect waves-light red btn action-delete"
|
|
|
|
|
data-id="<%= $journey->{id} %>"
|
|
|
|
|
data-checkin="<%= $journey->{checkin}->epoch %>"
|
|
|
|
|
data-checkout="<%= $journey->{checkout}->epoch %>">
|
2020-01-28 19:26:15 +00:00
|
|
|
|
<i class="material-icons left" aria-hidden="true">delete_forever</i>
|
2019-05-03 19:39:50 +00:00
|
|
|
|
Löschen
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
2019-04-04 16:26:53 +00:00
|
|
|
|
</div>
|
2019-03-17 17:34:33 +00:00
|
|
|
|
% }
|