nuitdelinfo_2021/templates/article/article.html
2021-12-03 05:22:13 +01:00

81 lines
2.6 KiB
HTML

{% extends 'base.html' %}
{% load static %}
{% block content %}
{% include 'quicksearch.html' %}
<section class="article-detail">
<h1>{{ rescue.name }}</h1>
<p class="date">{{ rescue.date }}</p>
<p class="desc">{{ rescue.resume }}</p>
<div class="pic-flex">
<img src="{% static 'images/bateau.jpg' %}">
<div id="map" style="width:300px; height:300px"></div>
</div>
<div class="content">
{{ rescue.description.html | safe }}
</div>
<div class="save">
<div class="saver">
<h2>Sauveteurs :</h2>
{% for people in rescue.rescuers.all %}
<a href="/p/{{ people.pk }}">{{ people }}</a>
{% endfor %}
</div>
<div class="saved">
<h2>Personnes sauvées :</h2>
{% for people in rescue.saved.all %}
<a href="/p/{{ people.pk }}">{{ people }}</a>
{% endfor %}
</div>
</div>
</section>
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js" integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew==" crossorigin=""></script>
<script>
let map = L.map('map').setView([{{ rescue.location_long }}, {{ rescue.location_lat }}], 7);
const iconRetinaUrl = '{% static 'images/marker-icon-2x.png' %}';
const iconUrl = '{% static 'images/marker-icon.png' %}';
const shadowUrl = '{% static 'images/marker-shadow.png' %}';
const iconDefault = L.icon({
iconRetinaUrl,
iconUrl,
shadowUrl,
iconSize: [25, 41],
iconAnchor: [12, 41],
popupAnchor: [1, -34],
tooltipAnchor: [16, -28],
shadowSize: [41, 41]
});
L.Marker.prototype.options.icon = iconDefault;
let osmLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap contributors',
maxZoom: 19
});
L.marker([{{ rescue.location_long }}, {{ rescue.location_lat }}]).addTo(map).bindPopup('{{ rescue.name }}');
map.addLayer(osmLayer);
</script>
{% endblock %}
{% if not rescue.validated %}
{% if rescue.pending_edit_of %}
<h1>This edit is not validated !</h1>
{% else %}
<h1>This new entry is not validated !</h1>
{% endif %}
{% endif %}
{{ rescue.location_long }} {{ rescue.location_lat }} <br />
{{ rescue.testimonials.html | safe }} <br />
{{ rescue.sources.html | safe }}
<h3>Rescuers</h3>