diff options
| author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-12-26 20:44:04 +0100 |
|---|---|---|
| committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-12-26 20:44:04 +0100 |
| commit | 43c191fc9435a11f4349be86fe6844354f5bbca0 (patch) | |
| tree | f98259f8a5f8c1d6199cd535d7b8eed11d4a0679 /templates | |
| parent | cb8d90be7e405d251dbb7f615701b69f4674e1ec (diff) | |
remove old (blocking) connection code; only show departure baord connections2.17.40
Background worker-based information about connecting departures while still
checked in will come eventually, but won't recycle the existing code either
way.
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/_cancelled_departure.html.ep | 4 | ||||
| -rw-r--r-- | templates/_checked_in.html.ep | 12 | ||||
| -rw-r--r-- | templates/_checked_out.html.ep | 10 | ||||
| -rw-r--r-- | templates/_connections.html.ep | 76 | ||||
| -rw-r--r-- | templates/_connections_hafas.html.ep | 57 | ||||
| -rw-r--r-- | templates/_suggestions_iris.html.ep | 44 | ||||
| -rw-r--r-- | templates/departures.html.ep | 19 |
7 files changed, 51 insertions, 171 deletions
diff --git a/templates/_cancelled_departure.html.ep b/templates/_cancelled_departure.html.ep index db6cc5c..d47385a 100644 --- a/templates/_cancelled_departure.html.ep +++ b/templates/_cancelled_departure.html.ep @@ -5,9 +5,5 @@ in <a href="/s/<%= $journey->{dep_eva} %>"><%= $journey->{dep_name} %></a> entfällt. Der Ausfall der Fahrt nach <%= $journey->{arr_name} %> wurde bereits dokumentiert. </p> - % if (my @connections = @{stash('connections_iris') // []}) { - <p>Alternative Reisemöglichkeiten:</p> - %= include '_connections', connections => \@connections, checkin_from => $journey->{dep_eva}; - % } </div> </div> diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep index 69754e3..f057a0a 100644 --- a/templates/_checked_in.html.ep +++ b/templates/_checked_in.html.ep @@ -221,18 +221,6 @@ </ul> </p> % } - % if (@{stash('connections_iris') // [] } or @{stash('connections_hafas') // []}) { - <span class="card-title" style="margin-top: 2ex;">Verbindungen</span> - % if ($journey->{arrival_countdown} < 0) { - <p>Fahrt auswählen zum Einchecken mit Zielwahl.</p> - % } - % if (@{stash('connections_iris') // [] }) { - %= include '_connections', connections => stash('connections_iris'), checkin_from => $journey->{arrival_countdown} < 0 ? $journey->{arr_eva} : undef; - % } - % if (@{stash('connections_hafas') // [] }) { - %= include '_connections_hafas', connections => stash('connections_hafas'), checkin_from => $journey->{arrival_countdown} < 0 ? $journey->{arr_eva} : undef; - % } - % } % if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} <= 0) { <p style="margin-top: 2ex;"> %= L('status.delayed-auto-checkout') diff --git a/templates/_checked_out.html.ep b/templates/_checked_out.html.ep index 21db335..fcac6f8 100644 --- a/templates/_checked_out.html.ep +++ b/templates/_checked_out.html.ep @@ -4,16 +4,6 @@ <p>Aus %= include '_format_train', journey => $journey bis <a href="/s/<%= $journey->{arr_eva} %>?hafas=<%= $journey->{is_hafas} ? $journey->{backend_name} : q{} %>"><%= $journey->{arr_name} %></a></p> - % if (@{stash('connections_iris') // [] } or @{stash('connections_hafas') // []}) { - <span class="card-title" style="margin-top: 2ex;">Verbindungen</span> - <p>Fahrt auswählen zum Einchecken mit Zielwahl.</p> - % if (@{stash('connections_iris') // [] }) { - %= include '_connections', connections => stash('connections_iris'), checkin_from => $journey->{arr_eva}; - % } - % if (@{stash('connections_hafas') // [] }) { - %= include '_connections_hafas', connections => stash('connections_hafas'), checkin_from => $journey->{arr_eva}; - % } - % } </div> <div class="card-action"> <a class="action-undo" data-id="<%= $journey->{journey_id} %>"> diff --git a/templates/_connections.html.ep b/templates/_connections.html.ep deleted file mode 100644 index 1dd2718..0000000 --- a/templates/_connections.html.ep +++ /dev/null @@ -1,76 +0,0 @@ -<ul class="collection departures connections"> - % for my $res (@{$connections}) { - % my ($train, $via, $via_arr, $load) = @{$res}; - % $via_arr = $via_arr ? $via_arr->strftime('%H:%M') : q{}; - % my $row_class = ''; - % my $link_class = 'action-checkin'; - % if ($train->is_cancelled) { - % $row_class = 'cancelled'; - % $link_class = 'action-cancelled-from'; - % } - % if ($checkin_from) { - <li class="collection-item <%= $row_class %> <%= $link_class %>" - data-station="<%= $train->station_uic %>" - data-train="<%= $train->train_id %>" - data-ts="<%= ($train->sched_departure // $train->departure)->epoch %>" - data-dest="<%= $via->{name} %>"> - % } - % else { - <li class="collection-item <%= $row_class %>"> - % } - <a class="dep-time" href="#"> - % if ($train->departure_is_cancelled) { - %= $train->sched_departure->strftime('%H:%M') - % } - % else { - %= $train->departure->strftime('%H:%M') - % } - % if ($via_arr) { - → <%= $via_arr %> - % } - % if ($train->departure_delay) { - %= sprintf('(%+d)', $train->departure_delay) - % } - </a> - <span class="connect-platform-wrapper"> - % if ($train->platform) { - <span>Gleis <%= $train->platform %></span> - % } - <span class="dep-line <%= $train->type // q{} %>"> - %= $train->line - </span> - </span> - <span class="dep-dest"> - % if ($train->is_cancelled) { - Fahrt nach <%= $via->{name} %> entfällt - % } - % else { - %= $via->{name} - % } - <br/> - % if ($load) { - % my ($first, $second) = load_icon($load); - <i class="material-icons tiny" aria-hidden="true"><%= $first %></i> <i class="material-icons tiny" aria-hidden="true"><%= $second %></i> - % } - % if ($train->{interchange_icon}) { - <i class="material-icons tiny" aria-label="<%= $train->{interchange_text} %>"><%= $train->{interchange_icon} %></i> - % } - % if ($train->{message_id}{96} or $train->{message_id}{97}) { - <i class="material-icons tiny" aria-label="Zug ist überbesetzt">warning</i> - % } - % if ($train->{message_id}{82} or $train->{message_id}{85}) { - <i class="material-icons tiny" aria-label="Fehlende Wagen">remove</i> - % } - % if (($train->{message_id}{73} or $train->{message_id}{74} or $train->{message_id}{75} or $train->{message_id}{76} or $train->{message_id}{80}) and not $train->{message_id}{84}) { - <i class="material-icons tiny" aria-label="Abweichende Wagenreihung">compare_arrows</i> - % } - % if ($train->{message_id}{83} or $train->{message_id}{93} or $train->{message_id}{95}) { - <i class="material-icons tiny" aria-label="Eingeschränkte Barrierefreiheit">info_outline</i> - % } - % if ($train->{message_id}{70} or $train->{message_id}{71}) { - <i class="material-icons tiny" aria-label="Ohne WLAN">portable_wifi_off</i> - % } - </span> - </li> - % } -</ul> diff --git a/templates/_connections_hafas.html.ep b/templates/_connections_hafas.html.ep deleted file mode 100644 index 3b995b5..0000000 --- a/templates/_connections_hafas.html.ep +++ /dev/null @@ -1,57 +0,0 @@ -<ul class="collection departures connections"> - % for my $res (@{$connections}) { - % my ($train, $via, $via_arr, $hafas_service) = @{$res}; - % $via_arr = $via_arr ? $via_arr->strftime('%H:%M') : q{}; - % my $row_class = ''; - % my $link_class = 'action-checkin'; - % if ($train->is_cancelled) { - % $row_class = 'cancelled'; - % $link_class = 'action-cancelled-from'; - % } - % if ($checkin_from) { - <li class="collection-item <%= $row_class %> <%= $link_class %>" - data-hafas="<%= $hafas_service %>" - data-station="<%= $train->station_eva %>" - data-train="<%= $train->id %>" - data-ts="<%= ($train->sched_datetime // $train->datetime)->epoch %>" - data-dest="<%= $via->{name} %>"> - % } - % else { - <li class="collection-item <%= $row_class %>"> - % } - <a class="dep-time" href="#"> - % if ($train->is_cancelled) { - %= $train->sched_datetime->strftime('%H:%M') - % } - % else { - %= $train->datetime->strftime('%H:%M') - % } - % if ($via_arr) { - → <%= $via_arr %> - % } - % if ($train->delay) { - %= sprintf('(%+d)', $train->delay) - % } - </a> - <span class="connect-platform-wrapper"> - % if ($train->platform) { - <span> - % if (($train->type // q{}) =~ m{ ast | bus | ruf }ix) { - Steig - % } - % else { - Gleis - % } - %= $train->platform - </span> - % } - <span class="dep-line <%= $train->type // q{} %>"> - %= $train->line - </span> - </span> - <span class="dep-dest"> - %= $via->{name} - </span> - </li> - % } -</ul> diff --git a/templates/_suggestions_iris.html.ep b/templates/_suggestions_iris.html.ep new file mode 100644 index 0000000..8aea570 --- /dev/null +++ b/templates/_suggestions_iris.html.ep @@ -0,0 +1,44 @@ +<ul class="collection departures connections"> + % for my $res (@{$suggestions}) { + % my ($train, $dest) = @{$res}; + % my $row_class = ''; + % my $link_class = 'action-checkin'; + % if ($train->departure_is_cancelled) { + % $row_class = 'cancelled'; + % $link_class = 'action-cancelled-from'; + % } + % if ($checkin_from) { + <li class="collection-item <%= $row_class %> <%= $link_class %>" + data-station="<%= $train->station_uic %>" + data-train="<%= $train->train_id %>" + data-ts="<%= ($train->sched_departure // $train->departure)->epoch %>" + data-dest="<%= $dest->{name} %>"> + % } + % else { + <li class="collection-item <%= $row_class %>"> + % } + <a class="dep-time" href="#"> + % if ($train->departure_is_cancelled) { + %= $train->sched_departure->strftime('%H:%M') + % } + % else { + %= $train->departure->strftime('%H:%M') + % } + % if ($train->departure_delay) { + %= sprintf('(%+d)', $train->departure_delay) + % } + </a> + <span class="connect-platform-wrapper"> + % if ($train->platform) { + <span>Gleis <%= $train->platform %></span> + % } + <span class="dep-line <%= $train->type // q{} %>"> + %= $train->line + </span> + </span> + <span class="dep-dest"> + %= $dest->{name} + </span> + </li> + % } +</ul> diff --git a/templates/departures.html.ep b/templates/departures.html.ep index 0d57039..b1390b3 100644 --- a/templates/departures.html.ep +++ b/templates/departures.html.ep @@ -81,24 +81,19 @@ </div> </div> % } -% elsif (not param('train') and (@{stash('connections_iris') // []} or @{stash('connections_hafas') // []} or @{stash('suggestions') // []}) ) { +% elsif (not param('train') and @{stash('suggestions') // []} ) { % $have_connections = 1; <div class="row"> <div class="col s12"> <p>Häufig genutzte Verbindungen – Fahrt auswählen zum Einchecken mit Zielwahl</p> - % if (@{stash('connections_iris') // []}) { - %= include '_connections', connections => stash('connections_iris'), checkin_from => $eva; + % if ($dbris) { + %= include '_suggestions_dbris', suggestions => stash('suggestions'), checkin_from => $eva; % } - % if (@{stash('connections_hafas') // []}) { - %= include '_connections_hafas', connections => stash('connections_hafas'), checkin_from => $eva; + % elsif ($efa) { + %= include '_suggestions_efa', suggestions => stash('suggestions'), checkin_from => $eva; % } - % if (@{stash('suggestions') // []}) { - % if ($dbris) { - %= include '_suggestions_dbris', suggestions => stash('suggestions'), checkin_from => $eva; - % } - % elsif ($efa) { - %= include '_suggestions_efa', suggestions => stash('suggestions'), checkin_from => $eva; - % } + % else { + %= include '_suggestions_iris', suggestions => stash('suggestions'), checkin_from => $eva; % } </div> </div> |
