summaryrefslogtreecommitdiff
path: root/templates/journey.html.ep
diff options
context:
space:
mode:
Diffstat (limited to 'templates/journey.html.ep')
-rw-r--r--templates/journey.html.ep115
1 files changed, 84 insertions, 31 deletions
diff --git a/templates/journey.html.ep b/templates/journey.html.ep
index f5eebfc..31f9e94 100644
--- a/templates/journey.html.ep
+++ b/templates/journey.html.ep
@@ -15,29 +15,17 @@
<div class="col s12">
<p>
% if (my $name = stash('username')) {
- <b><a href="/p/<%= $name %>"><%= $name %></a></b>s
+ Checkin von <b><a href="/p/<%= $name %>"><%= $name %></a></b>
% }
- % if ($journey->{cancelled}) {
- Ausgefallene Fahrt
+ % elsif ($journey->{cancelled}) {
+ <b>Ausgefallene Fahrt</b> vom <%= $journey->{checkin}->strftime('%d.%m.%Y um %H:%M Uhr') %>
% }
% else {
- Fahrt
+ Checkin vom <%= $journey->{checkin}->strftime('%d.%m.%Y um %H:%M Uhr') %>
% }
% if ($journey->{edited} & 0x0020) {
% }
- von
- <b><%= $journey->{from_name} %></b>
- % if ($journey->{edited} & 0x0004) {
- ∗
- % }
- nach
- <b><%= $journey->{to_name} %></b>
- % if ($journey->{edited} & 0x0400) {
- ∗
- % }
- am
- <b><%= $journey->{sched_departure}->strftime('%d.%m.%Y') %></b>
% if (my $v = stash('journey_visibility')) {
% if (stash('username')) {
<i class="material-icons right"><%= visibility_icon($v) %></i>
@@ -78,19 +66,48 @@
</td>
</tr>
<tr>
+ <th scope="row">Von</th>
+ <td>
+ %= $journey->{from_name}
+ % if ($journey->{from_platform} and $journey->{to_platform}) {
+ (<%= $journey->{from_platform} %>)
+ % }
+ % if ($journey->{edited} & 0x0004) {
+ ∗
+ % }
+ </td>
+ </tr>
+ <tr>
+ <th scope="row">Nach</th>
+ <td>
+ <%= $journey->{to_name} %>
+ % if ($journey->{from_platform} and $journey->{to_platform}) {
+ (<%= $journey->{to_platform} %>)
+ % }
+ % if ($journey->{edited} & 0x0400) {
+ ∗
+ % }
+ </td>
+ </tr>
+ <tr>
<th scope="row">Abfahrt</th>
<td>
% if ($journey->{cancelled}) {
<i class="material-icons">cancel</i>
- (Plan: <%= $journey->{sched_departure}->strftime('%H:%M'); %>)
+ (Plan: <%= $journey->{sched_departure}->strftime('%d.%m.%Y %H:%M'); %>)
% }
- % elsif ($journey->{rt_departure} != $journey->{sched_departure}) {
- %= $journey->{rt_departure}->strftime('%H:%M');
- (<%= sprintf('%+d', ($journey->{rt_departure}->epoch - $journey->{sched_departure}->epoch) / 60) %>,
- Plan: <%= $journey->{sched_departure}->strftime('%H:%M'); %>)
+ % elsif ($journey->{delay_dep}) {
+ %= ($journey->{rt_departure}->epoch % 60) ? $journey->{rt_departure}->strftime('%d.%m.%Y %H:%M:%S') : $journey->{rt_departure}->strftime('%d.%m.%Y %H:%M')
+ % if (int(abs($journey->{delay_dep}) / 60)) {
+ (<%= sprintf('%+d', ($journey->{rt_departure}->epoch - $journey->{sched_departure}->epoch) / 60) %>, Plan:
+ % }
+ % else {
+ (Plan:
+ % }
+ %= ($journey->{sched_departure}->epoch % 60) ? $journey->{sched_departure}->strftime('%H:%M:%S)') : $journey->{sched_departure}->strftime('%H:%M)')
% }
% else {
- %= $journey->{sched_departure}->strftime('%H:%M');
+ %= ($journey->{sched_departure}->epoch % 60) ? $journey->{sched_departure}->strftime('%d.%m.%Y %H:%M:%S') : $journey->{sched_departure}->strftime('%d.%m.%Y %H:%M');
% }
% if ($journey->{edited} & 0x0003) {
@@ -103,19 +120,24 @@
% if ($journey->{cancelled}) {
<i class="material-icons">cancel</i>
% if ($journey->{sched_arrival}->epoch != 0) {
- (Plan: <%= $journey->{sched_arrival}->strftime('%H:%M'); %>)
+ (Plan: <%= $journey->{sched_arrival}->strftime('%d.%m.%Y %H:%M'); %>)
% }
% }
% elsif ($journey->{rt_arrival}->epoch == 0 and $journey->{sched_arrival}->epoch == 0) {
<i class="material-icons">timer_off</i>
% }
- % elsif ($journey->{rt_arrival} != $journey->{sched_arrival}) {
- %= $journey->{rt_arrival}->strftime('%H:%M');
- (<%= sprintf('%+d', ($journey->{rt_arrival}->epoch - $journey->{sched_arrival}->epoch) / 60) %>,
- Plan: <%= $journey->{sched_arrival}->strftime('%H:%M'); %>)
+ % elsif ($journey->{delay_arr}) {
+ %= ($journey->{rt_arrival}->epoch % 60) ? $journey->{rt_arrival}->strftime('%d.%m.%Y %H:%M:%S') : $journey->{rt_arrival}->strftime('%d.%m.%Y %H:%M')
+ % if (int(abs($journey->{delay_arr}) / 60)) {
+ (<%= sprintf('%+d', ($journey->{rt_arrival}->epoch - $journey->{sched_arrival}->epoch) / 60) %>, Plan:
+ % }
+ % else {
+ (Plan:
+ % }
+ %= ($journey->{sched_arrival}->epoch % 60) ? $journey->{sched_arrival}->strftime('%H:%M:%S)') : $journey->{sched_arrival}->strftime('%H:%M)')
% }
% else {
- %= $journey->{sched_arrival}->strftime('%H:%M');
+ %= ($journey->{sched_arrival}->epoch % 60) ? $journey->{sched_arrival}->strftime('%d.%m.%Y %H:%M:%S') : $journey->{sched_arrival}->strftime('%d.%m.%Y %H:%M');
% }
% if ($journey->{edited} & 0x0300) {
@@ -133,6 +155,9 @@
ca. <%= sprintf_km($journey->{km_route}) %>
(Luftlinie: <%= sprintf_km($journey->{km_beeline}) %>)
% }
+ % elsif ($journey->{km_beeline} > 0.1) {
+ (Luftlinie: <%= sprintf_km($journey->{km_beeline}) %>)
+ % }
% else {
?
% }
@@ -155,11 +180,22 @@
% }
% }
+ % elsif ($journey->{km_beeline} > 0.1 and $journey->{kmh_beeline} > 0.01) {
+ (<%= sprintf('%.f', $journey->{kmh_beeline}) %> km/h)
+ % }
% else {
?
% }
</td>
</tr>
+ % if ($journey->{user_data}{operator} or scalar @{ $journey->{user_data}{operators} // [] }) {
+ <tr>
+ <th scope="row">Betrieb</th>
+ <td>
+ %= $journey->{user_data}{operator} // join(q{, }, @{$journey->{user_data}{operators}})
+ </td>
+ </tr>
+ % }
% if ($journey->{messages} and @{$journey->{messages}}) {
<tr>
<th scope="row">Meldungen</th>
@@ -171,6 +207,16 @@
</td>
</tr>
% }
+ % if ($journey->{user_data}{him_msg} and @{$journey->{user_data}{him_msg}}) {
+ <tr>
+ <th scope="row">Meldungen</th>
+ <td>
+ % for my $message (@{$journey->{user_data}{him_msg} // []}) {
+ <i class="material-icons tiny"><%= ($message->{prio} and $message->{prio} eq 'HOCH') ? 'warning' : 'info' %></i> <%= $message->{header} %> <%= $message->{lead} %><br/>
+ % }
+ </td>
+ </tr>
+ % }
% if ($journey->{user_data} and $journey->{user_data}{comment}) {
<tr>
<th scope="row">Kommentar</th>
@@ -212,10 +258,10 @@
% my $within = 0;
% my $at_startstop = 0;
% for my $station (@{$journey->{route}}) {
- % if ($station->[0] eq $journey->{from_name}) {
+ % if (($station->[1] and $station->[1] == $journey->{from_eva}) or $station->[0] eq $journey->{from_name}) {
% $within = 1; $at_startstop = 1;
% }
- % elsif ($station->[0] eq $journey->{to_name}) {
+ % elsif (($station->[1] and $station->[1] == $journey->{to_eva}) or $station->[0] eq $journey->{to_name}) {
% $within = 0; $at_startstop = 1;
% }
% else {
@@ -248,7 +294,7 @@
% }
</span>
% }
- % if ($station->[0] eq $journey->{from_name}) {
+ % if (($station->[1] and $station->[1] == $journey->{from_eva}) or $station->[0] eq $journey->{from_name}) {
% $before = 0;
% }
<br/>
@@ -261,6 +307,13 @@
% if (stash('polyline_groups')) {
%= include '_map', station_coordinates => stash('station_coordinates'), polyline_groups => stash('polyline_groups')
% }
+ <div class="row">
+ <div class="col s12 grey-text">
+ <i class="material-icons tiny" aria-hidden="true"><%= $journey->{is_hafas} ? 'directions' : 'train' %></i>
+ %= $journey->{backend_name} || 'IRIS'
+ #<%= $journey->{id} %>
+ </div>
+ </div>
% if (not stash('readonly')) {
% if (stash('with_share')) {
<div class="row">