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.ep67
1 files changed, 59 insertions, 8 deletions
diff --git a/templates/journey.html.ep b/templates/journey.html.ep
index a5e04a0..f5eebfc 100644
--- a/templates/journey.html.ep
+++ b/templates/journey.html.ep
@@ -4,7 +4,7 @@
<div class="card caution-color">
<div class="card-content white-text">
<span class="card-title">Fehler</span>
- <p>Zugfahrt nicht gefunden.</p>
+ <p>Fahrt nicht gefunden.</p>
</div>
</div>
</div>
@@ -38,13 +38,23 @@
% }
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>
+ % }
+ % else {
+ <a class="right" href="/journey/visibility?id=<%= $journey->{id} %>">
+ <i class="material-icons"><%= visibility_icon($v) %></i>
+ </a>
+ % }
+ % }
</p>
% if ($journey->{edited}) {
<p>
∗ Daten wurden manuell eingetragen
</p>
% }
- % if ($journey->{cancelled} or ($journey->{rt_arrival} and ($journey->{rt_arrival}->epoch - $journey->{sched_arrival}->epoch) >= 3600)) {
+ % if (not stash('readonly') and ($journey->{cancelled} or ($journey->{rt_arrival} and ($journey->{rt_arrival}->epoch - $journey->{sched_arrival}->epoch) >= 3600))) {
<div style="text-align: center; margin-bottom: 1em;">
% 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
@@ -59,7 +69,7 @@
% }
<table class="striped">
<tr>
- <th scope="row">Zug</th>
+ <th scope="row">Fahrt</th>
<td>
<%= $journey->{type} %> <%= $journey->{no} %>
% if ($journey->{line}) {
@@ -113,15 +123,15 @@
</td>
</tr>
<tr>
- <th scope="row">Entfernung</th>
+ <th scope="row">Strecke</th>
<td>
% if ($journey->{skip_route}) {
<i class="material-icons right">location_off</i>
<%= numify_skipped_stations($journey->{skip_route}) %><br/>
% }
% if ($journey->{km_route} > 0.1) {
- ca. <%= sprintf('%.f', $journey->{km_route}) %> km
- (Luftlinie: <%= sprintf('%.f', $journey->{km_beeline}) %> km)
+ ca. <%= sprintf_km($journey->{km_route}) %>
+ (Luftlinie: <%= sprintf_km($journey->{km_beeline}) %>)
% }
% else {
?
@@ -132,7 +142,7 @@
</td>
</tr>
<tr>
- <th scope="row">Geschwindigkeit</th>
+ <th scope="row">Tempo</th>
<td>
% if ($journey->{skip_route}) {
<i class="material-icons right">location_off</i>
@@ -198,6 +208,7 @@
<tr>
<th scope="row">Route</th>
<td>
+ % my $before = 1;
% my $within = 0;
% my $at_startstop = 0;
% for my $station (@{$journey->{route}}) {
@@ -210,8 +221,16 @@
% else {
% $at_startstop = 0;
% }
+ <span style="color: #808080;">
+ % if ($before and $station->[2]{sched_dep}) {
+ %= $station->[2]{sched_dep}->strftime('%H:%M')
+ % }
+ % elsif (not $before and $station->[2]{sched_arr}) {
+ %= $station->[2]{sched_arr}->strftime('%H:%M')
+ % }
+ </span>
% if ($at_startstop or $within) {
- <%= $station->[0] %>
+ %= $station->[0]
% }
% else {
<span style="color: #808080;"><%= $station->[0] %></span>
@@ -219,6 +238,19 @@
% if ($journey->{edited} & 0x0010) {
% }
+ % if ($within or $at_startstop) {
+ <span style="color: #808080;">
+ % if ($before and $station->[2]{rt_dep} and $station->[2]{dep_delay}) {
+ %= sprintf('%+d', $station->[2]{dep_delay})
+ % }
+ % elsif (not $before and $station->[2]{rt_arr} and $station->[2]{arr_delay}) {
+ %= sprintf('%+d', $station->[2]{arr_delay})
+ % }
+ </span>
+ % }
+ % if ($station->[0] eq $journey->{from_name}) {
+ % $before = 0;
+ % }
<br/>
% }
</td>
@@ -230,6 +262,25 @@
%= include '_map', station_coordinates => stash('station_coordinates'), polyline_groups => stash('polyline_groups')
% }
% if (not stash('readonly')) {
+ % if (stash('with_share')) {
+ <div class="row">
+ <div class="col s12 m6 l6">
+ </div>
+ <div class="col s12 m6 l6 center-align">
+ <a class="btn waves-effect waves-light action-share"
+ % if (stash('journey_visibility') eq 'public') {
+ data-url="<%= url_for('public_journey', name => current_user()->{name}, id => $journey->{id} )->to_abs->scheme('https'); %>"
+ % }
+ % else {
+ data-url="<%= url_for('public_journey', name => current_user()->{name}, id => $journey->{id} )->to_abs->scheme('https'); %>?token=<%= $journey->{from_eva} %>-<%= $journey->{checkin_ts} % 337 %>-<%= $journey->{sched_dep_ts} %>"
+ % }
+ data-text="<%= stash('share_text') %>"
+ >
+ <i class="material-icons left" aria-hidden="true">share</i> Teilen
+ </a>
+ </div>
+ </div>
+ % }
<div class="row hide-on-small-only">
<div class="col s12 m6 l6 center-align">
<a class="waves-effect waves-light red btn action-delete"