travelynx/templates/history_map.html.ep
Kumi f384cfc0fe
All checks were successful
Perl Tests / perl (5.20-buster) (push) Successful in 4m34s
Perl Tests / perl (latest) (push) Successful in 4m1s
Perl Tests / perl (threaded) (push) Successful in 3m30s
feat: display total travel distance in map view
Added calculation and display of total distance traveled in the travel map history view. This enhancement provides users with a quick overview of the cumulative distance covered during their journeys. The addition is beneficial for users tracking their travel metrics for personal or record-keeping purposes.
2024-10-14 22:04:40 +02:00

144 lines
3.7 KiB
Text

<div class="row">
<div class="col s12">
% if (@{$station_coordinates}) {
Fahrten
% }
% else {
Keine Fahrten
% }
% if (param('filter_type')) {
mit <strong><%= param('filter_type') %></strong>
% }
% if (stash('year')) {
im Jahr <strong><%= stash('year') %></strong>
% }
% elsif (param('filter_from') and param('filter_to')) {
zwischen dem <strong><%= param('filter_from') %></strong> und dem <strong><%= param('filter_to') %></strong>
% }
% elsif (param('filter_from')) {
ab dem <strong><%= param('filter_from') %></strong>
% }
% elsif (param('filter_to')) {
bis einschließlich <strong><%= param('filter_to') %></strong>
% }
% elsif (@{$station_coordinates}) {
in travelynx
% }
% if (not @{$station_coordinates}) {
gefunden
% }
</div>
</div>
%= include '_map', station_coordinates => $station_coordinates, polyline_groups => $polyline_groups
%= form_for '/history/map' => begin
<p>
Gesamtdistanz: <%= sprintf("%.2f", $total_distance // 0) %> km
</p>
<p>
Detailgrad:
</p>
<div class="row">
<div class="input-field col s12">
<div>
<label>
%= radio_button route_type => 'polyline'
<span>Nur Fahrten mit bekanntem Streckenverlauf eintragen</span>
</label>
</div>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<div>
<label>
%= radio_button route_type => 'polybee'
<span>Streckenverlauf wenn bekannt, sonst Luftlinie zwischen Unterweghalten</span>
</label>
</div>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<div>
<label>
%= radio_button route_type => 'beeline'
<span>Immer Luftlinie zwischen Unterwegshalten zeigen</span>
</label>
</div>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<div>
<label>
%= check_box include_manual => 1
<span>Manuelle Einträge ohne Unterwegshalte mitberücksichtigen</span>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col s12 center-align">
<button class="btn wave-effect waves-light" type="submit">
Anzeigen
</button>
</div>
</div>
<p>
Weitere Filter:
</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>
</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>
</div>
</div>
<div class="row">
<div class="input-field col s12">
%= text_field 'filter_type', id => 'filter_type'
<label for="filter_tpye">Verkehrsmittel</label>
</div>
</div>
<div class="row">
<div class="col s12 center-align">
<button class="btn wave-effect waves-light" type="submit">
Anzeigen
</button>
</div>
</div>
%= end
<div class="row">
<div class="col s12">
<p>
Die eingezeichneten Routen stammen aus dem HAFAS und sind im Detail
oft fehlerbehaftet.
</p>
</div>
</div>
% if (@{$skipped_journeys // []}) {
<div class="row">
<div class="col s12">
<p>
Die folgenden Fahrten wurden nicht eingezeichnet:
</p>
<p>
<ul>
% for my $pair (@{$skipped_journeys}) {
% my ($journey, $reason) = @{$pair};
<li><a href="/journey/<%= $journey->{id} %>"><%= $journey->{type} %> <%= $journey->{no} %> <%= $journey->{from_name} %> → <%= $journey->{to_name} %></a>: <%= $reason %></li>
% }
</ul>
</p>
</div>
</div>
% }