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

Journey: show dep/arr stop in table; include platforms if available

Also: show checkin timestamp
parent b4879a8a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -571,7 +571,7 @@ sub get {

	my @select
	  = (
		qw(journey_id is_dbris is_iris is_hafas is_motis backend_name backend_id train_type train_line train_no checkin_ts sched_dep_ts real_dep_ts dep_eva dep_ds100 dep_name dep_lat dep_lon checkout_ts sched_arr_ts real_arr_ts arr_eva arr_ds100 arr_name arr_lat arr_lon cancelled edited route messages user_data visibility effective_visibility)
		qw(journey_id is_dbris is_iris is_hafas is_motis backend_name backend_id train_type train_line train_no checkin_ts sched_dep_ts real_dep_ts dep_eva dep_ds100 dep_name dep_platform dep_lat dep_lon checkout_ts sched_arr_ts real_arr_ts arr_eva arr_ds100 arr_name arr_platform arr_lat arr_lon cancelled edited route messages user_data visibility effective_visibility)
	  );
	my %where = (
		user_id   => $uid,
@@ -641,6 +641,7 @@ sub get {
			from_eva             => $entry->{dep_eva},
			from_ds100           => $entry->{dep_ds100},
			from_name            => $entry->{dep_name},
			from_platform        => $entry->{dep_platform},
			from_latlon          => [ $entry->{dep_lat}, $entry->{dep_lon} ],
			checkin_ts           => $entry->{checkin_ts},
			sched_dep_ts         => $entry->{sched_dep_ts},
@@ -648,6 +649,7 @@ sub get {
			to_eva               => $entry->{arr_eva},
			to_ds100             => $entry->{arr_ds100},
			to_name              => $entry->{arr_name},
			to_platform          => $entry->{arr_platform},
			to_latlon            => [ $entry->{arr_lat}, $entry->{arr_lon} ],
			checkout_ts          => $entry->{checkout_ts},
			sched_arr_ts         => $entry->{sched_arr_ts},
+34 −22
Original line number Diff line number Diff line
@@ -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>
@@ -77,20 +65,44 @@
						% }
					</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}->epoch % 60) ? $journey->{rt_departure}->strftime('%H:%M:%S') : $journey->{rt_departure}->strftime('%H:%M');
							%= ($journey->{rt_departure}->epoch % 60) ? $journey->{rt_departure}->strftime('%d.%m.%Y %H:%M:%S') : $journey->{rt_departure}->strftime('%d.%m.%Y %H:%M');
							(<%= sprintf('%+d', ($journey->{rt_departure}->epoch - $journey->{sched_departure}->epoch) / 60) %>,
							Plan: <%= ($journey->{sched_departure}->epoch % 60) ? $journey->{sched_departure}->strftime('%H:%M:%S') : $journey->{sched_departure}->strftime('%H:%M'); %>)
						% }
						% else {
							%= ($journey->{sched_departure}->epoch % 60) ? $journey->{sched_departure}->strftime('%H:%M:%S') : $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 +115,19 @@
						% 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}->epoch % 60) ? $journey->{rt_arrival}->strftime('%H:%M:%S') : $journey->{rt_arrival}->strftime('%H:%M');
							%= ($journey->{rt_arrival}->epoch % 60) ? $journey->{rt_arrival}->strftime('%d.%m.%Y %H:%M:%S') : $journey->{rt_arrival}->strftime('%d.%m.%Y %H:%M');
							(<%= sprintf('%+d', ($journey->{rt_arrival}->epoch - $journey->{sched_arrival}->epoch) / 60) %>,
							Plan: <%= ($journey->{sched_arrival}->epoch % 60) ? $journey->{sched_arrival}->strftime('%H:%M:%S') : $journey->{sched_arrival}->strftime('%H:%M'); %>)
						% }
						% else {
							%= ($journey->{sched_arrival}->epoch % 60) ? $journey->{sched_arrival}->strftime('%H:%M:%S') : $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) {