blob: 01d94c1bc0beda7888376d37c13cb27cadf031f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
{% extends "layout.jinja2" %}
{% import "util.jinja2" as util with context %}
{% block content %}
<div class="container">
<h1>{{ journey.title }}</h1>
{% if show_edit_link %}
<div class="btn-group mb-3" role="group">
<a class="btn btn-success ui-element" href="{{ request.route_path('journey-edit', journey_id=journey.id) }}"><i class="bi-pencil-square"></i> {{ _("journey.edit") }}</a>
<button type="button" class="btn btn-info ui-element" id="showShareLink" data-bs-toggle="modal" data-bs-target="#shareLinkModal"><i class="bi-share"></i> {{ _("journey.share") }}</button>
<button type="button" class="btn btn-danger ui-element" id="deleteLink" data-bs-toggle="modal" data-bs-target="#deleteModal"><i class="bi bi-trash"></i> {{ _("journey.delete") }}</button>
</div>
<div class="modal fade" id="shareLinkModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ _("journey.sharelink.title") }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>{{ _("journey.sharelink.info") }}</p>
{% set share_link = request.route_url('journey-details', journey_id=journey.id, _query=[("secret", journey.link_secret)]) %}
<a href="{{ share_link }}">{{ share_link }}</a>
</div>
<div class="modal-footer">
<form method="POST" action="{{ request.route_url('journey-invalidate-share', journey_id=journey.id) }}">
{{ util.hidden_csrf_input() }}
<button type="submit" class="btn btn-warning ui-element">{{ _("journey.sharelink.invalidate") }}</button>
</form>
<button type="button" class="btn btn-secondary ui-element" data-bs-dismiss="modal">{{ _("journey.sharelink.close") }}</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="deleteModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ _("journey.delete.title") }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>{{ _("journey.delete.info") }}</p>
</div>
<div class="modal-footer">
<form method="POST" action="{{ request.route_url('delete-journey', journey_id=journey.id) }}">
{{ util.hidden_csrf_input() }}
<button type="submit" class="btn btn-danger ui-element">{{ _("journey.delete.delete") }}</button>
</form>
<button type="button" class="btn btn-secondary ui-element" data-bs-dismiss="modal">{{ _("journey.delete.close") }}</button>
</div>
</div>
</div>
</div>
{% endif %}
{% set gpx_url = request.route_path("journey-gpx", journey_id=journey.id) %}
<div id="mainmap" class="gpxview:{{ gpx_url }}:OSM" style="width:100%;height:600px">
<noscript><p>{{ _("page.noscript") }}<p></noscript>
</div>
<div id="mainmap_hp" style="width:100%;height:300px">
</div>
<table class="table table-hover" style="margin-top: 10px;">
<tbody>
<tr>
<th scope="row">{{ _("page.details.length") }}</th>
<td id="detailsLength">{{ (movement_data.length / 1000) | round(2) | format_decimal }} km</td>
</tr>
<tr>
<th scope="row">{{ _("page.details.uphill") }}</th>
<td id="detailsUphill">{{ movement_data.uphill | round(2) | format_decimal }} m</td>
</tr>
<tr>
<th scope="row">{{ _("page.details.downhill") }}</th>
<td id="detailsDownhill">{{ movement_data.downhill | round(2) | format_decimal }} m</td>
</tr>
<tr>
<th scope="row">{{ _("page.details.moving_time") }}</th>
<td id="detailsDownhill">{{ timedelta(seconds=movement_data.moving_duration) }}</td>
</tr>
<tr>
<th scope="row">{{ _("page.details.stopped_time") }}</th>
<td id="detailsDownhill">{{ timedelta(seconds=movement_data.stopped_duration) }}</td>
</tr>
<tr>
<th scope="row">{{ _("page.details.max_speed") }}</th>
<td id="detailsDownhill">{{ mps_to_kph(movement_data.maximum_speed) | round(2) | format_decimal }} km/h</td>
</tr>
<tr>
<th scope="row">{{ _("page.details.avg_speed") }}</th>
<td id="detailsDownhill">{{ mps_to_kph(movement_data.average_speed) | round(2) | format_decimal }} km/h</td>
</tr>
</tbody>
</table>
{{ md_to_html(journey.description) }}
<h2>{{ _("journey.tracks") }}</h2>
{% for track in tracks %}
<div class="card mb-3">
<h5 class="card-header">
<a href="{{ request.route_url('details', track_id=track.id) }}">{{ track.title | default(track.date, true) }}</a>
</h5>
<div class="card-body browse-track-card">
<div class="browse-track-preview">
<img src="{{ request.route_url('track-map', track_id=track.id) }}">
</div>
<div class="browse-track-data">
<table class="table table-hover table-sm browse-summary">
<tbody>
<tr>
<th scope="row">{{ _("page.details.date") }}</th>
<td>{{ track.date | format_datetime }}</td>
<th scope="row">{{ _("page.details.length") }}</th>
<td>{{ (track.length / 1000) | round(2) | format_decimal }} km</td>
</tr>
{% if track.show_organic_data() %}
<tr>
<th scope="row">{{ _("page.details.start_time") }}</th>
<td>{{ track.start_time | format_datetime }}</td>
<th scope="row">{{ _("page.details.end_time") }}</th>
<td>{{ track.end_time | format_datetime }}</td>
</tr>
{% endif %}
<tr>
<th scope="row">{{ _("page.details.uphill") }}</th>
<td>{{ track.uphill | round(2) | format_decimal }} m</td>
<th scope="row">{{ _("page.details.downhill") }}</th>
<td>{{ track.downhill | round(2) | format_decimal }} m</td>
</tr>
{% if track.show_organic_data() %}
<tr>
<th scope="row">{{ _("page.details.moving_time") }}</th>
<td>{{ track.moving_time }}</td>
<th scope="row">{{ _("page.details.stopped_time") }}</th>
<td>{{ track.stopped_time }}</td>
</tr>
<tr>
<th scope="row">{{ _("page.details.max_speed") }}</th>
<td>{{ mps_to_kph(track.max_speed) | round(2) | format_decimal }} km/h</td>
<th scope="row">{{ _("page.details.avg_speed") }}</th>
<td>{{ mps_to_kph(track.avg_speed) | round(2) | format_decimal }} km/h</td>
</tr>
{% endif %}
<tr>
<th scope="row"><i class="bi bi-chat-left-text-fill"></i> {{ _("page.browse.card.comments") }}</th>
<td>{{ track.comments | length }}</td>
<th scope="row"><i class="bi bi-images"></i> {{ _("page.browse.card.images") }}</th>
<td>{{ track.images | length }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
{% endfor %}
</div>
{% endblock %}
|