summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2023-02-04 21:17:45 +0100
committerDaniel Friesel <derf@finalrewind.org>2023-02-04 21:17:45 +0100
commit6b4a82da32e28f48695e284f81931888bc2950e3 (patch)
tree6d421e7080fe78fbef726ce60163e630466fffe4
parentf115283cb82c49841dec2c154089600cc19a0e07 (diff)
inconsistent journeys: link to journeys
-rw-r--r--lib/Travelynx/Command/database.pm13
-rwxr-xr-xlib/Travelynx/Model/Journeys.pm10
-rw-r--r--sass/src/common/index.scss4
-rw-r--r--templates/_history_stats.html.ep4
4 files changed, 27 insertions, 4 deletions
diff --git a/lib/Travelynx/Command/database.pm b/lib/Travelynx/Command/database.pm
index 4b83208..a42f2f5 100644
--- a/lib/Travelynx/Command/database.pm
+++ b/lib/Travelynx/Command/database.pm
@@ -1287,6 +1287,19 @@ my @migrations = (
}
);
},
+
+ # v30 -> v31
+ # travelynx v1.29.17 introduces links to conflicting journeys.
+ # These require changes to statistics data.
+ sub {
+ my ($db) = @_;
+ $db->query(
+ qq{
+ truncate journey_stats;
+ update schema_version set version = 31;
+ }
+ );
+ },
);
sub sync_stations {
diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm
index defff0b..1239266 100755
--- a/lib/Travelynx/Model/Journeys.pm
+++ b/lib/Travelynx/Model/Journeys.pm
@@ -1486,8 +1486,14 @@ sub compute_stats {
and $next_departure - $journey->{rt_arr_ts} < ( 60 * 60 ) )
{
if ( $next_departure - $journey->{rt_arr_ts} < 0 ) {
- push( @inconsistencies,
- epoch_to_dt($next_departure)->strftime('%d.%m.%Y %H:%M') );
+ push(
+ @inconsistencies,
+ [
+ epoch_to_dt($next_departure)
+ ->strftime('%d.%m.%Y %H:%M'),
+ $journey->{id}
+ ]
+ );
}
else {
$interchange_real
diff --git a/sass/src/common/index.scss b/sass/src/common/index.scss
index b66c425..b2d3187 100644
--- a/sass/src/common/index.scss
+++ b/sass/src/common/index.scss
@@ -22,6 +22,10 @@ a.unmarked {
color: $off-black;
}
+.white-text a {
+ color: #eeeeff;
+}
+
div.targetlist {
display: grid;
grid-template-columns: 1fr max-content;
diff --git a/templates/_history_stats.html.ep b/templates/_history_stats.html.ep
index 86a3c94..4d702a1 100644
--- a/templates/_history_stats.html.ep
+++ b/templates/_history_stats.html.ep
@@ -10,8 +10,8 @@
vorherigen Zugfahrt und wurden bei der Wartezeitberechnung
ignoriert.
<ul>
- % for my $date (@{$stats->{inconsistencies}}) {
- <li><%= $date %></li>
+ % for my $field (@{$stats->{inconsistencies}}) {
+ <li><a href="/journey/<%= $field->[1] %>"><%= $field->[0] %></a></li>
% }
</ul>
</p>