Unverified Commit 515754b9 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

passenger rights: show departures with delay ≥ 20 minutes as well

This is a quick workaround until I have finally reviewed #116
parent fbc21f45
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -121,6 +121,8 @@ sub list_candidates {
		}
	}

	my @abo_journeys
	  = grep { $_->{delay} >= 20 and $_->{delay} < 60 } @journeys;
	@journeys = grep { $_->{delay} >= 60 or $_->{connection_missed} } @journeys;

	my @cancelled = $self->journeys->get(
@@ -155,7 +157,8 @@ sub list_candidates {
		json => { json => [@journeys] },
		any  => {
			template     => 'passengerrights',
			journeys => [@journeys]
			journeys     => [@journeys],
			abo_journeys => [@abo_journeys]
		}
	);
}
+65 −4
Original line number Diff line number Diff line
@@ -2,10 +2,10 @@
<div class="row">
	<div class="col s12">
		<p>
			Gemäß der Fahrgastrechte im Eisenbahnverkehr besteht ab 60 Minuten
			Verspätung am Ziel ein Entschädigungsanspruch gegenüber dem
			Eisenbahnverkehrsunternehmen. Dieser kann mit dem
			Fahrgastrechteformular geltend gemacht werden.
			Ab 60 Minuten Verspätung am Ziel besteht in einigen Fällen ein
			Entschädigungsanspruch gegenüber dem Eisenbahnverkehrsunternehmen.
			Dieser kann mit dem Fahrgastrechteformular oder online geltend
			gemacht werden.
		</p>
		<p>
			Die folgenden Zugfahrten sind wahrscheinliche Kandidaten dafür.
@@ -73,3 +73,64 @@
		</table>
	</div>
</div>

<div class="row">
	<div class="col s12">
		<p>
			Bei Abo-Tickets besteht teilweise die Möglichkeit, bereits ab 20
			Minuten Verspätung Fahrten gesammelt zu Entschädigungszwecken
			einzureichen. Die folgenden Zugfahrten sind Kandidaten dafür.
			Fahrten mit einer Verspätung von 60 Minuten oder mehr werden hier
			nicht aufgeführt.
		</p>
	</div>
</div>

<div class="row">
	<div class="col s12">
		<table class="striped">
			<thead>
				<tr>
					<th>Datum</th>
					<th>Zug</th>
					<th>Verspätung</th>
				</tr>
			</thead>
			<tbody>
				% for my $journey (@{$abo_journeys}) {
					% my $detail_link = '/journey/' . $journey->{id};
					<tr>
						<td><%= $journey->{sched_departure}->strftime('%d.%m.%Y') %></td>
						<td><a href="<%= $detail_link %>">
							<%= $journey->{type} %> <%= $journey->{line} // $journey->{no} %>
							→ <%= $journey->{to_name} %>
							% if ($journey->{connection}) {
								% $detail_link = '/journey/' . $journey->{connection}{id};
								</a><br/><a href="<%= $detail_link %>">
								<%= $journey->{connection}{type} %> <%= $journey->{connection}{line} // $journey->{connection}{no} %>
								→ <%= $journey->{connection}{to_name} %>
							% }
						</a></td>
						<td>
							% if ($journey->{cancelled}) {
								% if ($journey->{has_substitute}) {
									Ausfall, Ersatzverbindung
									%= sprintf('%+d', $journey->{substitute_delay})
								% }
								% else {
									Ausfall ohne Ersatzverbindung
								% }
							% }
							% elsif ($journey->{connection}) {
								%= sprintf('%+d, ggf. Anschluss verpasst',  $journey->{delay})
							% }
							% else {
								%= sprintf('%+d',  $journey->{delay})
							% }
						</td>
					</tr>
				% }
			</tbody>
		</table>
	</div>
</div>