102 lines
2.7 KiB
HTML
102 lines
2.7 KiB
HTML
{% extends "base_list.html" %}
|
|
{% load static %}
|
|
|
|
{% block title %}{{object.title}}{% endblock %}
|
|
|
|
{% block head_extra %}
|
|
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
|
|
<style>
|
|
#map {
|
|
height: 400px;
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block lists %}
|
|
{% if object.description %}
|
|
<div class="row">
|
|
<div class="col-md">
|
|
<p>{{object.description}}</p>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% if trail_gpx_url %}
|
|
<div class="row">
|
|
<div class="col-md mb-3">
|
|
<div id="map"></div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
<div class="row">
|
|
<div class="col-md">
|
|
{% if object.trail.trailhead_location.display_address %}
|
|
<p>{{ object.trail.trailhead_location.display_address }}</p>
|
|
{% endif %}
|
|
{% if object.pdga_link or object.udisc_link %}
|
|
<p>
|
|
{% if object.pdga_link %}
|
|
<a href="{{ object.pdga_link }}" target="_blank">PDGA</a>
|
|
{% endif %}
|
|
{% if object.udisc_link %}
|
|
<a href="{{ object.udisc_link }}" target="_blank">uDisc</a>
|
|
{% endif %}
|
|
</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% if charts %}
|
|
<div class="row">
|
|
<div class="col-md">
|
|
{% include "scrobbles/_chart_links.html" %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
<div class="row">
|
|
<div class="col-md">
|
|
<h3>Last scrobbles</h3>
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-sm">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Date</th>
|
|
<th scope="col">Notes</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for scrobble in scrobbles.all %}
|
|
<tr>
|
|
<td><a href={{scrobble.get_absolute_url}}>{{scrobble.local_timestamp}}</a></td>
|
|
<td>{{scrobble.logdata.notes_as_str}}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block extra_js %}
|
|
{{ block.super }}
|
|
{% if trail_gpx_url %}
|
|
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/leaflet-gpx@2.2.0/gpx.min.js"></script>
|
|
<script>
|
|
var map = L.map('map');
|
|
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
maxZoom: 19,
|
|
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
|
referrerPolicy: 'origin'
|
|
}).addTo(map);
|
|
var gpx = new L.GPX("{{ trail_gpx_url|escapejs }}", {
|
|
async: true,
|
|
polyline_options: { color: '#e74c3c' }
|
|
});
|
|
gpx.on('loaded', function(e) {
|
|
map.fitBounds(e.target.getBounds());
|
|
});
|
|
gpx.addTo(map);
|
|
</script>
|
|
{% endif %}
|
|
{% endblock %}
|