diff options
Diffstat (limited to 'templates')
47 files changed, 1724 insertions, 586 deletions
diff --git a/templates/_backend_line.html.ep b/templates/_backend_line.html.ep new file mode 100644 index 0000000..00496d3 --- /dev/null +++ b/templates/_backend_line.html.ep @@ -0,0 +1,25 @@ +<div class="row"> + <div class="col s8 m6 l6 right-align"> + %= $backend->{longname} + % if ($backend->{id} == $user->{backend_id}) { + (aktuell ausgewählt) + % } + % if ($backend->{has_area}) { + <br/> + <a href="https://dbf.finalrewind.org/coverage/<%= $backend->{type} %>/<%= $backend->{name} %>"><%= join(q{, }, @{$backend->{regions} // []}) || '[Karte]' %></a> + % } + % elsif ($backend->{regions}) { + <br/> + %= join(q{, }, @{$backend->{regions} // []}) + % } + % if ($backend->{homepage}) { + <br/> + <a href="<%= $backend->{homepage} %>"><%= $backend->{homepage} =~ s{ ^ http s? :// (?: www[.] )? (.*?) (?: / )? $ }{$1}xr %></a> + % } + </div> + <div class="col s4 m6 l6 left-align"> + <button class="btn waves-effect waves-light <%= $backend->{id} == $user->{backend_id} ? 'disabled' : q{} %>" style="min-width: 6em;" type="submit" name="backend" value="<%= $backend->{id} %>"> + <%= $backend->{name} %> + </button> + </div> +</div> diff --git a/templates/_cancelled_departure.html.ep b/templates/_cancelled_departure.html.ep index 79492a5..db6cc5c 100644 --- a/templates/_cancelled_departure.html.ep +++ b/templates/_cancelled_departure.html.ep @@ -1,9 +1,9 @@ <div class="card"> <div class="card-content"> - <span class="card-title">Zugausfall</span> + <span class="card-title">Fahrtausfall</span> <p>Die Abfahrt von <%= $journey->{train_type} %> <%= $journey->{train_no} %> in <a href="/s/<%= $journey->{dep_eva} %>"><%= $journey->{dep_name} %></a> - entfällt. Der Zugausfall auf der Fahrt nach <%= $journey->{arr_name} %> wurde bereits dokumentiert. + 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> diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep index 7155208..69754e3 100644 --- a/templates/_checked_in.html.ep +++ b/templates/_checked_in.html.ep @@ -4,7 +4,7 @@ <div class="card-content"> <i class="material-icons right sync-failed-marker grey-text" style="display: none;">sync_problem</i> % if (not $journey->{arr_name}) { - <span class="card-title center-align">Ziel wählen</span> + <span class="card-title center-align"><%= L('status.select-destination') %></span> % } <span class="card-title center-align"> %= include '_format_train', journey => $journey @@ -19,36 +19,36 @@ data-dest="<%= $journey->{arr_name} %>" > % if ($journey->{boarding_countdown} > 60) { - Einfahrt in <%= journeys->min_to_human(int($journey->{boarding_countdown} / 60)) %><br/> + <%= L('status.boarding-in.pre') %> <%= journeys->min_to_human(int($journey->{boarding_countdown} / 60)) %> <%= L('status.boarding-in.post') %><br/> % } % elsif ($journey->{boarding_countdown} > 0) { - Fährt ein<br/> + <%= L('status.boarding-soon') %><br/> % } % if ($journey->{departure_countdown} > 60) { - Abfahrt in <%= journeys->min_to_human(int($journey->{departure_countdown} / 60)) %> + <%= L('status.departure-in.pre') %> <%= journeys->min_to_human(int($journey->{departure_countdown} / 60)) %> <%= L('status.departure-in.post') %> % } % elsif ($journey->{departure_countdown} > 0) { - Abfahrt in weniger als einer Minute + %= L('status.departure-soon') % } % elsif (defined $journey->{arrival_countdown}) { % if ($journey->{arrival_countdown} > 60) { - Ankunft in <%= journeys->min_to_human(int($journey->{arrival_countdown} / 60)) %> + <%= L('status.arrival-in.pre') %> <%= journeys->min_to_human(int($journey->{arrival_countdown} / 60)) %> <%= L('status.arrival-in.post') %> % } % elsif ($journey->{arrival_countdown} > 0) { - Ankunft in weniger als einer Minute + %= L('status.arrival-soon') % } % else { - Ziel erreicht + %= L('status.arrived') % } % if ($journey->{arrival_countdown} < (60 * 15) and $journey->{arr_platform}) { % if ($journey->{arr_direction} and $journey->{arr_direction} eq 'r') { - <br/>Gleis <%= $journey->{arr_platform} %> ▶ + <br/><%= $journey->{platform_type} %> <%= $journey->{arr_platform} %> ▶ % } % elsif ($journey->{arr_direction} and $journey->{arr_direction} eq 'l') { - <br/>◀ Gleis <%= $journey->{arr_platform} %> + <br/>◀ <%= $journey->{platform_type} %> <%= $journey->{arr_platform} %> % } % else { - <br/>auf Gleis <%= $journey->{arr_platform} %> + <br/><%= L('status.arrive-on.pre') %> <%= $journey->{platform_type} %> <%= $journey->{arr_platform} %> <%= L('status.arrive-on.post') %> % } % } % } @@ -57,43 +57,60 @@ % } % if ($journey->{departure_countdown} > 0 and $journey->{dep_platform}) { % if ($journey->{dep_direction} and $journey->{dep_direction} eq 'r') { - <br/>Gleis <%= $journey->{dep_platform} %> ▶ + <br/><%= $journey->{platform_type} %> <%= $journey->{dep_platform} %> ▶ % } % elsif ($journey->{dep_direction} and $journey->{dep_direction} eq 'l') { - <br/>◀ Gleis <%= $journey->{dep_platform} %> + <br/>◀ <%= $journey->{platform_type} %> <%= $journey->{dep_platform} %> % } % else { - <br/>von Gleis <%= $journey->{dep_platform} %> + <br/><%= L('status.depart-from.pre') %> <%= $journey->{platform_type} %> <%= $journey->{dep_platform} %> <%= L('status.depart-from.post') %> % } % } % if (my $wr = $journey->{wagonorder}) { <br/> - % my @wagons = $wr->wagons; - % my $direction = $wr->direction == 100 ? '→' : '←'; - % if ($journey->{dep_direction}) { - % $direction = $journey->{dep_direction} eq 'l' ? '◀' : '▶'; - % if (($journey->{dep_direction} eq 'l' ? 0 : 100) != $wr->direction) { - % @wagons = reverse @wagons; + <a href="https://dbf.finalrewind.org/carriage-formation?<%= join('&', map { $_ . '=' . $journey->{extra_data}{wagonorder_param}{$_} } sort keys %{$journey->{extra_data}{wagonorder_param}}) %>&e=<%= $journey->{dep_direction} // q{} %>"> + % my $direction = $wr->direction == 100 ? '→' : '←'; + % my $rev = 0; + % if ($journey->{dep_direction}) { + % $direction = $journey->{dep_direction} eq 'l' ? '◀' : '▶'; + % $rev = (($journey->{dep_direction} eq 'l' ? 0 : 100) == $wr->direction) ? 0 : 1; % } - % } - <a href="https://dbf.finalrewind.org/_wr/<%= $journey->{train_no} %>/<%= $journey->{sched_departure}->strftime('%Y%m%d%H%M') %>?e=<%= $journey->{dep_direction} // q{} %>"> - %= $direction - % my $gi; - % for my $wagon (@wagons) { - % if (not ($wagon->is_locomotive or $wagon->is_powercar)) { - % if (defined $gi and $gi != $wagon->group_index) { + %= $direction + % my $had_entry = 0; + % for my $group ($rev ? reverse $wr->groups : $wr->groups) { + % if ($had_entry) { + % $had_entry = 0; • % } - % if ($wagon->is_closed) { - X - % } - % else { - %= $wagon->number || ($wagon->type =~ m{AB} ? '½' : $wagon->type =~ m{A} ? '1.' : $wagon->type =~ m{B} ? '2.' : $wagon->type ) + % for my $wagon ($rev ? reverse $group->carriages : $group->carriages) { + % if (not ($wagon->is_locomotive or $wagon->is_powercar)) { + % $had_entry = 1; + % if ($wagon->is_closed) { + X + % } + % elsif ( $wagon->number) { + %= $wagon->number + % } + % else { + % if ( $wagon->has_first_class ) { + % if ( $wagon->has_second_class ) { + ½ + % } + % else { + 1. + % } + % } + % elsif ( $wagon->has_second_class ) { + 2. + % } + % else { + %= $wagon->type; + % } + % } + % } % } % } - % $gi = $wagon->group_index; - % } - %= $direction + %= $direction </a> % } </div> @@ -111,12 +128,7 @@ % } </div> <div style="float: right; text-align: right;"> - % if ($user->{sb_template}) { - <b><a href="<%= resolve_sb_template($user->{sb_template}, name => $journey->{arr_name}, eva => $journey->{arr_eva}, tt => $journey->{train_type} // q{x}, tn => $journey->{train_no}, id => $journey->{train_id}) %>" class="unmarked"><%= $journey->{arr_name} %></a></b><br/> - % } - % else { - <b><%= $journey->{arr_name} %></b><br/> - % } + <b><a href="<%= resolve_sb_template($user->{sb_template}, name => $journey->{arr_name}, eva => $journey->{arr_eva}, tt => $journey->{train_type} // q{x}, tn => $journey->{train_no}, id => $journey->{train_id} =~ s{[ #|]}{x}gr, dbris => $journey->{is_dbris} ? $journey->{backend_name} : q{}, efa => $journey->{is_efa} ? $journey->{backend_name} : q{}, hafas => $journey->{is_hafas} ? $journey->{backend_name} : q{}, is_iris => $journey->{is_iris}, motis => $journey->{is_motis} ? $journey->{backend_name} : q{}) %>" class="unmarked"><%= $journey->{arr_name} %></a></b><br/> % if ($journey->{real_arrival}->epoch) { <b><%= $journey->{real_arrival}->strftime('%H:%M') %></b> % if ($journey->{real_arrival}->epoch != $journey->{sched_arrival}->epoch) { @@ -190,8 +202,11 @@ % if (@{$journey->{messages} // []} or @{$journey->{extra_data}{qos_msg} // []} or not $journey->{extra_data}{rt}) { <p style="margin-bottom: 2ex;"> <ul> - % if (not $journey->{extra_data}{rt}) { - <li><i class="material-icons tiny">gps_off</i> Keine Echtzeitdaten vorhanden + % if ($journey->{extra_data}{manual}) { + <li><i class="material-icons tiny">gps_off</i> Manueller Checkin ohne Echtzeitdaten + % } + % elsif (not $journey->{extra_data}{rt}) { + <li><i class="material-icons tiny">gps_off</i> <%= L('status.realtime-unavailable') %> % } % for my $message (reverse @{$journey->{messages} // []}) { % if ($journey->{sched_departure}->epoch - $message->[0]->epoch < 1800) { @@ -220,8 +235,7 @@ % } % if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} <= 0) { <p style="margin-top: 2ex;"> - Der automatische Checkout erfolgt wegen teilweise langsamer - Echtzeitdatenupdates erst etwa zehn Minuten nach der Ankunft. + %= L('status.delayed-auto-checkout') </p> % } % elsif (not $journey->{arr_name}) { @@ -230,10 +244,7 @@ <a class="tablerow action-checkout" data-station="<%= $station->[1] // $station->[0] %>"> <span><%= $station->[0] %></span> <span> - % if ($station->[2]{load}{SECOND}) { - % my ($first, $second) = load_icon($station->[2]{load}); - <i class="material-icons tiny" aria-hidden="true"><%= $first %></i> <i class="material-icons tiny" aria-hidden="true"><%= $second %></i> - % } + %= include '_show_load_icons', station => $station % if ($station->[2]{isCancelled}) { entfällt % } @@ -263,7 +274,7 @@ % } % else { <a class="action-undo blue-text" data-id="in_transit" data-checkints="<%= $journey->{timestamp}->epoch %>" style="margin-right: 0;"> - <i class="material-icons left" aria-hidden="true">undo</i> Rückgängig + <i class="material-icons left" aria-hidden="true">undo</i> <%= L('status.undo') %> </a> % } % if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} <= 0) { @@ -272,7 +283,7 @@ style="margin-right: 0;" data-station="<%= $journey->{arr_name}%>"> <i class="material-icons left">done</i> - Auschecken + %= L('status.check-out') </a> % } % elsif ($journey->{arr_name}) { @@ -299,12 +310,12 @@ data-url="<%= url_for('/status')->to_abs->scheme('https') %>/<%= $user->{name} %>/<%= $journey->{sched_departure}->epoch %>?token=<%= $journey->{dep_eva} %>-<%= $journey->{timestamp}->epoch % 337 %>" % } > - <i class="material-icons left" aria-hidden="true">share</i> Teilen + <i class="material-icons left" aria-hidden="true">share</i> <%= L('status.share') %> </a> % } % else { <a class="right" href="/journey/visibility"> - <i class="material-icons left"><%= visibility_icon($journey_visibility) %></i> Sichtbarkeit + <i class="material-icons left"><%= visibility_icon($journey_visibility) %></i> <%= L('status.privacy-level') %> </a> % } </div> @@ -312,15 +323,16 @@ % if (@{stash('timeline') // []}) { %= include '_timeline_link', timeline => stash('timeline'), from_checkin => 1 % } - % if ($journey->{arr_name}) { + % if ($journey->{arr_name} and @{$journey->{extra_data}{him_msg} // []}) { <div class="card" style="margin-top: <%= scalar @{stash('timeline') // []} ? '1.5rem' : '3em' %>;"> <div class="card-content"> - <span class="card-title">Details</span> + <i class="material-icons small right sync-failed-marker grey-text" style="display: none;">sync_problem</i> + <span class="card-title"><%= L('status.messages') %></span> % if (@{$journey->{extra_data}{him_msg} // []}) { <p style="margin-bottom: 2ex;"> <ul> % for my $message (@{$journey->{extra_data}{him_msg} // []}) { - <li> <i class="material-icons tiny">info</i> <%= $message->{header} %> <%= $message->{lead} %></li> + <li> <i class="material-icons tiny"><%= ($message->{prio} and $message->{prio} eq 'HOCH') ? 'warning' : 'info' %></i> <%= $message->{header} %> <%= $message->{lead} %></li> % } </ul> </p> @@ -340,78 +352,75 @@ </p> % } </div> - <div class="card-action"> - % my $url = 'https://bahn.expert/details/'; - % if ($journey->{train_id} =~ m{[|]}) { - % $url = $url . '/' . $journey->{sched_departure}->epoch . '000?jid=' . $journey->{train_id}; - % } - % else { - % $url = $url . $journey->{train_type} . ' ' . $journey->{train_no} . '/' . $journey->{sched_departure}->epoch . '000?station=' . $journey->{dep_eva}; - % } - <a style="margin-right: 0;" href="<%= $url %>"><i class="material-icons left" aria-hidden="true">timeline</i> Zuglauf</a> - % if ($journey->{extra_data}{trip_id}) { - <a class="right" style="margin-right: 0;" href="https://dbf.finalrewind.org/map/<%= $journey->{extra_data}{trip_id} %>/<%= $journey->{train_line} || 0 %>?from=<%= $journey->{dep_name} %>&to=<%= $journey->{arr_name} %>&dark=<%= (session('theme') and session('theme') eq 'dark') ? 1 : 0 %>"><i class="material-icons left" aria-hidden="true">map</i> Karte</a> - % } - </div> </div> + % } + % if ($journey->{arr_name}) { <div class="card" style="margin-top: 3em;"> <div class="card-content"> <i class="material-icons small right sync-failed-marker grey-text" style="display: none;">sync_problem</i> - <span class="card-title">Ziel ändern?</span> - % if ($user->{sb_template}) { - <div class="targetlist"> - % } - % else { - <p> - % } - % for my $station (@{$journey->{route_after}}) { - % my $is_dest = ($journey->{arr_name} and $station->[0] eq $journey->{arr_name}); - <a class="action-checkout tablerow" style="<%= $is_dest? 'font-weight: bold;' : '' %>" data-station="<%= $station->[1] // $station->[0] %>"> - <span><%= $station->[0] %></span> - <span> - % if ($station->[2]{load}{SECOND}) { - % my ($first, $second) = load_icon($station->[2]{load}); - <i class="material-icons tiny" aria-hidden="true"><%= $first %></i> <i class="material-icons tiny" aria-hidden="true"><%= $second %></i> - % } - % if ($station->[2]{isCancelled}) { - entfällt - % } - % elsif ($station->[2]{rt_arr} or $station->[2]{sched_arr}) { - %= ($station->[2]{rt_arr} || $station->[2]{sched_arr})->strftime('%H:%M') - % } - % elsif ($station->[2]{rt_dep} or $station->[2]{sched_dep}) { - (<%= ($station->[2]{rt_dep} || $station->[2]{sched_dep})->strftime('%H:%M') %>) - % } - % elsif ($station->[2]{isAdditional}) { - Zusatzhalt - % } - </span> + <span class="card-title"><%= L('status.map') %></span> + <div id="map" style="height: 70vh;"> + </div> + %= include '_map', with_map_header => 0, station_coordinates => stash('station_coordinates'), polyline_groups => stash('polyline_groups'), markers => stash('markers') + </div> + </div> + % if ($journey->{extra_data}{manual}) { + <div class="card" style="margin-top: 3em;"> + <div class="card-content"> + <i class="material-icons small right sync-failed-marker grey-text" style="display: none;">sync_problem</i> + <span class="card-title">Manueller Checkin</span> + </div> + <div class="card-action"> + <a class="action-undo blue-text" data-id="in_transit" data-checkints="<%= $journey->{timestamp}->epoch %>" style="margin-right: 0;"> + <i class="material-icons left" aria-hidden="true">undo</i> <%= L('status.undo-checkin') %> </a> - % if ($user->{sb_template}) { - <a class="nonflex" href="<%= resolve_sb_template($user->{sb_template}, name => $station->[0], eva => $station->[1], tt => $journey->{train_type} // q{x}, tn => $journey->{train_no}, id => $journey->{train_id}) %>"><i class="material-icons tiny">train</i></a> + </div> + </div> + % } + % else { + <div class="card" style="margin-top: 3em;"> + <div class="card-content"> + <i class="material-icons small right sync-failed-marker grey-text" style="display: none;">sync_problem</i> + <span class="card-title"><%= L('status.change-destination') %></span> + <div class="targetlist"> + % for my $station (@{$journey->{route_after}}) { + % my $is_dest = ($journey->{arr_name} and $station->[0] eq $journey->{arr_name}); + <a class="action-checkout tablerow" style="<%= $is_dest? 'font-weight: bold;' : '' %>" data-station="<%= $station->[1] // $station->[0] %>"> + <span><%= $station->[0] %></span> + <span> + %= include '_show_load_icons', station => $station + % if ($station->[2]{isCancelled}) { + entfällt + % } + % elsif ($station->[2]{rt_arr} or $station->[2]{sched_arr}) { + %= ($station->[2]{rt_arr} || $station->[2]{sched_arr})->strftime('%H:%M') + % } + % elsif ($station->[2]{rt_dep} or $station->[2]{sched_dep}) { + (<%= ($station->[2]{rt_dep} || $station->[2]{sched_dep})->strftime('%H:%M') %>) + % } + % elsif ($station->[2]{isAdditional}) { + Zusatzhalt + % } + </span> + </a> + <a class="nonflex" href="<%= resolve_sb_template($user->{sb_template}, name => $station->[0], eva => $station->[1], tt => $journey->{train_type} // q{x}, tn => $journey->{train_no}, id => $journey->{train_id} =~ s{[ #|]}{x}gr, dbris => $journey->{is_dbris} ? $journey->{backend_name} : q{}, efa => $journey->{is_efa} ? $journey->{backend_name} : q{}, hafas => $journey->{is_hafas} ? $journey->{backend_name} : q{}, is_iris => $journey->{is_iris}, motis => $journey->{is_motis} ? $journey->{backend_name} : q{}) %>"><i class="material-icons tiny"><%= $journey->{is_hafas} ? 'directions' : 'train' %></i></a> % } - % } - % if ($user->{sb_template}) { </div> - % } - % else { - </p> - % } - </div> - <div class="card-action"> - <a class="action-undo blue-text" data-id="in_transit" data-checkints="<%= $journey->{timestamp}->epoch %>" style="margin-right: 0;"> - <i class="material-icons left" aria-hidden="true">undo</i> Checkin Rückgängig - </a> + </div> + <div class="card-action"> + <a class="action-undo blue-text" data-id="in_transit" data-checkints="<%= $journey->{timestamp}->epoch %>" style="margin-right: 0;"> + <i class="material-icons left" aria-hidden="true">undo</i> <%= L('status.undo-checkin') %> + </a> + </div> </div> - </div> + % } <p> - Falls das Backend ausgefallen ist oder die Fahrt aus anderen - Gründen verloren ging: + %= L('status.force-checkout-lead') </p> <p class="center-align"> <a class="action-checkout waves-light btn" data-force="1" data-station="<%= $journey->{arr_name} - %>">Ohne Echtzeitdaten auschecken</a> + %>"><%= L('status.force-checkout') %></a> </p> % } </div> diff --git a/templates/_checked_out.html.ep b/templates/_checked_out.html.ep index 5a944dc..21db335 100644 --- a/templates/_checked_out.html.ep +++ b/templates/_checked_out.html.ep @@ -3,7 +3,7 @@ <span class="card-title">Ausgecheckt</span> <p>Aus %= include '_format_train', journey => $journey - bis <a href="/s/<%= $journey->{arr_eva} %>?hafas=<%= $journey->{train_id} =~ m{[|]} ? 1 : 0 %>"><%= $journey->{arr_name} %></a></p> + 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> diff --git a/templates/_connections_hafas.html.ep b/templates/_connections_hafas.html.ep index dcf7ec9..3b995b5 100644 --- a/templates/_connections_hafas.html.ep +++ b/templates/_connections_hafas.html.ep @@ -1,6 +1,6 @@ <ul class="collection departures connections"> % for my $res (@{$connections}) { - % my ($train, $via, $via_arr) = @{$res}; + % 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'; @@ -10,6 +10,7 @@ % } % 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 %>" @@ -34,7 +35,15 @@ </a> <span class="connect-platform-wrapper"> % if ($train->platform) { - <span>Gleis <%= $train->platform %></span> + <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 diff --git a/templates/_departures_dbris.html.ep b/templates/_departures_dbris.html.ep new file mode 100644 index 0000000..dbd1a70 --- /dev/null +++ b/templates/_departures_dbris.html.ep @@ -0,0 +1,55 @@ +<ul class="collection departures"> +% my $orientation_bar_shown = param('train'); +% my $now_epoch = now->epoch; +% for my $result (@{$results}) { + % my $row_class = ''; + % my $link_class = 'action-checkin'; + % if ($result->is_cancelled) { + % $row_class = "cancelled"; + % $link_class = 'action-cancelled-from'; + % } + % if (not $orientation_bar_shown and $result->dep->epoch < $now_epoch) { + % $orientation_bar_shown = 1; + <li class="collection-item" id="now"> + <strong class="dep-time"> + %= now->strftime('%H:%M') + </strong> + <strong>— Anfragezeitpunkt —</strong> + </li> + % } + <li class="collection-item <%= $link_class %> <%= $row_class %>" + data-dbris="<%= $dbris %>" + data-station="<%= $result->stop_eva %>" + data-train="<%= $result->id %>" + data-suffix="<%= $result->maybe_line_no %>" + data-ts="<%= ($result->sched_dep // $result->dep)->epoch %>" + > + <a class="dep-time" href="#"> + %= $result->dep->strftime('%H:%M') + % if ($result->delay) { + (<%= sprintf('%+d', $result->delay) %>) + % } + % elsif (not defined $result->delay and not $result->is_cancelled) { + <i class="material-icons" aria-label="Keine Echtzeitdaten vorhanden" style="font-size: 16px;">gps_off</i> + % } + </a> + <span class="dep-line <%= $result->type // q{} %>"> + %= $result->line + </span> + <span class="dep-dest"> + % if ($result->is_cancelled) { + Fahrt nach <%= $result->destination // $result->via_last %> entfällt + % } + % else { + %= $result->destination // $result->via_last + % for my $checkin (@{$checkin_by_train->{$result->id} // []}) { + <span class="followee-checkin"> + <i class="material-icons tiny" aria-label="Eine Person, der du folgst, ist hier eingecheckt">people</i> + <%= $checkin->{followee_name} %> → <%= $checkin->{arr_name} // '???' %> + </span> + % } + % } + </span> + </li> +% } +</ul> diff --git a/templates/_departures_efa.html.ep b/templates/_departures_efa.html.ep new file mode 100644 index 0000000..26af13f --- /dev/null +++ b/templates/_departures_efa.html.ep @@ -0,0 +1,57 @@ +<ul class="collection departures"> +% my $orientation_bar_shown = param('train'); +% my $now_epoch = now->epoch; +% for my $result (@{$results}) { + % my $row_class = ''; + % my $link_class = 'action-checkin'; + % if ($result->is_cancelled) { + % $row_class = "cancelled"; + % $link_class = 'action-cancelled-from'; + % } + % if (not $orientation_bar_shown and $result->datetime->epoch < $now_epoch) { + % $orientation_bar_shown = 1; + <li class="collection-item" id="now"> + <strong class="dep-time"> + %= now->strftime('%H:%M') + </strong> + <strong>— Anfragezeitpunkt —</strong> + </li> + % } + <li class="collection-item <%= $link_class %> <%= $row_class %>" + data-efa="<%= $efa %>" + data-station="<%= $result->stop_id_num %>" + data-train="<%= $result->id %>" + data-ts="<%= ($result->sched_datetime // $result->datetime)->epoch %>" + > + <a class="dep-time" href="#"> + %= $result->datetime->strftime('%H:%M') + % if ($result->delay) { + (<%= sprintf('%+d', $result->delay) %>) + % } + % elsif (not defined $result->delay and not $result->is_cancelled) { + <i class="material-icons" aria-label="Keine Echtzeitdaten vorhanden" style="font-size: 16px;">gps_off</i> + % } + </a> + <span class="dep-line <%= ($result->type // q{}) =~ tr{a-zA-Z_-}{}cdr %>"> + %= $result->line + </span> + <span class="dep-dest"> + % if ($result->is_cancelled) { + Fahrt nach <%= $result->destination %> entfällt + % } + % else { + %= $result->destination + % for my $checkin (@{$checkin_by_train->{$result->id} // []}) { + <span class="followee-checkin"> + <i class="material-icons tiny" aria-label="Eine Person, der du folgst, ist hier eingecheckt">people</i> + <%= $checkin->{followee_name} %> → <%= $checkin->{arr_name} // '???' %> + </span> + % } + % if ($result->occupancy) { + <i class="material-icons tiny" aria-hidden="true"><%= efa_load_icon($result->occupancy) %></i> + % } + % } + </span> + </li> +% } +</ul> diff --git a/templates/_departures_hafas.html.ep b/templates/_departures_hafas.html.ep index 9e4d7a4..5825ba0 100644 --- a/templates/_departures_hafas.html.ep +++ b/templates/_departures_hafas.html.ep @@ -18,6 +18,7 @@ </li> % } <li class="collection-item <%= $link_class %> <%= $row_class %>" + data-hafas="<%= $hafas %>" data-station="<%= $result->station_eva %>" data-train="<%= $result->id %>" data-ts="<%= ($result->sched_datetime // $result->datetime)->epoch %>" @@ -40,6 +41,13 @@ % } % else { %= $result->destination + % if ($result->load and $result->load->{SECOND}) { + % my ($first, $second) = load_icon($result->load); + % if ($first ne 'help_outline') { + <i class="material-icons tiny" aria-hidden="true"><%= $first %></i> + % } + <i class="material-icons tiny" aria-hidden="true"><%= $second %></i> + % } % for my $checkin (@{$checkin_by_train->{$result->id} // []}) { <span class="followee-checkin"> <i class="material-icons tiny" aria-label="Eine Person, der du folgst, ist hier eingecheckt">people</i> diff --git a/templates/_departures_motis.html.ep b/templates/_departures_motis.html.ep new file mode 100644 index 0000000..2ebc5de --- /dev/null +++ b/templates/_departures_motis.html.ep @@ -0,0 +1,54 @@ +<ul class="collection departures"> +% my $orientation_bar_shown = param('train'); +% my $now_epoch = now->epoch; +% for my $result (@{$results}) { + % my $row_class = ''; + % my $link_class = 'action-checkin'; + % if ($result->is_cancelled) { + % $row_class = "cancelled"; + % $link_class = 'action-cancelled-from'; + % } + % if (not $orientation_bar_shown and $result->stopover->departure->epoch < $now_epoch) { + % $orientation_bar_shown = 1; + <li class="collection-item" id="now"> + <strong class="dep-time"> + %= now->strftime('%H:%M') + </strong> + <strong>— Anfragezeitpunkt —</strong> + </li> + % } + <li class="collection-item <%= $link_class %> <%= $row_class %>" + data-motis="<%= $motis %>" + data-station="<%= $result->stopover->stop->id %>" + data-train="<%= $result->id %>" + data-ts="<%= ($result->stopover->departure)->epoch %>" + > + <a class="dep-time" href="#"> + %= $result->stopover->departure->strftime('%H:%M') + % if ($result->stopover->delay) { + (<%= sprintf('%+d', $result->stopover->delay) %>) + % } + % elsif (not $result->stopover->is_realtime and not $result->stopover->is_cancelled) { + <i class="material-icons" aria-label="Keine Echtzeitdaten vorhanden" style="font-size: 16px;">gps_off</i> + % } + </a> + <span class="dep-line <%= $result->mode %>" style="background-color: #<%= $result->route_color // q{} %>;"> + %= $result->route_name + </span> + <span class="dep-dest"> + % if ($result->is_cancelled) { + Fahrt nach <%= $result->headsign %> entfällt + % } + % else { + %= $result->headsign + % for my $checkin (@{$checkin_by_train->{$result->id} // []}) { + <span class="followee-checkin"> + <i class="material-icons tiny" aria-label="Eine Person, der du folgst, ist hier eingecheckt">people</i> + <%= $checkin->{followee_name} %> → <%= $checkin->{arr_name} // '???' %> + </span> + % } + % } + </span> + </li> +% } +</ul> diff --git a/templates/_format_train.html.ep b/templates/_format_train.html.ep index 1d6acaa..cb81211 100644 --- a/templates/_format_train.html.ep +++ b/templates/_format_train.html.ep @@ -1,8 +1,10 @@ % if ($journey->{extra_data}{wagonorder_pride}) { 🏳️🌈 % } -<span class="dep-line <%= $journey->{train_type} // q{} %>"> - <%= $journey->{train_type} %> +<span class="dep-line <%= ($journey->{train_type} // q{}) =~ tr{a-zA-Z_-}{}cdr %>"> + % if (not $journey->{is_motis}) { + <%= $journey->{train_type} %> + % } <%= $journey->{train_line} // $journey->{train_no}%> </span> % if ($journey->{train_line}) { diff --git a/templates/_history_trains.html.ep b/templates/_history_trains.html.ep index cf998ab..166d74d 100644 --- a/templates/_history_trains.html.ep +++ b/templates/_history_trains.html.ep @@ -16,8 +16,11 @@ % } <li class="collection-item"> <a href="<%= $detail_link %>"> - <span class="dep-line <%= $travel->{type} // q{} %>"> - <%= $travel->{type} %> <%= $travel->{line} // $travel->{no}%> + <span class="dep-line <%= ($travel->{type} // q{}) =~ tr{a-zA-Z_-}{}cdr %>"> + % if (length($travel->{type}) < 5 and not $travel->{is_motis}) { + <%= $travel->{type} %> + % } + <%= $travel->{line} // $travel->{no}%> </span> </a> @@ -34,8 +37,8 @@ <i class="material-icons">timer_off</i> % } else { %= $travel->{rt_arrival}->strftime('%H:%M'); - % if ($travel->{sched_arrival} != $travel->{rt_arrival}) { - (<%= sprintf('%+d', ($travel->{rt_arrival}->epoch - $travel->{sched_arrival}->epoch) / 60) %>) + % if ($travel->{delay_arr} and int($travel->{delay_arr} / 60)) { + (<%= sprintf('%+d', $travel->{delay_arr} / 60) %>) % } % } % } @@ -52,8 +55,8 @@ % } % else { <%= $travel->{rt_departure}->strftime('%H:%M') %> - % if ($travel->{sched_departure} != $travel->{rt_departure}) { - (<%= sprintf('%+d', ($travel->{rt_departure}->epoch - $travel->{sched_departure}->epoch) / 60) %>) + % if ($travel->{delay_dep} and int($travel->{delay_dep} / 60)) { + (<%= sprintf('%+d', $travel->{delay_dep} / 60) %>) % } % } <strong><%= $travel->{from_name} %></strong> diff --git a/templates/_map.html.ep b/templates/_map.html.ep index daa16f0..93f116a 100644 --- a/templates/_map.html.ep +++ b/templates/_map.html.ep @@ -1,16 +1,18 @@ -<div class="row"> - <div class="col s12"> - <div id="map" style="height: 70vh;"> +% if (stash('with_map_header') // 1) { + <div class="row"> + <div class="col s12"> + <div id="map" style="height: 70vh;"> + </div> </div> </div> -</div> -<div class="row"> - <div class="col s12"> - <span style="color: #f03;">●</span> Ein-/Ausstiegsstation<br/> - <span style="color: #673ab7;">—</span> Streckenverlauf oder Luftlinie + <div class="row"> + <div class="col s12"> + <span style="color: #f03;">●</span> Ein-/Ausstiegsstation<br/> + <span style="color: #673ab7;">—</span> Streckenverlauf oder Luftlinie + </div> </div> -</div> +% } <script> var map = L.map('map').setView([51.306, 9.712], 6); @@ -37,6 +39,15 @@ var pl; % } % } +% for my $marker (@{stash('markers') // []}) { + % if ($marker->[0] and $marker->[0][0] and $marker->[1]) { + { + const marker = L.marker([<%= $marker->[0][0] %>, <%= $marker->[0][1] %>]).addTo(map); + marker.bindPopup('<%= $marker->[1] %>'); + } + % } +% } + % if (my $b = stash('bounds')) { map.fitBounds([[<%= $b->[0][0] %>,<%= $b->[0][1] %>],[<%= $b->[1][0] %>,<%= $b->[1][1] %>]]); % } @@ -46,8 +57,8 @@ for (var station_id in stations) { color: '#f03', opacity: 0.7, fillColor: '#f03', - fillOpacity: 0.5, - radius: 250 + fillOpacity: 0.2, + radius: 200 }).bindPopup(stations[station_id][1]).addTo(map); } diff --git a/templates/_public_status_card.html.ep b/templates/_public_status_card.html.ep index b463d15..ca5ddf8 100644 --- a/templates/_public_status_card.html.ep +++ b/templates/_public_status_card.html.ep @@ -8,10 +8,10 @@ Unterwegs mit <%= include '_format_train', journey => $journey %> % } % elsif (stash('from_timeline')) { - <a href="/p/<%= $name %>"><%= $name %></a>: <%= include '_format_train', journey => $journey %> + <a href="/status/<%= $name %>"><%= $name %></a>: <%= include '_format_train', journey => $journey %> % } % else { - <a href="/p/<%= $name %>"><%= $name %></a> ist unterwegs + <a href="/p/<%= $name %>"><%= $name %></a> <%= L('status.is-checked-in') %> % } <i class="material-icons right"><%= visibility_icon($journey->{effective_visibility_str}) %></i> % if (not $journey->{extra_data}{rt}) { @@ -19,9 +19,9 @@ % } </span> % if ($privacy->{comments_visible} and $journey->{comment}) { - <p>„<%= $journey->{comment} %>“</p> + <div>„<%= $journey->{comment} %>“</div> % } - <p> + <div> % if (not stash('from_profile') and not stash('from_timeline')) { <div class="center-align"> %= include '_format_train', journey => $journey @@ -41,10 +41,10 @@ % } % elsif (defined $journey->{arrival_countdown}) { % if ($journey->{arrival_countdown} > 60) { - Ankunft in <%= journeys->min_to_human(int($journey->{arrival_countdown} / 60)) %> + <%= L('status.arrival-in.pre') %> <%= journeys->min_to_human(int($journey->{arrival_countdown} / 60)) %> <%= L('status.arrival-in.post') %> % } % elsif ($journey->{arrival_countdown} > 0) { - Ankunft in weniger als einer Minute + %= L('status.arrival-soon') % } % else { Ziel erreicht @@ -54,14 +54,14 @@ % } % } % elsif ($journey->{arr_name}) { - Ankunft in mehr als zwei Stunden + %= L('status.arrival-unknown') % } </div> <div class="progress" style="height: 1ex;"> <div class="determinate" style="width: <%= sprintf('%.2f', 100 * ($journey->{journey_completion} // 0)); %>%;"></div> </div> - </p> - <p> + </div> + <div class="status-card-progress-annot"> <div style="float: left;"> <b><%= $journey->{dep_name} %></b><br/> <b><%= $journey->{real_departure}->strftime('%H:%M') %></b> @@ -92,20 +92,31 @@ % last; % } % if (($station->[2]{arr_countdown} // 0) > 0 and $station->[2]{arr}) { - <%= $station->[0] %><br/><%= $station->[2]{arr}->strftime('%H:%M') %> + %= $station->[0] + <br/> + %= $station->[2]{arr}->strftime('%H:%M') % if ($station->[2]{arr_delay}) { - %= sprintf('(%+d)', $station->[2]{arr_delay} / 60); + %= sprintf('(%+d)', $station->[2]{arr_delay} / 60) + % } + % if ($station->[2]{load}{SECOND}) { + <br/> + %= include '_show_load_icons', station => $station % } % last; % } % if (($station->[2]{dep_countdown} // 0) > 0 and $station->[2]{dep}) { - <%= $station->[0] %><br/> + %= $station->[0] + <br/> % if ($station->[2]{arr}) { <%= $station->[2]{arr}->strftime('%H:%M') %> → % } %= $station->[2]{dep}->strftime('%H:%M') % if ($station->[2]{dep_delay}) { - %= sprintf('(%+d)', $station->[2]{dep_delay} / 60); + %= sprintf('(%+d)', $station->[2]{dep_delay} / 60) + % } + % if ($station->[2]{load}{SECOND}) { + <br/> + %= include '_show_load_icons', station => $station % } % last; % } @@ -120,34 +131,46 @@ % } % if (($station->[2]{arr_countdown} // 0) > 0 and $station->[2]{arr}) { Nächster Halt:<br/> - <%= $station->[0] %><br/><%= $station->[2]{arr}->strftime('%H:%M') %> + %= $station->[0] + <br/> + %= $station->[2]{arr}->strftime('%H:%M') % if ($station->[2]{arr_delay}) { - %= sprintf('(%+d)', $station->[2]{arr_delay} / 60); + %= sprintf('(%+d)', $station->[2]{arr_delay} / 60) + % } + % if ($station->[2]{load}{SECOND}) { + <br/> + %= include '_show_load_icons', station => $station % } % last; % } % if (($station->[2]{dep_countdown} // 0) > 0 and $station->[2]{arr} and $station->[2]{dep}) { Aktueller Halt:<br/> - <%= $station->[0] %><br/> - <%= $station->[2]{arr}->strftime('%H:%M') %> → - <%= $station->[2]{dep}->strftime('%H:%M') %> + %= $station->[0] + <br/> + %= $station->[2]{arr}->strftime('%H:%M') + → + %= $station->[2]{dep}->strftime('%H:%M') % if ($station->[2]{dep_delay}) { - %= sprintf('(%+d)', $station->[2]{dep_delay} / 60); + %= sprintf('(%+d)', $station->[2]{dep_delay} / 60) + % } + % if ($station->[2]{load}{SECOND}) { + <br/> + %= include '_show_load_icons', station => $station % } % last; % } % } </div> - </p> + </div> % if ($journey->{extra_data}{cancelled_destination}) { - <p style="margin-bottom: 2ex;"> + <div style="margin-bottom: 2ex;"> <i class="material-icons tiny" aria-hidden="true">error</i> Der Halt an der Zielstation <b><%= $journey->{extra_data}{cancelled_destination} %></b> entfällt. - </p> + </div> % } % if (@{$journey->{messages} // []} > 0 and $journey->{messages}[0]) { - <p style="margin-bottom: 2ex;"> + <div style="margin-top: 2ex;"> <ul> % for my $message (reverse @{$journey->{messages} // []}) { % if ($journey->{sched_departure}->epoch - $message->[0]->epoch < 1800) { @@ -158,22 +181,95 @@ <li> <i class="material-icons tiny">info</i> <%= $message->[0]->strftime('%H:%M') %>: <%= $message->[1] %></li> % } </ul> - </p> + </div> % } - </div> - % if (not stash('from_timeline')) { - <div class="card-action"> - % if ($journey->{traewelling_url}) { - <a style="margin-right: 0;" href="<%= $journey->{traewelling_url} %>"><i class="material-icons left">timeline</i> Träwelling</a> - % } else { - % my $url = 'https://bahn.expert/details/' . $journey->{train_type} . ' ' . $journey->{train_no} . '/' . DateTime->now(time_zone => 'Europe/Berlin')->epoch . '000'; - <a style="margin-right: 0;" href="<%= $url %>"><i class="material-icons left">timeline</i> Zuglauf</a> + % if (@{$journey->{extra_data}{him_msg} // []}) { + <div style="margin-top: 2ex;"> + <ul> + % for my $message (@{$journey->{extra_data}{him_msg} // []}) { + % if (not stash('from_timeline') or $message->{prio} and $message->{prio} eq 'HOCH') { + <li> <i class="material-icons tiny"><%= ($message->{prio} and $message->{prio} eq 'HOCH') ? 'warning' : 'info' %></i> <%= $message->{header} %> <%= $message->{lead} %></li> + % } + % } + </ul> + </div> + % } + % if (stash('station_coordinates')) { + <div id="map" style="height: 70vh;"> + </div> + %= include '_map', with_map_header => 0, station_coordinates => stash('station_coordinates'), polyline_groups => stash('polyline_groups') + % } + % if ( @{$journey->{wagongroups} // []} ) { + % if (stash('from_timeline')) { + <div class="wagons" style="margin-top: 2ex;"> + % for my $wagongroup (@{$journey->{wagongroups}}) { + %= $wagongroup->{desc} // $wagongroup->{name} + % if ($wagongroup->{designation}) { + „<%= $wagongroup->{designation} %>“ + % } + % if ($wagongroup->{to}) { + → <%= $wagongroup->{to} %> + % } + <br/> + % } + </div> % } - % if ($journey->{extra_data}{trip_id}) { - <a class="right" style="margin-right: 0;" href="https://dbf.finalrewind.org/map/<%= $journey->{extra_data}{trip_id} %>/<%= $journey->{train_line} || 0 %>?from=<%= $journey->{dep_name} %>&to=<%= $journey->{arr_name} // '' %>"><i class="material-icons left">map</i> Karte</a> + % else { + <div class="wagons" style="margin-top: 2ex;"> + <%= L('status.carriages') %>:<br/> + %= include '_wagons', wagongroups => $journey->{wagongroups}; + </div> % } - </div> - % } + % } + % if (not stash('from_timeline')) { + <div style="margin-top: 2ex;"> + <%= L('status.route') %>:<br/> + % my $before = 1; + % my $within = 0; + % my $at_startstop = 0; + % for my $station (@{$journey->{route}}) { + % if (($station->[1] and $station->[1] == $journey->{dep_eva}) or $station->[0] eq $journey->{dep_name}) { + % $within = 1; $at_startstop = 1; + % } + % elsif ($journey->{arr_eva} and (($station->[1] and $station->[1] == $journey->{arr_eva}) or $station->[0] eq $journey->{arr_name})) { + % $within = 0; $at_startstop = 1; + % } + % 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] + % } + % else { + <span style="color: #808080;"><%= $station->[0] %></span> + % } + <span> + %= include '_show_load_icons', station => $station + </span> + <span style="color: #808080;"> + % if ($before and $station->[2]{rt_dep} and $station->[2]{dep_delay}) { + %= sprintf('%+d', $station->[2]{dep_delay} / 60) + % } + % elsif (not $before and $station->[2]{rt_arr} and $station->[2]{arr_delay}) { + %= sprintf('%+d', $station->[2]{arr_delay} / 60) + % } + </span> + % if (($station->[1] and $station->[1] == $journey->{dep_eva}) or $station->[0] eq $journey->{dep_name}) { + % $before = 0; + % } + <br/> + % } + </div> + % } + </div> </div> % } % else { @@ -184,9 +280,9 @@ <span class="card-title">Aktuell nicht eingecheckt</span> % } % else { - <span class="card-title"><a href="/p/<%= $name %>"><%= $name %></a> ist gerade nicht eingecheckt</span> + <span class="card-title"><a href="/p/<%= $name %>"><%= $name %></a> <%= L('status.is-not-checked-in') %></span> % } - <p> + <div> % if ($journey->{arr_name}) { Zuletzt gesehen % if ($journey->{real_arrival}->epoch) { @@ -198,7 +294,7 @@ in <b><%= $journey->{arr_name} %></b> % } % } - </p> + </div> </div> </div> % } diff --git a/templates/_show_load_icons.html.ep b/templates/_show_load_icons.html.ep new file mode 100644 index 0000000..21093b9 --- /dev/null +++ b/templates/_show_load_icons.html.ep @@ -0,0 +1,11 @@ +% if ($station->[2]{load}{SECOND}) { + % my ($first, $second) = load_icon($station->[2]{load}); + % if ($first ne 'help_outline') { + <i class="material-icons tiny" aria-hidden="true"><%= $first %></i> + % } + <i class="material-icons tiny" aria-hidden="true"><%= $second %></i> +% } +% elsif ($station->[2]{efa_load}) { + % my ($icon) = efa_load_icon($station->[2]{efa_load}); + <i class="material-icons tiny" aria-hidden="true"><%= $icon %></i> +% } diff --git a/templates/_timeline_link.html.ep b/templates/_timeline_link.html.ep index 1a78279..4b9c2a5 100644 --- a/templates/_timeline_link.html.ep +++ b/templates/_timeline_link.html.ep @@ -1,5 +1,5 @@ <div> - <a href="/timeline/in-transit"> + <a class="timeline-link" href="/timeline/in-transit"> % if (@{$timeline} <= 2) { <strong><%= $timeline->[0]->{followee_name} %></strong> % } diff --git a/templates/_wagons.html.ep b/templates/_wagons.html.ep index 106709e..3f906c0 100644 --- a/templates/_wagons.html.ep +++ b/templates/_wagons.html.ep @@ -1,13 +1,22 @@ % for my $wagongroup (@{$wagongroups // []}) { - <%= $wagongroup->{name} %> + %= $wagongroup->{desc} // $wagongroup->{name} % my ($wagon_number) = ($wagongroup->{name} =~ m{ ^ ICE 0* (\d+) $ }x); - % if ($wagon_number and my $group_name = app->ice_name->{$wagon_number}) { + % if ($wagongroup->{designation}) { + „<%= $wagongroup->{designation} %>“ + % } + % elsif ($wagon_number and my $group_name = app->ice_name->{$wagon_number}) { „<%= $group_name %>“ % } - als <b><%= $journey->{type} %> <%= $wagongroup->{no} %></b> - von <b><%= $wagongroup->{from} %></b> nach <b><%= $wagongroup->{to} %></b><br/> + <%= L('wagons.name-as-type') %> <b><%= $wagongroup->{type} // $journey->{type} %> <%= $wagongroup->{no} %></b> + % if ($wagongroup->{from}) { + <%= L('wagons.from.pre') %> <b><%= $wagongroup->{from} %></b> <%= L('wagons.from.post') %> + % } + % if ($wagongroup->{to}) { + <%= L('wagons.to.pre') %> <b><%= $wagongroup->{to} %></b> <%= L('wagons.to.post') %> + % } + <br/> % for my $wagon (@{$wagongroup->{wagons}}) { - % if (length($wagon->{id}) == 12) { + % if (length($wagon->{id}) == 12 or length($wagon->{id}) == 14) { <span><%= substr($wagon->{id}, 0, 2) %></span><span><%= substr($wagon->{id}, 2, 2) %></span><span><%= substr($wagon->{id}, 4, 1) %></span><span class="wagonclass"><%= substr($wagon->{id}, 5, 3) %></span><span class="wagonnum"><%= substr($wagon->{id}, 8, 3) %></span><span class="checksum"><%= substr($wagon->{id}, 11) %></span> % } % elsif ($wagon->{id}) { @@ -15,7 +24,7 @@ % } %= $wagon->{type} % if ($wagon->{number}) { - – Wagen <%= $wagon->{number} %> + – <%= L('wagons.carriage') %> <%= $wagon->{number} %> % } <br/> % } diff --git a/templates/about.html.ep b/templates/about.html.ep index ea86bdf..a76cb94 100644 --- a/templates/about.html.ep +++ b/templates/about.html.ep @@ -1,31 +1,42 @@ <div class="row"> <div class="col s12"> <a href="https://finalrewind.org/projects/travelynx">travelynx</a> v<%= stash('version') // '???' %><br/> - Entwickelt von <a href="https://finalrewind.org">derf</a><br/> - <a href="<%= app->config->{ref}{source} // 'https://github.com/derf/travelynx' %>">Quelltext</a> lizensiert unter AGPL v3<br/><br/> - Backends: + <%= L('about.developed-by.lead') %> <a href="https://finalrewind.org">derf</a> + <%= L('about.developed-by.and') %> <a href="https://github.com/derf/travelynx/graphs/contributors"><%= L('about.developed-by.others') %></a> <%= L('about.developed-by.tail') %> <%= L('about.developed-by.tail') %><br/> + <a href="<%= app->config->{ref}{source} // 'https://git.finalrewind.org/travelynx' %>"><%= L('about.source-code') %></a> <%= L('about.licence-agplv3') %><br/><br/> + <%= L('about.data-sources') %>: + <a href="https://finalrewind.org/projects/Travel-Status-DE-DBRIS/">Travel::Status::DE::DBRIS</a> + v<%= $Travel::Status::DE::DBRIS::VERSION %>, + <a href="https://finalrewind.org/projects/Travel-Status-DE-EFA/">Travel::Status::DE::EFA</a> + v<%= $Travel::Status::DE::EFA::VERSION %>, + <a href="https://finalrewind.org/projects/Travel-Status-DE-HAFAS/">Travel::Status::DE::HAFAS</a> + v<%= $Travel::Status::DE::HAFAS::VERSION %>, <a href="https://finalrewind.org/projects/Travel-Status-DE-IRIS/">Travel::Status::DE::IRIS</a> - v<%= $Travel::Status::DE::IRIS::VERSION %> und - <a href="https://finalrewind.org/projects/Travel-Status-DE-DeutscheBahn/">Travel::Status::DE::HAFAS</a> - v<%= $Travel::Status::DE::HAFAS::VERSION %><br/> - <a href="http://data.deutschebahn.com/dataset/data-haltestellen">Haltestellendaten</a> - © DB Station&Service AG, - Europaplatz 1, - 10557 Berlin, lizensiert unter CC-BY 4.0 + v<%= $Travel::Status::DE::IRIS::VERSION %><%= L('about.data-sources.last-and') %> + <a href="https://finalrewind.org/projects/Travel-Status-MOTIS/">Travel::Status::MOTIS</a> + v<%= $Travel::Status::MOTIS::VERSION %><br/> + </div> +</div> + +<div class="row"> + <div class="col s12"> + <p> + %= L('about.disclaimer') + </p> </div> </div> <div class="row"> <div class="col s12 m12 l4 center-align" style="margin-top: 1em;"> - <a href="https://social.skyshaper.org/derf" class="waves-effect waves-light btn"><i class="material-icons left">message</i>Kontakt</a> + <a href="https://social.skyshaper.org/derf" class="waves-effect waves-light btn"><i class="material-icons left">message</i><%= L('about.contact') %></a> </div> <div class="col s12 m12 l4 center-align" style="margin-top: 1em;"> % if (my $issue_url = app->config->{ref}{issues}) { - <a href="<%= $issue_url %>" class="waves-effect waves-light btn"><i class="material-icons left">bug_report</i>Bugs?</a> + <a href="<%= $issue_url %>" class="waves-effect waves-light btn"><i class="material-icons left">bug_report</i><%= L('about.bugs') %></a> % } </div> <div class="col s12 m12 l4 center-align" style="margin-top: 1em;"> - <a href="/changelog" class="waves-effect waves-light btn"><i class="material-icons left">list</i>Changelog</a> + <a href="/changelog" class="waves-effect waves-light btn"><i class="material-icons left">list</i><%= L('about.changelog') %></a> </div> </div> diff --git a/templates/account.html.ep b/templates/account.html.ep index 7f689c2..5539a39 100644 --- a/templates/account.html.ep +++ b/templates/account.html.ep @@ -8,34 +8,34 @@ <div class="card success-color"> <div class="card-content white-text"> % if ($success eq 'name') { - <span class="card-title">Name geändert</span> + <span class="card-title"><%= L('account.changed-name') %></span> % } % elsif ($success eq 'mail') { - <span class="card-title">Mail-Adresse geändert</span> + <span class="card-title"><%= L('account.changed-mail') %></span> % } % elsif ($success eq 'password') { - <span class="card-title">Passwort geändert</span> + <span class="card-title"><%= L('account.changed-password') %></span> + % } + % elsif ($success eq 'language') { + <span class="card-title"><%= L('account.changed-language') %></span> % } % elsif ($success eq 'privacy') { - <span class="card-title">Einstellungen zu öffentlichen Account-Daten geändert</span> + <span class="card-title"><%= L('account.changed-privacy') %></span> % } % elsif ($success eq 'social') { - <span class="card-title">Einstellungen zur Interaktionen mit anderen Accounts geändert</span> + <span class="card-title"><%= L('account.changed-social') %></span> % } % elsif ($success eq 'traewelling') { - <span class="card-title">Träwelling-Verknüpfung aktualisiert</span> + <span class="card-title"><%= L('account.changed-traewelling') %></span> % } % elsif ($success eq 'use_history') { - <span class="card-title">Einstellungen zu vorgeschlagenen Verbindungen geändert</span> - % } - % elsif ($success eq 'external') { - <span class="card-title">Einstellungen zu externen Diensten geändert</span> + <span class="card-title"><%= L('account.changed-history') %></span> % } % elsif ($success eq 'webhook') { - <span class="card-title">Web Hook aktualisiert</span> + <span class="card-title"><%= L('account.changed-webhook') %></span> % } % elsif ($success eq 'clear_notifications') { - <span class="card-title">Benachrichtigungen gelesen</span> + <span class="card-title"><%= L('account.cleared-notifications') %></span> % } </div> </div> @@ -49,34 +49,38 @@ % my $use_history = users->use_history(uid => $acc->{id}); <div class="row"> <div class="col s12"> - <h2>Account</h2> + <h2><%= L('account.account') %></h2> <table class="striped"> <tr> - <th scope="row">Name</th> + <th scope="row"><%= L('account.name') %></th> <td><a href="/account/name"><i class="material-icons">edit</i></a><%= $acc->{name} %></td> </tr> <tr> - <th scope="row">Mail</th> + <th scope="row"><%= L('account.mail') %></th> <td><a href="/account/mail"><i class="material-icons">edit</i></a><%= $acc->{email} %></td> </tr> <tr> - <th scope="row">Passwort</th> + <th scope="row"><%= L('account.password') %></th> <td><a href="/account/password"><i class="material-icons">edit</i></a></td> </tr> <tr> - <th scope="row">Verbindungen</th> + <th scope="row"><%= L('account.language') %></th> + <td><a href="/account/language"><i class="material-icons">edit</i></a><%= $acc->{languages}[0] // q{} %></td> + </tr> + <tr> + <th scope="row"><%= L('account.connections') %></th> <td> <a href="/account/insight"><i class="material-icons">edit</i></a> % if ($use_history & 0x03) { - Vorschläge aktiv + %= L('account.connections.enabled') % } % else { - <span style="color: #999999;">Vorschläge deaktiviert</span> + <span style="color: #999999;"><%= L('account.connections.disabled') %></span> % } </td> </tr> <tr> - <th scope="row">Sichtbarkeit</th> + <th scope="row"><%= L('account.visibility') %></th> <td> <a href="/account/privacy"><i class="material-icons">edit</i></a> <i class="material-icons">check</i><i class="material-icons"><%= visibility_icon($acc->{default_visibility_str}) %></i> @@ -84,41 +88,41 @@ </td> </tr> <tr> - <th scope="row">Interaktion</th> + <th scope="row"><%= L('account.interaction') %></th> <td> <a href="/account/social"><i class="material-icons">edit</i></a> % if ($acc->{accept_follows}) { - <span>Accounts können dir direkt folgen</span> + <span><%= L('account.interaction.accept-follows') %></span> % } % elsif ($acc->{accept_follow_requests}) { - <span>Accounts können dir auf Anfrage folgen + <span><%= L('account.interaction.accept-follow-requests') %> % if ($num_rx_follow_requests == 1) { - – <a href="/account/social/follow-requests-received"><strong>eine</strong> offene Anfrage</a> + – <a href="/account/social/follow-requests-received"><strong><%= L('account.interaction.one') %></strong> <%= L('account.interaction.open-request') %></a> % } elsif ($num_rx_follow_requests) { - – <a href="/account/social/follow-requests-received"><strong><%= $num_rx_follow_requests %></strong> offene Anfragen</a> + – <a href="/account/social/follow-requests-received"><strong><%= $num_rx_follow_requests %></strong> <%= L('account.interaction.open-requests') %></a> % } </span> % } % else { - <span style="color: #999999;">Accounts können dir nicht folgen</span> + <span style="color: #999999;"><%= L('account.interaction.disabled') %></span> % } </td> </tr> <tr> - <th scope="row">Web Hook</th> + <th scope="row"><%= L('account.webhook') %></th> <td> <a href="/account/hooks"><i class="material-icons">edit</i></a> % if (not $hook->{enabled}) { - <span style="color: #999999;">Nicht eingerichtet</span> + <span style="color: #999999;"><%= L('account.webhook.disabled') %></span> % } % elsif ($hook->{latest_run}->epoch == 0) { - Aktiv, noch nicht ausgeführt + <%= L('account.webhook.active-pending') %> % } % elsif ($hook->{errored}) { - Aktiv, fehlerhaft <i class="material-icons" aria-hidden="true">error</i> + <%= L('account.webhook.active-error') %> <i class="material-icons" aria-hidden="true">error</i> % } % else { - Aktiv + <%= L('account.webhook.active') %> % } </td> </tr> @@ -126,6 +130,8 @@ <tr> <th scope="row">Träwelling</th> <td> + <%= L('account.traewelling.unsupported') %> + <!-- <a href="/account/traewelling"><i class="material-icons">edit</i></a> % if (not ($traewelling->{token})) { <span style="color: #999999;">Nicht verknüpft</span> @@ -148,24 +154,13 @@ – Checkins in travelynx werden zu Träwelling weitergereicht % } % } + --> </td> </tr> % } <tr> - <th scope="row">Externe Dienste</th> - <td> - <a href="/account/services"><i class="material-icons">edit</i></a> - % if ($acc->{sb_name}) { - Abfahrtstafel: <%= $acc->{sb_name} %> - % } - % else { - <span style="color: #999999;">Keine</span> - % } - </td> - </tr> - <tr> - <th scope="row">Registriert am</th> - <td><%= $acc->{registered_at}->strftime('%d.%m.%Y %H:%M') %></td> + <th scope="row"><%= L('account.registration-date') %></th> + <td><%= $acc->{registered_at}->strftime(L('strftime.datetime')) %></td> </tr> </table> </div> @@ -175,7 +170,7 @@ %= form_for 'logout' => begin %= csrf_field <button class="btn waves-effect waves-light" type="submit" name="action" value="logout"> - Abmelden + %= L('button.logout') </button> %= end </div> diff --git a/templates/add_intransit.html.ep b/templates/add_intransit.html.ep new file mode 100644 index 0000000..a044917 --- /dev/null +++ b/templates/add_intransit.html.ep @@ -0,0 +1,93 @@ +<h1>Manuell einchecken</h1> +% if ($error) { + <div class="row"> + <div class="col s12"> + <div class="card caution-color"> + <div class="card-content white-text"> + <span class="card-title">Ungültige Eingabe</span> + <p><%= $error %></p> + </div> + </div> + </div> + </div> +% } +<div class="row"> + <div class="col s12"> + <p> + Falls die gesuchte Abfahrt nicht vom ausgewählten Backend verfügbar ist, z.B. da es sich um eine Sonderfahrt handelt, ist hier ein manueller Checkin möglich. + Nach dem Checkin werden alle Daten so beibehalten wie sie eingegeben wurden; Änderungen sind erst nach dem Auschecken möglich. + </p> + <ul> + <li>Eingabe der Fahrt als „Typ Linie Nummer“ oder „Typ Nummer“, z.B. + „ICE 100“, „S 1 31133“ oder „ABR RE11 26720“</li> + <li>Wenn Nummer nicht bekannt oder vorhanden: einen beliebigen Integer eintragen, z.B. „S 5X 0“ oder „U 11 0“</li> + <li>Zeitangaben im Format YYYY-MM-DDTHH:MM. Bei den Zwischenhalten kann auch nur HH:MM angegeben werden</li> + <li>Das ausgewählte Backend bestimmt die verfügbaren Halte für Start, Ziel und Route. Siehe auch <a href="/static/stops.csv">stops.csv</a></li> + </ul> + </div> +</div> +<div class="row"> + <div class="col s12 center-align"> + % if (current_user->{backend_id}) { + <a href="/account/select_backend?redirect_to=/checkin/add" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= current_user->{backend_name} %></a> + % } + % else { + <a href="/account/select_backend?redirect_to=/checkin/add" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">train</i>IRIS</a> + % } + </div> +</div> +%= form_for '/checkin/add' => (method => 'POST') => begin + %= csrf_field + <div class="row"> + <div class="input-field col s12"> + %= text_field 'train', id => 'train', class => 'validate', required => undef, pattern => '[0-9a-zA-Z]+ +[0-9a-zA-Z]* *[0-9]+' + <label for="train">Fahrt (Typ Linie Nummer)</label> + </div> + </div> + <div class="row"> + <div class="input-field col s12"> + %= text_field 'dep_station', id => 'dep_station', class => 'autocomplete validate', autocomplete => 'off', required => undef + <label for="dep_station">Start (Name oder ID)</label> + </div> + <div class="input-field col s12"> + %= datetime_field 'sched_departure', id => 'sched_departure', class => 'validate', required => undef + <label for="sched_departure" class="active">Geplante Abfahrt</label> + </div> + </div> + <div class="row"> + <div class="input-field col s12"> + %= text_field 'arr_station', id => 'arr_station', class => 'autocomplete validate', autocomplete => 'off', required => undef + <label for="arr_station">Ziel (Name oder ID)</label> + </div> + <div class="input-field col s12"> + %= datetime_field 'sched_arrival', id => 'sched_arrival', class => 'validate', required => undef + <label for="sched_arrival" class="active">Geplante Ankunft</label> + </div> + </div> + <div class="row"> + <div class="input-field col s12"> + %= text_area 'route', id => 'route', class => 'materialize-textarea' + <label for="route">Halte (optional)</label><br/> + Eine Station pro Zeile, wahlweise Unterwegshalte oder komplette Route<br/> + Format: <i>Name</i> oder <i>Name</i> @ <i>Zeitpunkt</i> (Format siehe oben, ein ggf. ausgelassenes Datum wird ergänzt) + </div> + </div> + <div class="row"> + <div class="input-field col s12"> + %= text_field 'comment' + <label for="comment">Kommentar</label> + </div> + </div> + <div class="row"> + <div class="col s3 m3 l3"> + </div> + <div class="col s6 m6 l6 center-align"> + <button class="btn waves-effect waves-light" type="submit" name="action" value="save"> + Einchecken + <i class="material-icons right">send</i> + </button> + </div> + <div class="col s3 m3 l3"> + </div> + </div> +%= end diff --git a/templates/add_journey.html.ep b/templates/add_journey.html.ep index c543781..94f9270 100644 --- a/templates/add_journey.html.ep +++ b/templates/add_journey.html.ep @@ -33,10 +33,22 @@ <li>Eingabe der Fahrt als „Typ Linie Nummer“ oder „Typ Nummer“, z.B. „ICE 100“, „S 1 31133“ oder „ABR RE11 26720“</li> <li>Wenn Nummer nicht bekannt oder vorhanden: einen beliebigen Integer eintragen, z.B. „S 5X 0“ oder „U 11 0“</li> - <li>Zeitangaben im Format DD.MM.YYYY HH:MM</li> + <li>Zeitangaben im Format YYYY-MM-DDTHH:MM</li> + <li>Das ausgewählte Backend bestimmt die verfügbaren Halte für Start, Ziel und Route. Siehe auch <a href="/static/stops.csv">stops.csv</a></li> </ul> </div> </div> +<div class="row"> + <div class="col s12 center-align"> + % my $self_link = url_for('add_journey'); + % if (current_user->{backend_id}) { + <a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= current_user->{backend_name} %></a> + % } + % else { + <a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">train</i>IRIS</a> + % } + </div> +</div> %= form_for '/journey/add' => (method => 'POST') => begin %= csrf_field <div class="row"> @@ -54,35 +66,37 @@ <div class="row"> <div class="input-field col s12"> %= text_field 'dep_station', id => 'dep_station', class => 'autocomplete validate', autocomplete => 'off', required => undef - <label for="dep_station">Start (Name oder DS100)</label> + <label for="dep_station">Start (Name oder ID)</label> </div> <div class="input-field col s12"> - %= text_field 'sched_departure', id => 'sched_departure', class => 'validate', required => undef, pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]' - <label for="sched_departure">Geplante Abfahrt</label> + %= datetime_field 'sched_departure', id => 'sched_departure', class => 'validate', required => undef + <label for="sched_departure" class="active">Geplante Abfahrt</label> </div> <div class="input-field col s12"> - %= text_field 'rt_departure', id => 'rt_departure', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]' - <label for="rt_departure">Tatsächliche Abfahrt (wenn leer: pünktlich)</label> + %= datetime_field 'rt_departure', id => 'rt_departure', class => 'validate' + <label for="rt_departure" class="active">Tatsächliche Abfahrt (wenn leer: pünktlich)</label> </div> </div> <div class="row"> <div class="input-field col s12"> %= text_field 'arr_station', id => 'arr_station', class => 'autocomplete validate', autocomplete => 'off', required => undef - <label for="arr_station">Ziel (Name oder DS100)</label> + <label for="arr_station">Ziel (Name oder ID)</label> </div> <div class="input-field col s12"> - %= text_field 'sched_arrival', id => 'sched_arrival', class => 'validate', required => undef, pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]' - <label for="sched_arrival">Geplante Ankunft</label> + %= datetime_field 'sched_arrival', id => 'sched_arrival', class => 'validate', required => undef + <label for="sched_arrival" class="active">Geplante Ankunft</label> </div> <div class="input-field col s12"> - %= text_field 'rt_arrival', id => 'rt_arrival', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]' - <label for="rt_arrival">Tatsächliche Ankunft (wenn leer: pünktlich)</label> + %= datetime_field 'rt_arrival', id => 'rt_arrival', class => 'validate' + <label for="rt_arrival" class="active">Tatsächliche Ankunft (wenn leer: pünktlich)</label> </div> </div> <div class="row"> <div class="input-field col s12"> %= text_area 'route', id => 'route', class => 'materialize-textarea' - <label for="route">Unterwegshalte (optional, eine Station pro Zeile, DS100 möglich)</label> + <label for="route">Halte (optional)</label><br/> + Eine Station pro Zeile, wahlweise Unterwegshalte oder komplette Route<br/> + Format: <i>Name</i> oder <i>Name</i> @ <i>Zeitpunkt</i> (inkl. Datum, siehe oben) </div> </div> <div class="row"> diff --git a/templates/api_documentation.html.ep b/templates/api_documentation.html.ep index 9c9ee1f..099474c 100644 --- a/templates/api_documentation.html.ep +++ b/templates/api_documentation.html.ep @@ -30,12 +30,18 @@ "actionTime" : 1234567, (UNIX-Timestamp des letzten Checkin/Checkout)<br/> "checkedIn" : true / false,<br/> "comment": "Kommentar",<br/> + "backend": {<br/> + "id": 1,<br/> + "name": "DB",<br/> + "type": "HAFAS",<br/> + },<br/> "fromStation" : { (letzter Checkin)<br/> "name" : "Essen Hbf",<br/> "ds100" : "EE", (ggf. null)<br/> "uic" : 8000098,<br/> "latitude" : 51.451355,<br/> "longitude" : 7.014793,<br/> + "platform" : "12", (ggf. null)<br/> "scheduledTime": 1556083680,<br/> "realTime": 1556083680<br/> },<br/> @@ -45,6 +51,7 @@ "uic" : 8001896,<br/> "latitude" : 51.422853,<br/> "longitude" : 7.023296,<br/> + "platform" : "2", (ggf. null)<br/> "scheduledTime": 1556083980, (ggf. null)<br/> "realTime": 1556083980 (ggf. null)<br/> },<br/> @@ -122,11 +129,13 @@ {<br/> "token" : "<%= $uid %>-<%= $token->{travel} // 'TOKEN' %>",<br/> "action" : "checkin",<br/> + "dbris" : "bahn.de", (DBRIS-Instanz – Default: bahn.de)<br/> + "hafas" : null, (HAFAS-Instanz, falls verwendet, sonste null)<br/> "train" : {<br/> - "journeyID" : "1|1426396|4|80|19082023",<br/> + "journeyID" : "2|#VN#1#ST#1742845592#PI#0#ZI#315136#TA#0#DA#270325#1S#8000080#1T#1841#LS#8006486#LT#2024#PU#80#RT#1#CA#RE#ZE#10773#ZB#RE10773#PC#3#FR#8000080#FT#1841#TO#8006486#TT#2024#",<br/> }<br/> - "fromStation" : 651806, (Name oder EVA-Nummer)<br/> - "toStation" : 654645, (optional, Name oder EVA-Nummer)<br/> + "fromStation" : 8000080, (Name oder EVA-Nummer – bei bahn.de nur EVA-Nummer)<br/> + "toStation" : 8006486, (optional, Name oder EVA-Nummer – bei bahn.de nur EVA-Nummer)<br/> "comment" : "Beliebiger Text" (optional, überschreibt vorherigen Kommentar)<br/> } </p> diff --git a/templates/bad_gateway.html.ep b/templates/bad_gateway.html.ep new file mode 100644 index 0000000..07bf29e --- /dev/null +++ b/templates/bad_gateway.html.ep @@ -0,0 +1,27 @@ +<div class="row"> + <div class="col s12"> + <div class="card caution-color"> + <div class="card-content white-text"> + <span class="card-title">502 Bad Gateway</span> + <p> + Das von travelynx genutzte Backend hat einen Fehler zurückgegeben. + travelynx hat keine Möglichkeiten, diese Situation zu beheben. + % if (stash('select_new_backend')) { + Versuche es in ein paar Sekunden bis Minuten noch einmal oder <a href="/account/select_backend">wähle ein anderes Backend</a>. + % } + % else { + Versuche es in ein paar Sekunden bis Minuten noch einmal. + % } + </p> + </div> + </div> + </div> +</div> +<div class="row"> + <div class="col s12"> + <p>Details:</p> + <p style="font-family: monospace;"> + %= $message + </p> + </div> +</div> diff --git a/templates/cancelled.html.ep b/templates/cancelled.html.ep index 4fab434..fe0b958 100644 --- a/templates/cancelled.html.ep +++ b/templates/cancelled.html.ep @@ -1,7 +1,7 @@ -<h1>Zugausfälle</h1> +<h1>Ausfälle</h1> <div class="row"> <div class="col s12"> - Die folgenden Zugfahrten haben nicht stattgefunden. + Die folgenden Fahrten haben nicht wie geplant stattgefunden. </div> </div> diff --git a/templates/changelog.html.ep b/templates/changelog.html.ep index 09126a8..042a46e 100644 --- a/templates/changelog.html.ep +++ b/templates/changelog.html.ep @@ -2,6 +2,287 @@ <div class="row"> <div class="col s12 m1 l1"> + 2.17 + </div> + <div class="col s12 m11 l11"> + <p> + <i class="material-icons left" aria-label="<%= L('changelog.added') %>">add</i> + %= L('changelog.2-17.1') + </p> + </div> +</div> + +<div class="row"> + <div class="col s12 m1 l1"> + 2.16 + </div> + <div class="col s12 m11 l11"> + <p> + <i class="material-icons left" aria-label="<%= L('changelog.added') %>">add</i> + %= L('changelog.2-16.1') + </p> + <p> + <i class="material-icons left" aria-label="<%= L('changelog.bugfix') %>">build</i> + %= L('changelog.2-16.2') + </p> + </div> +</div> + +<div class="row"> + <div class="col s12 m1 l1"> + 2.15 + </div> + <div class="col s12 m11 l11"> + <p> + <i class="material-icons left" aria-label="Neues Feature">add</i> + Manuelle Checkins. Diese verhalten sich analog zu manuell + eingetragenen Fahrten, werden jedoch bis zur planmäßigen + Ankunftszeit als Checkin behandelt. Manuelle Echtzeitdaten-Updates + werden nicht unterstützt. Manuelle Checkins sind nur an Halten + möglich, die dem ausgewählten Backend bekannt sind. Ggf. wird + dieses Feature später um eine Möglichkeit für Echtzeitdaten-Updates + und/oder eine API erweitert. + </p> + <p> + <i class="material-icons left" aria-label="Neues Feature">add</i> + Erfassung des Betreibers einer Fahrt, sofern verfügbar. + </p> + <p> + <i class="material-icons left" aria-label="Verbesserung">star</i> + EFA-Backends werden nun fast vollständig unterstützt und sind nicht + mehr experimentell. + </p> + <p> + <i class="material-icons left" aria-label="Bugfix">build</i> + Das manuelle Eintragen von Fahrten ist nun wieder möglich. Zudem + kann dabei nun ein beliebiges Backend ausgewählt werden; das + ausgewählte Backend bestimmt die verfügbaren Halte. + </p> + </div> +</div> + +<div class="row"> + <div class="col s12 m1 l1"> + 2.14 + </div> + <div class="col s12 m11 l11"> + <p> + <i class="material-icons left" aria-label="Neues Feature">add</i> + Experimentelle Unterstützung für Checkins via EFA-Backends. + Teilweise ist ein Checkin nur bei Fahrten mit Echtzeitdaten + möglich. Hierbei handelt es sich nach aktuellem Stand um eine + Einschränkung der verwendeten Backends. Unterstützung für + ausfallende Fahrten folgt später. + </p> + </div> +</div> + +<div class="row"> + <div class="col s12 m1 l1"> + 2.13 + </div> + <div class="col s12 m11 l11"> + <p> + <i class="material-icons left" aria-label="Neues Feature">add</i> + Experimentelle Unterstützung für Checkins via MOTIS-Backends + (derzeit transitous und RNV). Vielen Dank an <a href="https://github.com/networkException">networkException</a> + für die Implementierung der API und Einbindung in travelynx. + Träwelling-Synchronisierung ist noch nicht wiederhergestellt. + Time zones are currently somewhat wibbly-wobbly timey-wimey. + </p> + </div> +</div> + +<div class="row"> + <div class="col s12 m1 l1"> + 2.12 + </div> + <div class="col s12 m11 l11"> + <p> + <i class="material-icons left" aria-label="Neues Feature">add</i> + Kartografische Visualisierung der Route bei eigenen Checkins und auf + der Statusseite sowie Angaben zu Meldungen, Rollmaterial, Route und + Auslastung auf der Statusseite. Feinheiten wie die Markierung der + geschätzten aktuellen Zugposition oder eine regelmäßige + Aktualisierung ohne Zurücksetzen der Kartenansicht folgen später. + Die Kartenlinks zu dbf.finalrewind.org entfallen. + </p> + <p> + <i class="material-icons left" aria-label="Ankündigung">announcement</i> + Das IRIS-TTS-Backend der Deutschen Bahn wird wegen zunehmend + schlechter Datenanreicherunngsmöglichkeiten nicht mehr + weiterentwickelt. Bei Checkins per IRIS-TTS stehen regelmäßig keine + Echtzeitdaten und insbesondere bei Nebenbahnen auch keine + Kartendaten zur Verfügung. In diesem Fall fehlt auch die + ersatzwiese Visualisierung der Luftlinie zwischen den + Unterwegshalten. Dies betrifft auch die Visualisierung in der + Fahrtenkarte. + </p> + <p> + <i class="material-icons left" aria-label="Ankündigung">announcement</i> + Derzeit besteht wegen inkompatibler Backends keine + Synchronisierungsmöglichkeit zwischen Träwelling (transitous MOTIS) + und travelynx (DB IRIS-TTS / DB HAFAS / bahn.de). + MOTIS-Unterstützung in travelynx ist in Arbeit. + </p> + </div> +</div> + +<div class="row"> + <div class="col s12 m1 l1"> + 2.11 + </div> + <div class="col s12 m11 l11"> + <p> + <i class="material-icons left" aria-label="Neues Feature">add</i> + Neues Backend: bahn.de. Somit steht nach Abschaltung von DB HAFAS + und VRN HAFAS wieder ein Backend zur Verfügung, welches für + innerdeutschen Nah-, Regional- und Fernverkehr geeignet ist und + eine Synchronisierung mit Träwelling unterstützt. Teile der + Implementierung können noch unvollständig sein. Ebenso besteht die + Möglichkeit, dass es wegen Rate Limits auf Seiten von bahn.de nicht + immer zuverlässig nutzbar ist. + </p> + </div> +</div> + +<div class="row"> + <div class="col s12 m1 l1"> + 2.10 + </div> + <div class="col s12 m11 l11"> + <p> + <i class="material-icons left" aria-label="Neues Feature">add</i> + Neue HAFAS-Backends: PKP, SaarVV. + </p> + <p> + <i class="material-icons left" aria-label="Bug">warning</i> Das DB + HAFAS-Backend wurde am 8. Januar 2025 abgeschaltet und wird von + travelynx daher seit v2.9.11 nicht mehr angeboten. Als vorläufiger + Ersatz bietet sich das VRN HAFAS-Backend an. Eine Wieder-Anbindung + der DB mittels Travel::Status::DE::DBRIS ist in Arbeit. Bis dahin + ist keine Synchronisierung mit Traewelling möglich. + </p> + <p> + <i class="material-icons left" aria-label="Administration">announcement</i> + Das PKP HAFAS befindet sich hinter einem GeoIP-Filter und wird + daher in travelynx-Installationen außerhalb von travelynx.de + standardmäßig nicht angeboten. Sofern die travelynx-Instanz auf + einer geeigneten IP-Adresse betrieben wird oder eine solche per + Proxy erreichbar ist, lässt es sich über einen Eintrag in + travelynx.conf aktivieren. Als Nebenwirkung davon kann auch auf + beliebige andere HAFAS-Instanzen bei Bedarf über einen + Instanz-spezifischen Proxy zugegriffen werden. + </p> + </div> +</div> + +<div class="row"> + <div class="col s12 m1 l1"> + 2.9 + </div> + <div class="col s12 m11 l11"> + <p> + <i class="material-icons left" aria-label="Neues Feature">add</i> + Neue HAFAS-Backends: BVG, KVB, mobiliteit, RMV, RSAG, STV, VMT, + VOS, VRN, ZVV. + </p> + <p> + <i class="material-icons left" aria-label="Bugfix">build</i> + HAFAS-Backends: verbesserte Unterstützung für Ringlinien. + </p> + <p> + <i class="material-icons left" aria-label="Bugfix">build</i> + Verbesserte Unterstützung für uneindeutige Stationsnamen. Berlin + Hbf ist beispielsweise intern in „Berlin Hbf“ (Gleise 1 bis 8), + „Berlin Hbf“ (Gleise 11 bis 14) und „Berlin Hbf (S-Bahn)“ (Gleise + 15 und 16) getrennt. Teile von travelynx gingen in der + Vergangenheit fälschlich davon aus, dass es keine Stationen mit + identischen Namen, aber unterschiedlichen internen IDs gebe. + Dies hat u.a. bei Fahrten von/nach Berlin Hbf und innerhalb von + Karlsruhe zu interessanten Bugs geführt. + </p> + <p> + <i class="material-icons left" aria-label="Bug">warning</i> + Reisen, die in travelynx 2.8.0 bis 2.8.30 mittels IRIS-Backend + geloggt wurden, können in Einzelfällen fehlerhafte Stationsangaben + enthalten. Der Bug betrifft alle Fahrten von/zu Stationen, die in + der von travelynx genutzten Stationsdatenbank zum Checkin-Zeitpunkt + nicht bekannt waren. Eine nachträgliche Korrektur dieser Fahrten + folgt ggf. in einem späteren Release. + </p> + <p> + <i class="material-icons left" aria-label="Administration">announcement</i> + travelynx verlinkt bei Registrierung und Anmeldung nun + instanzspezifische <a href="/tos">Nutzungsbedingungen</a>. Admins + sollten beim Update auf diese Version + templates/terms-of-service.html.ep anlegen. Die Nutzungsbedingungen + können beispielsweise Richtlinien für die Freitexte in + Checkin-Kommentaren und auf der Profilseite vorgeben oder + allgemeine Hinweise und Bedingungen zur Verfügbarkeit der + jeweiligen Instanz beinhalten. + </p> + </div> +</div> + +<div class="row"> + <div class="col s12 m1 l1"> + 2.8 + </div> + <div class="col s12 m11 l11"> + <p> + <i class="material-icons left" aria-label="Neues Feature">add</i> + Unterstützung von HAFAS-Backends abseits der Deutschen Bahn. Somit + sind zumeist akkurate Echtzeit- und Routendaten für Checkins u.a. + in Aachen, Berlin/Brandenburg, Hessen, Sachsen-Anhalt, + Schleswig-Holstein, Österreich und der Schweiz verfügbar. + Das Backend muss vor dem Checkin explizit ausgewählt werden. + Eine Synchronisierung mit Traewelling wird nur für DB (IRIS-TTS) – + vormals „Schienenverkehr“ – und DB (HAFAS) – vormals „Nahverkehr“ – + durchgeführt. Manuell eingetragene Fahrten sind vorerst ebenfalls + auf DB (HAFAS) beschränkt. + </p> + <p> + <i class="material-icons left" aria-label="Ankündigung">announcement</i> + Stationssuche und Verbindungsvorschläge berücksichtigen nur noch + das ausgewählte Backend. Die bisherige Verknüpfung von DB (IRIS-TTS) + und DB (HAFAS) entfällt. + </p> + </div> +</div> + +<div class="row"> + <div class="col s12 m1 l1"> + 2.7 + </div> + <div class="col s12 m11 l11"> + <p> + <i class="material-icons left" aria-label="Verbesserung">star</i> + Checkins via Nahverkehr (HAFAS) speichern nun Polylines (Routen für + die Fahrtenkarte) und Wagenreihungen, sofern verfügbar. Sie sind + damit fast identisch zu Checkins via Schienenverkehr (IRIS); es + fehlen im Wesentlichen lediglich die mit Zeitstempel versehenen + Verspätungs- und Störungsmeldungen. + <p/> + <p> + <i class="material-icons left" aria-label="Bugfix">build</i> + Verbesserte (aber weiterhin nicht perfekte) Unterstützung für + Ringlinien. + </p> + <p> + <i class="material-icons left" aria-label="Bugfix">build</i> + Korrekte Verlinkung von HAFAS-basierten Abfahrtstafeln bei den + Unterwegshalten des aktuellen Checkins im Nahverkehrsmodus. Die + Konfigurationsmöglichkeit zur Auswahl zwischen bahn.expert und DBF + unter Account → Externe Dienste besteht wegen der Abhängigkeit des + Diensts vom genutzten Backend und zwecks besserer Wartbarkeit von + travelynx nun nicht mehr. + </p> + </div> +</div> + +<div class="row"> + <div class="col s12 m1 l1"> 2.6 </div> <div class="col s12 m11 l11"> diff --git a/templates/departures.html.ep b/templates/departures.html.ep index 6aac482..6df48a8 100644 --- a/templates/departures.html.ep +++ b/templates/departures.html.ep @@ -1,26 +1,33 @@ <div class="row"> - <div class="col s12"> - <h2> - <i class="material-icons " aria-hidden="true"><%= param('hafas') ? 'directions' : 'train' %></i> + <div class="col s8"> + <strong style="font-size: 120%;"> <%= $station %> - </h2> + </strong> % for my $related_station (sort { $a->{name} cmp $b->{name} } @{$related_stations}) { + <%= $related_station->{name} %> <br/> % } </div> -</div> -% if ($api_link) { -<div class="row"> - <div class="col s12 center-align"> - % if (param('hafas')) { - <a href="<%= $api_link %>" class="btn-small"><i class="material-icons left" aria-hidden="true">train</i>zum Schienenverkehr</a> - % } - % else { - <a href="<%= $api_link %>" class="btn-small"><i class="material-icons left" aria-hidden="true">directions</i>zum Nahverkehr</a> - % } + <div class="col s4 center-align"> + % my $self_link = url_for('sstation', station => $station // param('station')); + % if (param('dbris')) { + <a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= param('dbris') %></a> + % } + % elsif (param('hafas')) { + <a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= param('hafas') %></a> + % } + % elsif (param('motis')) { + <a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= param('motis') %></a> + % } + % else { + % if ($user->{backend_id}) { + <a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= $user->{backend_name} %></a> + % } + % else { + <a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">train</i>IRIS</a> + % } + % } </div> </div> -% } % my $have_connections = 0; % if ($user_status->{checked_in}) { @@ -29,7 +36,13 @@ <div class="card"> <div class="card-content"> <span class="card-title">Aktuell eingecheckt</span> - <p>In <%= $user_status->{train_type} %> <%= $user_status->{train_no} %> + <p>In + % if ( not $user_status->{is_motis} ) { + <%= $user_status->{train_type} %> + % } + + <%= $user_status->{train_line} // $user_status->{train_no} %> + % if ( $user_status->{arr_name}) { von <%= $user_status->{dep_name} %> nach <%= $user_status->{arr_name} %> % } @@ -40,10 +53,10 @@ </div> <div class="card-action"> % if ($can_check_out) { - <a class="action-undo" data-id="in_transit" data-checkints="<%= $user_status->{timestamp}->epoch %>" style="margin-right: 0;"> + <a class="action-undo" data-hafas="<%= param('hafas') // q{} %>" data-id="in_transit" data-checkints="<%= $user_status->{timestamp}->epoch %>" style="margin-right: 0;"> <i class="material-icons left" aria-hidden="true">undo</i> Rückgängig </a> - <a class="action-checkout right" data-station="<%= $eva %>" data-force="1"> + <a class="action-checkout right" data-hafas="<%= param('hafas') // q{} %>" data-station="<%= $eva %>" data-force="1"> Hier auschecken </a> % } @@ -51,7 +64,7 @@ <a class="action-undo" data-id="in_transit" data-checkints="<%= $user_status->{timestamp}->epoch %>" style="margin-right: 0;"> <i class="material-icons left" aria-hidden="true">undo</i> Rückgängig </a> - <a class="action-checkout right" data-station="<%= $eva %>" data-force="1"> + <a class="action-checkout right" data-hafas="<%= param('hafas') // q{} %>" data-station="<%= $eva %>" data-force="1"> <i class="material-icons left" aria-hidden="true">gps_off</i> Hier auschecken </a> @@ -92,8 +105,8 @@ <div class="row"> <div class="col s4 center-align"> - % if ($hafas) { - <a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({hafas => 1, timestamp => $datetime->clone->subtract(hours => 1)->epoch}) %>"><i class="material-icons left" aria-hidden="true">chevron_left</i><span class="hide-on-small-only">früher</span></a> + % if ($dbris or $efa or $hafas or $motis) { + <a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({dbris => $dbris, hafas => $hafas, timestamp => $datetime->clone->subtract(hours => 1)->epoch}) %>"><i class="material-icons left" aria-hidden="true">chevron_left</i><span class="hide-on-small-only">früher</span></a> % } </div> <div class="col s4 center-align"> @@ -102,8 +115,8 @@ % } </div> <div class="col s4 center-align"> - % if ($hafas) { - <a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({hafas => 1, timestamp => $datetime->clone->add(hours => 1)->epoch}) %>"><span class="hide-on-small-only">später</span><i class="material-icons right" aria-hidden="true">chevron_right</i></a> + % if ($dbris or $efa or $hafas or $motis) { + <a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({dbris => $dbris, hafas => $hafas, timestamp => $datetime->clone->add(hours => 1)->epoch}) %>"><span class="hide-on-small-only">später</span><i class="material-icons right" aria-hidden="true">chevron_right</i></a> % } </div> </div> @@ -133,13 +146,28 @@ Fahrt auswählen zum Einchecken. % } % else { - Keine Abfahrten gefunden. Ein Checkin ist frühestens 30 Minuten vor - und maximal 120 Minuten nach Abfahrt möglich. + % if ($dbris or $hafas) { + Keine Abfahrten im ausgewählten Zeitfenster + (<%= $datetime->strftime('%d.%m.%Y %H:%M') %> ± 30min). + % } + % else { + Keine Abfahrten gefunden. Ein Checkin ist frühestens 30 Minuten vor + und maximal 120 Minuten nach Abfahrt möglich. + % } % } </p> % if (not $user_status->{checked_in} or ($can_check_out and $user_status->{arr_eva} and $user_status->{arrival_countdown} <= 0)) { - % if ($hafas) { - %= include '_departures_hafas', results => $results; + % if ($dbris) { + %= include '_departures_dbris', results => $results, dbris => $dbris; + % } + % elsif ($efa) { + %= include '_departures_efa', results => $results, efa => $efa; + % } + % elsif ($hafas) { + %= include '_departures_hafas', results => $results, hafas => $hafas; + % } + % elsif ($motis) { + %= include '_departures_motis', results => $results, motis => $motis; % } % else { %= include '_departures_iris', results => $results; @@ -147,3 +175,26 @@ % } </div> </div> + +<div class="row"> + <div class="col s4 center-align"> + % if ($dbris or $efa or $hafas or $motis) { + <a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({dbris => $dbris, hafas => $hafas, timestamp => $datetime->clone->subtract(hours => 1)->epoch}) %>"><i class="material-icons left" aria-hidden="true">chevron_left</i><span class="hide-on-small-only">früher</span></a> + % } + </div> + <div class="col s4 center-align"> + </div> + <div class="col s4 center-align"> + % if ($dbris or $efa or $hafas or $motis) { + <a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({dbris => $dbris, hafas => $hafas, timestamp => $datetime->clone->add(hours => 1)->epoch}) %>"><span class="hide-on-small-only">später</span><i class="material-icons right" aria-hidden="true">chevron_right</i></a> + % } + </div> +</div> + +% if (not $user_status->{checked_in}) { + <div class="row"> + <div class="col s12 center-align"> + <a class="btn-small" href="<%= url_for('checkinadd')->query({dbris => $dbris, efa => $efa, hafas => $hafas, motis => $motis, dep_station => $station}) %>"><i class="material-icons left" aria-hidden="true">add</i><span>manuell einchecken</span></a> + </div> + </div> +% } diff --git a/templates/disambiguation.html.ep b/templates/disambiguation.html.ep index 270aa99..af7d1dd 100644 --- a/templates/disambiguation.html.ep +++ b/templates/disambiguation.html.ep @@ -13,7 +13,7 @@ <div class="col s12"> <ul class="suggestions"> % for my $suggestion (@{$suggestions // []}) { - <li><a href="<%= url_for('station' => $suggestion->{eva}) . (param('hafas') ? '?hafas=1' : q{}) %>"><%= $suggestion->{name} %></a></li> + <li><a href="<%= url_for('station' => $suggestion->{eva}) . (param('hafas') ? '?hafas=' . param('hafas') : q{}) %>"><%= $suggestion->{name} %></a></li> % } </ul> </div> diff --git a/templates/edit_journey.html.ep b/templates/edit_journey.html.ep index cb867e5..57941c0 100644 --- a/templates/edit_journey.html.ep +++ b/templates/edit_journey.html.ep @@ -69,13 +69,13 @@ <tr> <th scope="row">Geplante Abfahrt</th> <td class="input-field"> - %= text_field 'sched_departure', id => 'sched_departure', class => 'validate', required => undef, pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]' + %= text_field 'sched_departure', id => 'sched_departure', class => 'validate', required => undef, pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9](:[0-9][0-9])?' </td> </tr> <tr> <th scope="row">Tatsächliche Abfahrt</th> <td class="input-field"> - %= text_field 'rt_departure', id => 'real_departure', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]' + %= text_field 'rt_departure', id => 'real_departure', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9](:[0-9][0-9])?' </td> </tr> <tr> @@ -87,13 +87,13 @@ <tr> <th scope="row">Geplante Ankunft</th> <td class="input-field"> - %= text_field 'sched_arrival', id => 'sched_arrival', class => 'validate', required => undef, pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]' + %= text_field 'sched_arrival', id => 'sched_arrival', class => 'validate', required => undef, pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9](:[0-9][0-9])?' </td> </tr> <tr> <th scope="row">Tatsächliche Ankunft</th> <td class="input-field"> - %= text_field 'rt_arrival', id => 'real_arrival', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]' + %= text_field 'rt_arrival', id => 'real_arrival', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9](:[0-9][0-9])?' </td> </tr> <tr> diff --git a/templates/exception.html.ep b/templates/exception.html.ep index ec01ad2..9b8697c 100644 --- a/templates/exception.html.ep +++ b/templates/exception.html.ep @@ -20,8 +20,15 @@ Timestamp: %= DateTime->now(time_zone => 'Europe/Berlin')->strftime("%d/%b/%Y:%H:%M:%S %z") <br/><br/> - Message: - %= ref($exception) ? (split(qr{\n}, $exception->message))[0] : $exception + % if (ref($exception)) { + Trace:<br/> + % for my $line (split(qr{\n}, $exception->message)) { + <%= $line %><br/> + % } + % } + % else { + Message: <%= $exception %> + % } </p> </div> </div> diff --git a/templates/gateway_timeout.html.ep b/templates/gateway_timeout.html.ep new file mode 100644 index 0000000..9cf8690 --- /dev/null +++ b/templates/gateway_timeout.html.ep @@ -0,0 +1,27 @@ +<div class="row"> + <div class="col s12"> + <div class="card caution-color"> + <div class="card-content white-text"> + <span class="card-title">504 Gateway Timeout</span> + <p> + Das von travelynx genutzte Backend hat nicht rechtzeitig reagiert. + travelynx hat keine Möglichkeiten, diese Situation zu beheben. + % if (stash('select_new_backend')) { + Versuche es in ein paar Sekunden bis Minuten noch einmal oder <a href="/account/select_backend">wähle ein anderes Backend</a>. + % } + % else { + Versuche es in ein paar Sekunden bis Minuten noch einmal. + % } + </p> + </div> + </div> + </div> +</div> +<div class="row"> + <div class="col s12"> + <p>Details:</p> + <p style="font-family: monospace;"> + %= $message + </p> + </div> +</div> diff --git a/templates/history_by_month.html.ep b/templates/history_by_month.html.ep index 9ad7031..dec4c8b 100644 --- a/templates/history_by_month.html.ep +++ b/templates/history_by_month.html.ep @@ -4,6 +4,12 @@ %= include '_history_stats', stats => stash('statistics'); % } +<div class="row"> + <div class="col s12 m12 l12 center-align"> + <a href="/history/map?filter_from=<%= $filter_from->strftime('%F') %>&filter_to=<%= $filter_to->strftime('%F') %>" class="waves-effect waves-light btn"><i class="material-icons left" aria-hidden="true">map</i> Karte</a> + </div> +</div> + % if (stash('journeys')) { %= include '_history_trains', date_format => '%d.%m.', journeys => stash('journeys'); % } diff --git a/templates/history_by_year.html.ep b/templates/history_by_year.html.ep index 6aa0c2d..1557b77 100644 --- a/templates/history_by_year.html.ep +++ b/templates/history_by_year.html.ep @@ -7,7 +7,7 @@ <div class="row"> % if (stash('have_review')) { <div class="col s12 m12 l5 center-align"> - <a href="/history/map?filter_from=1.1.<%= $year %>&filter_to=31.12.<%= $year %>" class="waves-effect waves-light btn"><i class="material-icons left" aria-hidden="true">map</i> Karte</a> + <a href="/history/map?filter_from=<%= $year %>-01-01&filter_to=<%= $year %>-12-31" class="waves-effect waves-light btn"><i class="material-icons left" aria-hidden="true">map</i> Karte</a> </div> <div class="col s12 m12 l2"> </div> <div class="col s12 m12 l5 center-align"> @@ -16,7 +16,7 @@ % } % else { <div class="col s12 m12 l12 center-align"> - <a href="/history/map?filter_from=1.1.<%= $year %>&filter_to=31.12.<%= $year %>" class="waves-effect waves-light btn"><i class="material-icons left" aria-hidden="true">map</i> Karte</a> + <a href="/history/map?filter_from=<%= $year %>-01-01&filter_to=<%= $year %>-12-31" class="waves-effect waves-light btn"><i class="material-icons left" aria-hidden="true">map</i> Karte</a> </div> % } </div> diff --git a/templates/history_map.html.ep b/templates/history_map.html.ep index 57ba81f..6620cb2 100644 --- a/templates/history_map.html.ep +++ b/templates/history_map.html.ep @@ -88,14 +88,14 @@ </p> <div class="row"> <div class="input-field col s12"> - %= text_field 'filter_from', id => 'filter_from', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9]( +[0-9][0-9]:[0-9][0-9])?' - <label for="filter_from">Abfahrt ab (DD.MM.YYYY)</label> + %= date_field 'filter_from', id => 'filter_from', class => 'validate' + <label for="filter_from" class="active">Abfahrt ab</label> </div> </div> <div class="row"> <div class="input-field col s12"> - %= text_field 'filter_to', id => 'filter_to', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9]( +[0-9][0-9]:[0-9][0-9])?' - <label for="filter_to">Abfahrt bis (DD.MM.YYYY)</label> + %= date_field 'filter_to', id => 'filter_to', class => 'validate' + <label for="filter_to" class="active">Abfahrt bis</label> </div> </div> <div class="row"> @@ -116,8 +116,8 @@ <div class="row"> <div class="col s12"> <p> - Die eingezeichneten Routen stammen aus dem HAFAS und sind im Detail - oft fehlerbehaftet. + Die eingezeichneten Routen stammen aus dem Backend, mit dem die Fahrt aufgezeichnet wurde. + Die Datenqualität variiert. </p> </div> </div> diff --git a/templates/journey.html.ep b/templates/journey.html.ep index f5eebfc..95764eb 100644 --- a/templates/journey.html.ep +++ b/templates/journey.html.ep @@ -3,8 +3,8 @@ <div class="col s12"> <div class="card caution-color"> <div class="card-content white-text"> - <span class="card-title">Fehler</span> - <p>Fahrt nicht gefunden.</p> + <span class="card-title"><%= L('header.error') %></span> + <p><%= L('journey.not-found') %></p> </div> </div> </div> @@ -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> @@ -69,7 +57,7 @@ % } <table class="striped"> <tr> - <th scope="row">Fahrt</th> + <th scope="row"><%= L('journey.trip') %></th> <td> <%= $journey->{type} %> <%= $journey->{no} %> % if ($journey->{line}) { @@ -78,19 +66,48 @@ </td> </tr> <tr> - <th scope="row">Abfahrt</th> + <th scope="row"><%= L('journey.from') %></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"><%= L('journey.to') %></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"><%= L('journey.departure') %></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}->strftime('%H:%M'); - (<%= sprintf('%+d', ($journey->{rt_departure}->epoch - $journey->{sched_departure}->epoch) / 60) %>, - Plan: <%= $journey->{sched_departure}->strftime('%H:%M'); %>) + % elsif ($journey->{delay_dep}) { + %= ($journey->{rt_departure}->epoch % 60) ? $journey->{rt_departure}->strftime('%d.%m.%Y %H:%M:%S') : $journey->{rt_departure}->strftime('%d.%m.%Y %H:%M') + % if (int(abs($journey->{delay_dep}) / 60)) { + (<%= sprintf('%+d', ($journey->{rt_departure}->epoch - $journey->{sched_departure}->epoch) / 60) %>, Plan: + % } + % else { + (Plan: + % } + %= ($journey->{sched_departure}->epoch % 60) ? $journey->{sched_departure}->strftime('%H:%M:%S)') : $journey->{sched_departure}->strftime('%H:%M)') % } % else { - %= $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) { ∗ @@ -98,24 +115,29 @@ </td> </tr> <tr> - <th scope="row">Ankunft</th> + <th scope="row"><%= L('journey.arrival') %></th> <td> % 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}->strftime('%H:%M'); - (<%= sprintf('%+d', ($journey->{rt_arrival}->epoch - $journey->{sched_arrival}->epoch) / 60) %>, - Plan: <%= $journey->{sched_arrival}->strftime('%H:%M'); %>) + % elsif ($journey->{delay_arr}) { + %= ($journey->{rt_arrival}->epoch % 60) ? $journey->{rt_arrival}->strftime('%d.%m.%Y %H:%M:%S') : $journey->{rt_arrival}->strftime('%d.%m.%Y %H:%M') + % if (int(abs($journey->{delay_arr}) / 60)) { + (<%= sprintf('%+d', ($journey->{rt_arrival}->epoch - $journey->{sched_arrival}->epoch) / 60) %>, Plan: + % } + % else { + (Plan: + % } + %= ($journey->{sched_arrival}->epoch % 60) ? $journey->{sched_arrival}->strftime('%H:%M:%S)') : $journey->{sched_arrival}->strftime('%H:%M)') % } % else { - %= $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) { ∗ @@ -123,7 +145,7 @@ </td> </tr> <tr> - <th scope="row">Strecke</th> + <th scope="row"><%= L('journey.distance') %></th> <td> % if ($journey->{skip_route}) { <i class="material-icons right">location_off</i> @@ -131,7 +153,10 @@ % } % if ($journey->{km_route} > 0.1) { ca. <%= sprintf_km($journey->{km_route}) %> - (Luftlinie: <%= sprintf_km($journey->{km_beeline}) %>) + <%= L('journey.beeline.pre') %><%= sprintf_km($journey->{km_beeline}) %><%= L('journey.beeline.post') %> + % } + % elsif ($journey->{km_beeline} > 0.1) { + <%= L('journey.beeline.pre') %><%= sprintf_km($journey->{km_beeline}) %><%= L('journey.beeline.post') %> % } % else { ? @@ -142,7 +167,7 @@ </td> </tr> <tr> - <th scope="row">Tempo</th> + <th scope="row"><%= L('journey.speed') %></th> <td> % if ($journey->{skip_route}) { <i class="material-icons right">location_off</i> @@ -155,14 +180,25 @@ ∗ % } % } + % elsif ($journey->{km_beeline} > 0.1 and $journey->{kmh_beeline} > 0.01) { + (<%= sprintf('%.f', $journey->{kmh_beeline}) %> km/h) + % } % else { ? % } </td> </tr> + % if ($journey->{user_data}{operator} or scalar @{ $journey->{user_data}{operators} // [] }) { + <tr> + <th scope="row"><%= L('journey.operator') %></th> + <td> + %= $journey->{user_data}{operator} // join(q{, }, @{$journey->{user_data}{operators}}) + </td> + </tr> + % } % if ($journey->{messages} and @{$journey->{messages}}) { <tr> - <th scope="row">Meldungen</th> + <th scope="row"><%= L('journey.messages') %></th> <td> % for my $message (@{$journey->{messages} // []}) { % my ($ts, $msg) = @{$message}; @@ -171,9 +207,19 @@ </td> </tr> % } + % if ($journey->{user_data}{him_msg} and @{$journey->{user_data}{him_msg}}) { + <tr> + <th scope="row"><%= L('journey.messages') %></th> + <td> + % for my $message (@{$journey->{user_data}{him_msg} // []}) { + <i class="material-icons tiny"><%= ($message->{prio} and $message->{prio} eq 'HOCH') ? 'warning' : 'info' %></i> <%= $message->{header} %> <%= $message->{lead} %><br/> + % } + </td> + </tr> + % } % if ($journey->{user_data} and $journey->{user_data}{comment}) { <tr> - <th scope="row">Kommentar</th> + <th scope="row"><%= L('journey.comment') %></th> <td> <%= $journey->{user_data}{comment} %> </td> @@ -181,7 +227,7 @@ % } % if ($journey->{user_data} and $journey->{user_data}{wagongroups} and not exists $journey->{user_data}{wagons}) { <tr> - <th scope="row">Rollmaterial</th> + <th scope="row"><%= L('journey.carriages') %></th> <td class="wagons"> %= include '_wagons', wagongroups => $journey->{user_data}{wagongroups}; </td> @@ -189,7 +235,7 @@ % } % elsif ($journey->{user_data} and $journey->{user_data}{wagons}) { <tr> - <th scope="row">Rollmaterial</th> + <th scope="row"><%= L('journey.carriages') %></th> <td class="wagons"> % for my $wagongroup (@{$journey->{user_data}{wagongroups} // []}) { Wagenverbund <%= $wagongroup %><br/> @@ -206,16 +252,17 @@ </tr> % } <tr> - <th scope="row">Route</th> + <th scope="row"><%= L('journey.route') %></th> <td> % my $before = 1; % my $within = 0; % my $at_startstop = 0; + % my $i = 0; % for my $station (@{$journey->{route}}) { - % if ($station->[0] eq $journey->{from_name}) { + % if ($i == $journey->{route_dep_index}) { % $within = 1; $at_startstop = 1; % } - % elsif ($station->[0] eq $journey->{to_name}) { + % elsif ($i == $journey->{route_arr_index}) { % $within = 0; $at_startstop = 1; % } % else { @@ -223,10 +270,10 @@ % } <span style="color: #808080;"> % if ($before and $station->[2]{sched_dep}) { - %= $station->[2]{sched_dep}->strftime('%H:%M') + %= $station->[2]{sched_dep_dt}->strftime('%H:%M') % } % elsif (not $before and $station->[2]{sched_arr}) { - %= $station->[2]{sched_arr}->strftime('%H:%M') + %= $station->[2]{sched_arr_dt}->strftime('%H:%M') % } </span> % if ($at_startstop or $within) { @@ -248,10 +295,11 @@ % } </span> % } - % if ($station->[0] eq $journey->{from_name}) { + % if (($station->[1] and $station->[1] == $journey->{from_eva}) or $station->[0] eq $journey->{from_name}) { % $before = 0; % } <br/> + % $i += 1; % } </td> </tr> @@ -261,63 +309,107 @@ % if (stash('polyline_groups')) { %= include '_map', station_coordinates => stash('station_coordinates'), polyline_groups => stash('polyline_groups') % } + <div class="row"> + <div class="col s12 grey-text"> + <i class="material-icons tiny" aria-hidden="true"><%= $journey->{is_hafas} ? 'directions' : 'train' %></i> + %= $journey->{backend_name} || 'IRIS' + #<%= $journey->{id} %> + </div> + </div> % 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"> + <div class="row"> + <div class="col s12 m6 l4 center-align"> + <a class="btn waves-effect waves-light" href="<%= url_for('journey', id => $journey->{id}, format => 'json' ) %>"> + <i class="material-icons left" aria-hidden="true">file_download</i> + %= L('journey.export') + </a> + </div> + <div class="col s12 m6 l4 center-align"> + %= form_for '/journey/edit' => (method => 'POST') => begin + %= hidden_field 'journey_id' => param('journey_id') + <button class="btn waves-effect waves-light" type="submit" name="action" value="edit"> + <i class="material-icons left" aria-hidden="true">edit</i> + %= L('journey.edit') + </button> + %= end + </div> + <div class="col s12 m6 l4 center-align"> + % if (stash('with_share')) { <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-url="<%= url_for('public_journey', name => current_user()->{name}, id => $journey->{id} )->to_abs->scheme('https'); %>?token=<%= $journey->{from_eva} %>-<%= $journey->{checkin_ts} % 337 %>-<%= int($journey->{sched_dep_ts}) %>" % } data-text="<%= stash('share_text') %>" > - <i class="material-icons left" aria-hidden="true">share</i> Teilen + <i class="material-icons left" aria-hidden="true">share</i> + %= L('journey.share') </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" - data-id="<%= $journey->{id} %>" - data-checkin="<%= $journey->{checkin}->epoch %>" - data-checkout="<%= $journey->{checkout}->epoch %>"> - <i class="material-icons left">delete_forever</i> - Löschen - </a> - </div> - <div class="col s12 m6 l6 center-align"> - %= form_for '/journey/edit' => (method => 'POST') => begin - %= hidden_field 'journey_id' => param('journey_id') - <button class="btn waves-effect waves-light" type="submit" name="action" value="edit"> - <i class="material-icons left" aria-hidden="true">edit</i> - Bearbeiten - </button> - %= end + % } </div> </div> - <div class="row hide-on-med-and-up"> - <div class="col s12 m6 l6 center-align"> - %= form_for '/journey/edit' => (method => 'POST') => begin - %= hidden_field 'journey_id' => param('journey_id') - <button class="btn waves-effect waves-light" type="submit" name="action" value="edit"> - <i class="material-icons left" aria-hidden="true">edit</i> - Bearbeiten - </button> - %= end + % if ($journey->{polyline} or $journey->{km_route} > 0.1) { + <h2><%= L('journey.map-data') %> + % if ($journey->{edited} & 0x0040) { + ∗ + % } + </h2> + <div class="row"> + <div class="col s12 m6 l6 center-align"> + <a class="btn waves-effect waves-light" href="<%= url_for('polyline_download', id => $journey->{id}, format => 'json' ) %>"> + <i class="material-icons left" aria-label="<%= L('journey.map.download') %>">file_download</i> + JSON + </a> + </div> + <div class="col s12 m6 l6 center-align"> + <a class="btn waves-effect waves-light" href="<%= url_for('polyline_download', id => $journey->{id}, format => 'gpx' ) %>"> + <i class="material-icons left" aria-label="<%= L('journey.map.download') %>">file_download</i> + GPX + </a> + </div> </div> - <div class="col s12 m6 l6 center-align" style="margin-top: 1em;"> + <div class="row"> + <div class="col s12"> + %= L('journey.map.info.download') + %= L('journey.map.info.upload') + </div> + </div> + %= form_for '/polyline/set' => (method => 'post', enctype => 'multipart/form-data') => begin + %= csrf_field + %= hidden_field id => $journey->{id} + <div class="row"> + <div class="col s12"> + <div class="file-field input-field"> + <div class="btn"> + <span><i class="material-icons left" aria-label="<%= L('journey.map.upload') %>">file_upload</i> GPX</span> + <input type="file"> + </div> + <div class="file-path-wrapper"> + <input class="file-path validate" type="text" name="file"> + </div> + %= file_field 'file' + </div> + </div> + <div class="col s12 m6 center-align"> + %= submit_button L('journey.map.upload-full'), class => 'waves-effect waves-light btn', name => 'upload-full' + </div> + <div class="col s12 m6 center-align"> + %= submit_button L('journey.map.upload-partial'), class => 'waves-effect waves-light btn', name => 'upload-partial' + </div> + </div> + %= end + % } + <h2><%= L('journey.danger') %></h2> + <div class="row"> + <div class="col s12 m12 l12 center-align" style="margin-top: 1em;"> <a class="waves-effect waves-light red btn action-delete" data-id="<%= $journey->{id} %>" data-checkin="<%= $journey->{checkin}->epoch %>" data-checkout="<%= $journey->{checkout}->epoch %>"> <i class="material-icons left" aria-hidden="true">delete_forever</i> - Löschen + %= L('journey.delete') </a> </div> </div> diff --git a/templates/landingpage.html.ep b/templates/landingpage.html.ep index 45bfb21..ba0433f 100644 --- a/templates/landingpage.html.ep +++ b/templates/landingpage.html.ep @@ -1,5 +1,6 @@ % if (is_user_authenticated()) { % my $status = stash('user_status'); + % my $user = stash('user'); % if (stash('error')) { <div class="row"> <div class="col s12"> @@ -51,67 +52,81 @@ % if ( @{stash('timeline') // [] } ) { %= include '_timeline_link', timeline => stash('timeline') % } - <div class="card"> - <div class="card-content"> - <span class="card-title">Hallo, <%= current_user->{name} %>!</span> - <p>Du bist gerade nicht eingecheckt.</p> - <div class="geolocation" data-recent="<%= join('|', map { $_->{eva} . ';' . $_->{name} . ';' . $_->{hafas} } @{stash('recent_targets') // []} ) %>"> - <button class="btn waves-effect waves-light btn-flat">Stationen in der Umgebung abfragen</button> - </div> - %= form_for 'list_departures' => begin + %= form_for 'list_departures' => begin + <div class="card"> + <div class="card-content"> + <span class="card-title"><%= L('landingpage.greeting-prefix') %> <%= $user->{name} %><%= L('landingpage.greeting-suffix') %></span> + <p><%= L('landingpage.not-checked-in') %>.</p> + <div class="geolocation" data-recent="<%= join('|', map { $_->{external_id_or_eva} . ';' . $_->{name} . ';' . $_->{dbris} . ';' . $_->{efa} . ';' . $_->{hafas} . ';' . $_->{motis} } @{stash('recent_targets') // []} ) %>" data-backend="<%= $user->{backend_id} %>"> + <a class="btn waves-effect waves-light btn-flat request"><%= L('landingpage.stop-geosearch') %></a> + </div> + %= hidden_field backend_dbris => $user->{backend_dbris} <div class="input-field"> %= text_field 'station', id => 'station', class => 'autocomplete contrast-color-text', autocomplete => 'off', required => undef - <label for="station">Manuelle Eingabe</label> + <label for="station"><%= L('landingpage.manual-stop-entry') %></label> </div> - <div class="center-align"> - <button class="btn waves-effect waves-light btn-flat" type="submit" name="action" value="departures"> - <i class="material-icons left" aria-hidden="true">send</i> - Abfahrten - </button> - </div> - %= end + </div> + <div class="card-action"> + <a href="/account/select_backend?redirect_to=/" class="btn btn-flat"><i class="material-icons left" aria-hidden="true"><%= $user->{backend_hafas} ? 'directions' : 'train' %></i><%= $user->{backend_name} // 'IRIS' %></a> + <button class="btn right waves-effect waves-light btn-flat" type="submit" name="action" value="departures"> + <i class="material-icons left" aria-hidden="true">send</i> + %= L('landingpage.departures') + </button> + </div> </div> - </div> + %= end % } </div> </div> - <h2 style="margin-left: 0.75rem;">Letzte Fahrten</h2> - %= include '_history_trains', date_format => '%d.%m.%Y', journeys => [journeys->get(uid => current_user->{id}, limit => 5, with_datetime => 1)]; + % if (not $user->{backend_name}) { + <div class="row"> + <div class="col s12"> + <div class="card purple white-text"> + <div class="card-content"> + <span class="card-title">Legacy-Backend ausgewählt</span> + <p> + Das aktuell aktive IRIS-Backend wird nicht mehr weiterentwickelt und voraussichtlich bald von der Deutschen Bahn abgeschaltet. + Schon jetzt ist die Datenqualität wegen zunehmend schlechter Datenaufbereitungsmöglichkeiten oft unzureichend. + Das bahn.de-Backend ist in fast jeder Hinsicht besser geeignet; lediglich bei Verspätungs- und Servicemeldungen ist es geringfügig weniger detailliert und Checkin-Vorschläge werden derzeit nicht unterstützt. + </p> + </div> + <div class="card-action"> + <a class="btn btn-flat" href="/account/select_backend?redirect_to=/">Backend wechseln</a> + </div> + </div> + </div> + </div> + % } + <h2 style="margin-left: 0.75rem;"><%= L('landingpage.latest-trips') %></h2> + %= include '_history_trains', date_format => L('landingpage.date-format'), journeys => [journeys->get(uid => $user->{id}, limit => 5, with_datetime => 1)]; % } % else { <div class="row"> <div class="col s12"> <p> - Travelynx erlaubt das Einchecken in Züge im Netz der Deutschen - Bahn. So können die eigenen Fahrten später inklusive Echtzeitdaten - und eingetragenen Servicemeldungen nachvollzogen und brennende - Fragen wie „Wie viele Stunden war ich letzten Monat unterwegs?“ - beantwortet werden. + %= L('landingpage.about') </p> <p> - Die Idee dazu kommt von <a - href="https://traewelling.de/">Träwelling</a>. + %= L('landingpage.traewelling.pre') + <a href="https://traewelling.de/">Träwelling</a> + %= L('landingpage.traewelling.post') </p> <p> - Features: + %= L('landingpage.features') <ul> - <li>Protokoll von Fahrplan- und Echtzeitdaten an Start- und - Zielbahnhof</li> - <li>Teilen von aktuellen und vergangenen Fahrten mit anderen Personen</li> - <li>Web-Hooks und <a href="/api">API</a> zum automatisierten Einchecken und Auslesen des aktuellen Status</li> - <li>Statistiken über Reisezeiten und Verspätungen</li> - <li>Unterstützung beim Ausfüllen von Fahrgastrechteformularen</li> - <li>Optional: Öffentlicher Reisestatus und öffentliche Angaben zu vergangenen Fahrten</li> - <li>Optional: Verknüpfung mit Träwelling</li> + <li><%= L('landingpage.features.log') %></li> + <li><%= L('landingpage.features.share') %></li> + <li><%= L('landingpage.features.api-pre') %> <a href="/api"><%= L('landingpage.features.api-link') %></a> <%= L('landingpage.features.api-post') %></li> + <li><%= L('landingpage.features.stats') %></li> + <li><%= L('landingpage.features.passenger-rights') %></li> + <li><%= L('landingpage.features.public') %></li> </ul> </p> <p> - Travelynx ist ein kostenfreies, privat betriebenes Projekt ohne - Verfügbarkeitsgarantie. Unangekündigte Downtimes oder eine - kurzfristige Einstellung dieser Seite sind nicht vorgesehen, aber - möglich. Wer mag, kann auch den - <a href="https://finalrewind.org/projects/travelynx">Quelltext</a> - laden und eine eigene Instanz aufsetzen. + %= L('landingpage.disclaimer.lead') + %= L('landingpage.disclaimer.source-pre') + <a href="https://finalrewind.org/projects/travelynx"><%= L('landingpage.disclaimer.source-link') %></a> + %= L('landingpage.disclaimer.source-post') </p> </div> </div> @@ -120,9 +135,9 @@ </div> <div class="col s10 m10 l6 center-align"> % if (not app->config->{registration}{disabled}) { - <a href="/register" class="waves-effect waves-light btn"><i class="material-icons left" aria-hidden="true">add</i>Registrieren</a> + <a href="/register" class="waves-effect waves-light btn"><i class="material-icons left" aria-hidden="true">add</i><%= L('button.register') %></a> % } - <a href="/login" class="waves-effect waves-light btn"><i class="material-icons left" aria-hidden="true">account_circle</i>Anmelden</a> + <a href="/login" class="waves-effect waves-light btn"><i class="material-icons left" aria-hidden="true">account_circle</i><%= L('button.login') %></a> </div> <div class="col s1 m1 l3"> </div> diff --git a/templates/language.html.ep b/templates/language.html.ep new file mode 100644 index 0000000..0d14fe6 --- /dev/null +++ b/templates/language.html.ep @@ -0,0 +1,76 @@ +<h1><%= L('language.language') %></h1> +%= form_for '/account/language' => (method => 'POST') => begin + %= csrf_field + <div class="row"> + <div class="input-field col s12"> + <div> + <label> + %= radio_button language => 'none' + <span>–: <%= L('language.browser-default') %></span> + </label> + </div> + </div> + </div> + <div class="row"> + <div class="input-field col s12"> + <div> + <label> + %= radio_button language => 'de-DE' + <span>de-DE: Deutsch (hochdeutsch)</span> + </label> + </div> + </div> + </div> + <div class="row"> + <div class="input-field col s12"> + <div> + <label> + %= radio_button language => 'en-GB' + <span>en-GB: English (Great Britain)</span> + </label> + </div> + </div> + </div> + <div class="row"> + <div class="input-field col s12"> + <div> + <label> + %= radio_button language => 'fr-FR' + <span>fr-FR: français</span> + </label> + </div> + </div> + </div> + <div class="row"> + <div class="input-field col s12"> + <div> + <label> + %= radio_button language => 'hu-HU' + <span>hu-HU: magyar</span> + </label> + </div> + </div> + </div> + <div class="row"> + <div class="input-field col s12"> + <div> + <label> + %= radio_button language => 'pl-PL' + <span>pl-PL: Polski</span> + </label> + </div> + </div> + </div> + <div class="row"> + <div class="col s3 m3 l3"> + </div> + <div class="col s6 m6 l6 center-align"> + <button class="btn waves-effect waves-light" type="submit" name="action" value="save"> + Speichern + <i class="material-icons right">send</i> + </button> + </div> + <div class="col s3 m3 l3"> + </div> + </div> +%= end diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index 80ef49e..701c67d 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -13,7 +13,7 @@ % while (my ($key, $value) = each %{stash('opengraph') // {}}) { <meta property="og:<%= $key %>" content="<%= $value %>"> % } - % my $av = 'v71'; # asset version + % my $av = 'v98'; # asset version <link rel="icon" type="image/png" href="/static/<%= $av %>/icons/icon-16x16.png" sizes="16x16"> <link rel="icon" type="image/png" href="/static/<%= $av %>/icons/icon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="/static/<%= $av %>/icons/icon-96x96.png" sizes="96x96"> @@ -62,7 +62,7 @@ %= javascript "/static/${av}/js/geolocation${min}.js" % } % if (stash('with_autocomplete')) { - %= javascript "/dyn/${av}/autocomplete.js", defer => undef + %= javascript "/dyn/${av}/autocomplete.js?backend_id=" . (stash('backend_id') // 1), defer => undef % } % if (stash('with_map')) { %= javascript "/static/${av}/leaflet/leaflet.js" @@ -90,7 +90,7 @@ </div> </li> % if ($acc) { - <li class="<%= navbar_class('/history') %>"><a href='/history' title="Vergangene Zugfahrten"><i class="material-icons" aria-label="Vergangene Zugfahrten">history</i></a></li> + <li class="<%= navbar_class('/history') %>"><a href='/history' title="Vergangene Fahrten"><i class="material-icons" aria-label="Vergangene Fahrten">history</i></a></li> <li class="<%= navbar_class('/account') %>"><a href="/account" title="Account"><i class="material-icons" aria-label="Account"><%= $acc->{notifications} ? 'notifications' : 'account_circle' %></i></a></li> % } % else { @@ -131,21 +131,21 @@ <div class="col s12 center-align grey-text"> <a href="/about">travelynx</a> v<%= $version // '???' %> <span style="margin-left: 0.5em; margin-right: 0.5em;">–</span> - <a href="/impressum">Impressum</a> + <a href="/impressum"><%= L('footer.imprint') %></a> <span style="margin-left: 0.5em; margin-right: 0.5em;">–</span> - <a href="/impressum">Datenschutz</a> + <a href="/impressum"><%= L('footer.privacy') %></a> <span style="margin-left: 0.5em; margin-right: 0.5em;">–</span> - <a href="/legend">Legende</a> + <a href="/legend"><%= L('footer.legend') %></a> </div> </div> <div class="row"> <div class="col s12 center-align grey-text config"> - Farbschema: - <a onClick="javascript:setTheme('light')">hell</a> + <%= L('footer.colour-scheme') %>: + <a onClick="javascript:setTheme('light')"><%= L('footer.colour-scheme.light') %></a> · - <a onClick="javascript:setTheme('dark')">dunkel</a> + <a onClick="javascript:setTheme('dark')"><%= L('footer.colour-scheme.dark') %></a> · - <a onClick="javascript:setTheme('default')">automatisch</a> + <a onClick="javascript:setTheme('default')"><%= L('footer.colour-scheme.auto') %></a> </div> </div> </div> diff --git a/templates/legend.html.ep b/templates/legend.html.ep index 73fded9..3dc113a 100644 --- a/templates/legend.html.ep +++ b/templates/legend.html.ep @@ -15,11 +15,11 @@ </tr> <tr> <td><i class="material-icons">train</i></td> - <td>Backend: DB IRIS. Bevorzugte Datenquelle für (mindestens teilweise) innerdeutsche Zugfahrten.</td> + <td>Backend: Deutsche Bahn (bahn.de oder IRIS-TTS).</td> </tr> <tr> <td><i class="material-icons">directions</i></td> - <td>Backend: DB HAFAS. Bevorzugte Datenquelle für Nahverkehr und vollständig außerdeutsche Zugfahrten. Weniger detailliert als IRIS.</td> + <td>Backend: HAFAS.</td> </tr> </tbody> </table> diff --git a/templates/login.html.ep b/templates/login.html.ep index ce89813..21f14d3 100644 --- a/templates/login.html.ep +++ b/templates/login.html.ep @@ -74,11 +74,18 @@ </div> </div> <div class="row"> + <div class="col s12 m12 l12"> + %= L('login.accept-tos-pre') + <a href="/tos"><%= L('login.tos') %></a> + %= L('login.accept-tos-post') + </div> + </div> + <div class="row"> <div class="col s3 m3 l3"> </div> <div class="col s6 m6 l6 center-align"> <button class="btn waves-effect waves-light" type="submit" name="action" value="login"> - Anmelden + %= L('button.login') <i class="material-icons right">send</i> </button> </div> @@ -90,7 +97,7 @@ </div> <div class="col s6 m6 l6 center-align"> <a href="/recover"> - Passwort vergessen + %= L('login.forgot-password') </a> </div> <div class="col s3 m3 l3"> @@ -99,7 +106,7 @@ % if (app->config->{registration}{disabled}) { <div class="row" style="margin-top: 2em;"> <div class="col s12 center-align"> - <em>Diese Instanz erlaubt derzeit keine Registrierung neuer Accounts</em> + <em><%= L('login.registration-disabled') %></em> </div> </div> % } diff --git a/templates/passengerrights.html.ep b/templates/passengerrights.html.ep index 3d5d21d..bf9e5de 100644 --- a/templates/passengerrights.html.ep +++ b/templates/passengerrights.html.ep @@ -2,14 +2,14 @@ <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 Verkehrsunternehmen. + Dieser kann mit dem Fahrgastrechteformular oder online geltend + gemacht werden. </p> <p> - Die folgenden Zugfahrten sind wahrscheinliche Kandidaten dafür. - Details zur jeweiligen Zugfahrt sind bereits im Formular eingetragen. + Die folgenden Fahrten sind wahrscheinliche Kandidaten dafür. + Details zur jeweiligen Fahrt sind bereits im Formular eingetragen. </p> </div> </div> @@ -20,7 +20,7 @@ <thead> <tr> <th>Datum</th> - <th>Zug</th> + <th>Fahrt</th> <th>Grund</th> <th>Formular</th> </tr> @@ -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 Fahrten 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>Fahrt</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> diff --git a/templates/polyline.gpx.ep b/templates/polyline.gpx.ep new file mode 100644 index 0000000..a243926 --- /dev/null +++ b/templates/polyline.gpx.ep @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<gpx + xmlns="http://www.topografix.com/GPX/1/1" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" + version="1.1" + creator="travelynx <%= $version %>"> + <trk> + <name><%= $name %></name> + <trkseg> + % for my $entry (@{$polyline // []}) { + <trkpt lon="<%= $entry->[0] %>" lat="<%= $entry->[1] %>"> + % if ($entry->[2]) { + <name><%= $entry->[2] %></name> + % } + </trkpt> + % } + </trkseg> + </trk> +</gpx> diff --git a/templates/profile.html.ep b/templates/profile.html.ep index 6f78ea0..a2c965c 100644 --- a/templates/profile.html.ep +++ b/templates/profile.html.ep @@ -79,7 +79,7 @@ </div> <div class="row"> <div class="col s12 publicstatuscol" data-user="<%= $name %>" data-profile="1"> - %= include '_public_status_card', name => $name, privacy => $privacy, journey => $journey, from_profile => 1 + %= include '_public_status_card', name => $name, privacy => $privacy, journey => $journey, from_profile => 1, station_coordinates => stash('station_coordinates'), polyline_groups => stash('polyline_groups') </div> </div> % if ($journeys and @{$journeys}) { diff --git a/templates/register.html.ep b/templates/register.html.ep index ee344f9..e7064da 100644 --- a/templates/register.html.ep +++ b/templates/register.html.ep @@ -8,22 +8,29 @@ <div class="input-field col l6 m12 s12"> <i class="material-icons prefix">account_circle</i> %= text_field 'user', id => 'account', class => 'validate', required => undef, pattern => '[0-9a-zA-Z_-]+', maxlength => 60, autocomplete => 'username' - <label for="account">Name (alphanumerisch)</label> + <label for="account"><%= L('register.name') %></label> </div> <div class="input-field col l6 m12 s12"> <i class="material-icons prefix">email</i> %= email_field 'email', id => 'email', class => 'validate', required => undef, maxlength => 250 - <label for="email">Mail-Adresse</label> + <label for="email"><%= L('register.mail') %></label> </div> <div class="input-field col l6 m12 s12"> <i class="material-icons prefix">lock</i> %= password_field 'password', id => 'password', class => 'validate', required => undef, minlength => 8, maxlength => 10000, autocomplete => 'new-password' - <label for="password">Passwort</label> + <label for="password"><%= L('register.password') %></label> </div> <div class="input-field col l6 m12 s12"> <i class="material-icons prefix">lock</i> %= password_field 'password2', id => 'password2', class => 'validate', required => undef, minlength => 8, maxlength => 10000, autocomplete => 'new-password' - <label for="password2">Passwort wiederholen</label> + <label for="password2"><%= L('register.repeat-password') %></label> + </div> + </div> + <div class="row"> + <div class="col s12 m12 l12"> + %= L('register.accept-tos-pre') + <a href="/tos"><%= L('register.tos') %></a> + %= L('register.accept-tos-post') </div> </div> <div class="row"> @@ -31,7 +38,7 @@ </div> <div class="col s6 m6 l6 center-align"> <button class="btn waves-effect waves-light" type="submit" name="action" value="register"> - Registrieren + %= L('button.register') <i class="material-icons right">send</i> </button> </div> @@ -42,9 +49,7 @@ <div class="row"> <div class="col s12"> <p> - Nach der Registrierung wird ein für 48 Stunden gültiger - Bestätigungslink an die angegebene Mail-Adresse geschickt. Eine - Anmeldung ist erst nach Bestätigung der Mail-Adresse möglich. + %= L('register.expect-confirmation-link') </p> <p> Die Mail-Adresse wird ausschließlich zur Bestätigung der Anmeldung, diff --git a/templates/select_backend.html.ep b/templates/select_backend.html.ep new file mode 100644 index 0000000..999a689 --- /dev/null +++ b/templates/select_backend.html.ep @@ -0,0 +1,99 @@ +<div class="row"> + <div class="col s12"> + <h2>Backend auswählen</h2> + <p style="text-align: justify;"> + Das ausgewählte Backend bestimmt die Datenquelle für Fahrten in travelynx. + <a href="#help">Details</a>. + </p> + </div> +</div> +%= form_for '/account/select_backend' => (method => 'POST') => begin + % if (stash('redirect_to')) { + %= hidden_field 'redirect_to' => stash('redirect_to') + % } + % if (@{stash('frequent') // []}) { + <div class="row"> + <div class="col s12"> + <h3>Häufig genutzt</h3> + <p style="text-align: justify;"> + Die folgenden Backends wurden innerhalb der letzten vier + Monate für Checkins verwendet. + </p> + </div> + </div> + % for my $backend (@{ stash('frequent') // [] }) { + %= include '_backend_line', user => $user, backend => $backend + % } + % } + % if (@{stash('suggestions') // []}) { + <div class="row"> + <div class="col s12"> + <h3>Vorschläge</h3> + <p style="text-align: justify;"> + Anhand der Zielstation der letzten Fahrt und den + empfohlenen Nutzungsbereichen der verfügbaren Backends + (soweit bekannt). + </p> + </div> + </div> + % for my $backend (@{ stash('suggestions') // [] }) { + %= include '_backend_line', user => $user, backend => $backend + % } + % } + <div class="row"> + <div class="col s12"> + <h3>Empfohlen</h3> + <p style="text-align: justify;"> + <strong>bahn.de</strong> für Regional- und Fernverkehr in Deutschland. + <strong>ÖBB</strong> für Nah-, Regional- und Fernverkehr in Österreich sowie Regional- und Fernverkehr in der EU. + </p> + </div> + </div> + % for my $backend (grep { $_->{recommended} } @{ stash('backends') // [] }) { + %= include '_backend_line', user => $user, backend => $backend + % } + <div class="row"> + <div class="col s12"> + <h3>Verbünde</h3> + <p style="text-align: justify;"> + Diese Backends sind meist die beste Wahl für + Nahverkehrsfahrten in der jeweiligen Region. + Backends außerhalb Deutschlands sind im Regelfall auch + für dortigen Regional- und Fernverkehr die beste Wahl. + </p> + </div> + </div> + % for my $backend (grep { $_->{association} } @{ stash('backends') // [] }) { + %= include '_backend_line', user => $user, backend => $backend + % } + <div class="row"> + <div class="col s12"> + <h3>Experimentell oder abgekündigt</h3> + <p style="text-align: justify;"> + Einchecken auf eigene Gefahr. + </p> + </div> + </div> + % for my $backend (grep { $_->{experimental} or $_->{legacy} } @{ stash('backends') // [] }) { + %= include '_backend_line', user => $user, backend => $backend + % } +%= end +<div class="row"> + <div class="col s12"> + <h2 id="help">Details</h2> + <p> + <strong>Deutsche Bahn: bahn.de</strong> ist eine gute Wahl für Fahrten des Nah-, Regional- und Fernverkehrs innerhalb Deutschlands. + Dieses Backend bietet überwiegend korrekte Echtzeit- und Kartendaten sowie Wagenreihungen. + Bei Nahverkehrsfahrten sind die Echtzeit- und Kartendaten meist nicht so gut wie bei den APIs des jeweiligen Verkehrsverbunds. + <p> + <strong>ÖBB</strong> liefern Kartendaten und Wagenreihungen für Fernverkehr in Deutschland und Umgebung, jedoch keine Meldungen. Echtzeitdaten sind teilweise verfügbar. + </p> + <p> + <strong>Deutsche Bahn: IRIS-TTS</strong> liefert Echtzeitdaten (nur am Start- und Zielbahnhof), Wagenreihungen und Verspätungsmeldungen für Regional- und Fernverkehr in Deutschland. Kartendaten und Angaben zu Unterwegshalten sind nur teilweise verfügbar. Dieses Backend wird nicht mehr weiterentwickelt. Die zugehörige API wird voraussichtlich im Laufe des Jahres 2025 abgeschaltet. + </p> + <p> + <strong>Transitous</strong> ist ein Aggregator für eine Vielzahl von Verkehrsunternehmen. + Die Datenqualität variiert. + </p> + </div> +</div> diff --git a/templates/traewelling.html.ep b/templates/traewelling.html.ep index c1f2b7d..49b5c80 100644 --- a/templates/traewelling.html.ep +++ b/templates/traewelling.html.ep @@ -41,30 +41,6 @@ </div> % } -<div class="row"> - <div class="col s12"> - <div class="card purple"> - <div class="card-content white-text"> - <span class="card-title">Eingeschränkte Synchronisierung</span> - <p> - Träwelling und travelynx setzen unterschiedliche Schwerpunkte und haben unterschiedliche Features. - Kombiniert mit der Vielzahl an möglichen Randfällen heißt das, dass die Synchronisierung nicht immer funktioniert. - Diese Einschränkung ist bekannt und wird voraussichtlich bestehen bleiben. - </p> - <p> - Bei hohen Verspätungen, Ausfällen und nachträglichen Checkin-Änderungen ist die Synchronisierung u.U. nicht möglich und muss von Hand vorgenommen werden. - travelynx-Hooks werden bei via Träwelling vorgenommenen Checkins nicht ausgelöst. - </p> - </div> - <div class="card-action"> - <a href="https://github.com/derf/travelynx/issues" class="waves-effect waves-light btn-flat white-text"> - <i class="material-icons left" aria-hidden="true">bug_report</i>Bug melden - </a> - </div> - </div> - </div> -</div> - % if ($traewelling->{token} and ($traewelling->{expired} or $traewelling->{expiring})) { <div class="row"> <div class="col s12"> @@ -157,26 +133,21 @@ <div> <label> %= check_box toot => 1 - <span>… Checkin auf Mastodon veröffentlichen</span> - </label> - </div> - <div> - <label> - %= check_box tweet => 1 - <span>… Checkin auf Twitter veröffentlichen</span> + <span>… Checkin im Fediverse veröffentlichen</span> </label> </div> <p>Die Synchronisierung erfolgt spätestens drei Minuten nach der - Zielwahl. Beachte, dass die Synchronisierung travelynx - → Träwelling unabhängig von der eingestellten Sichtbarkeit - des Checkins erfolgt. travelynx reicht die Sichtbarkeit - aber an Träwelling weiter. - Träwelling-Checkins können von travelynx aktuell nicht - rückgängig gemacht werden. Eine nachträgliche Änderung der - Zielstation wird nicht übernommen. Mastodon und Twitter beziehen - sich auf die in den <a + Zielwahl. Es werden ausschließlich Checkins mittels + DB (IRIS-TTS) und DB (HAFAS) synchornisiert. Beachte, dass + die Synchronisierung travelynx → Träwelling unabhängig von + der eingestellten Sichtbarkeit des Checkins erfolgt. + travelynx reicht die Sichtbarkeit aber an Träwelling + weiter. Träwelling-Checkins können von travelynx aktuell + nicht rückgängig gemacht werden. Eine nachträgliche + Änderung der Zielstation wird nicht übernommen. Fediverse + bezieht sich auf den in den <a href="https://traewelling.de/settings">Träwelling-Einstellungen</a> - verknüpften Accounts.</p> + verknüpften Account.</p> </div> <div class="input-field col s12"> <div> diff --git a/templates/use_external_links.html.ep b/templates/use_external_links.html.ep deleted file mode 100644 index d7bebd7..0000000 --- a/templates/use_external_links.html.ep +++ /dev/null @@ -1,82 +0,0 @@ -<h1>Externe Dienste</h1> -<div class="row"> - <div class="col s12"> - <p> - Travelynx kann an geeigneten Stellen Links zu externen Diensten - (z.B. Abfahrstafeln oder Informationen zum gerade genutzten Zug) - einbinden. Hier lässt sich konfigurieren, welcher Dienst für welche - Art von Informationen genutzt wird. - <p/> - </div> -</div> -<h2>Abfahrtstafel</h2> -%= form_for '/account/services' => (method => 'POST') => begin - %= csrf_field - <div class="row"> - <div class="col s12"> - Angaben zu anderen an einer Station verkehrenden Verkehrsmitteln - </div> - </div> - <div class="row"> - <div class="input-field col s12"> - <div> - <label> - %= radio_button stationboard => '0' - <span>Keine</span> - </label> - </div> - </div> - </div> - <div class="row"> - <div class="input-field col s12"> - <div> - <label> - %= radio_button stationboard => '1' - <span><a href="https://dbf.finalrewind.org/">DBF</a> (Schienenverkehr)</span> - </label> - </div> - </div> - </div> - <div class="row"> - <div class="input-field col s12"> - <div> - <label> - %= radio_button stationboard => '2' - <span><a href="https://bahn.expert/">bahn.expert</a> (Schienenverkehr)</span> - </label> - </div> - </div> - </div> - <div class="row"> - <div class="input-field col s12"> - <div> - <label> - %= radio_button stationboard => '3' - <span><a href="https://dbf.finalrewind.org/?hafas=1">DBF</a> (Nahverkehr)</span> - </label> - </div> - </div> - </div> - <div class="row"> - <div class="input-field col s12"> - <div> - <label> - %= radio_button stationboard => '4' - <span><a href="https://bahn.expert/regional">bahn.expert/regional</a> (Nahverkehr)</span> - </label> - </div> - </div> - </div> - <div class="row"> - <div class="col s3 m3 l3"> - </div> - <div class="col s6 m6 l6 center-align"> - <button class="btn waves-effect waves-light" type="submit" name="action" value="save"> - Speichern - <i class="material-icons right">send</i> - </button> - </div> - <div class="col s3 m3 l3"> - </div> - </div> -%= end diff --git a/templates/use_history.html.ep b/templates/use_history.html.ep index 9b76e98..f91ca16 100644 --- a/templates/use_history.html.ep +++ b/templates/use_history.html.ep @@ -5,9 +5,13 @@ Travelynx kann anhand deiner vergangenen Fahrten Verbindungen zum Einchecken vorschlagen. Fährst zu z.B regelmäßig von Dortmund Hbf nach Essen Hbf, werden dir in Dortmund bevorzugt Fahrten angezeigt, die - Essen passieren. Bei Auswahl dieser wird nicht nur in die Fahrt eingecheckt, + Essen passieren. Bei Auswahl dieser wird nicht nur in die Fahrt eingecheckt, sondern auch direkt Essen Hbf als Ziel eingetragen. <p/> + <p> + Beachte, dass nicht alle von travelynx unterstützten Backends die + für dieses Feature notwendigen Daten bereitstellen. + </p> <!-- <p> Falls du das nicht nützlich findest oder nicht möchtest, dass deine regelmäßigen (Anschluss-)Züge auf deinem Bildschirm sichtbar sind, diff --git a/templates/user_status.html.ep b/templates/user_status.html.ep index 45fba54..bf11004 100644 --- a/templates/user_status.html.ep +++ b/templates/user_status.html.ep @@ -1,5 +1,5 @@ <div class="row"> <div class="col s12 publicstatuscol" data-user="<%= $name %>"> - %= include '_public_status_card', name => $name, privacy => $privacy, journey => $journey + %= include '_public_status_card', name => $name, privacy => $privacy, journey => $journey, station_coordinates => stash('station_coordinates'), polyline_groups => stash('polyline_groups') </div> </div> |