2021-12-03 04:53:31 +01:00
|
|
|
{% 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' %}">
|
2021-12-03 05:22:13 +01:00
|
|
|
<div id="map" style="width:300px; height:300px"></div>
|
2021-12-03 04:53:31 +01:00
|
|
|
</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>
|
2021-12-03 05:22:13 +01:00
|
|
|
<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>
|
2021-12-03 04:53:31 +01:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
2021-12-03 00:23:06 +01:00
|
|
|
{% 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 />
|
2021-12-03 04:53:31 +01:00
|
|
|
|
2021-12-03 00:23:06 +01:00
|
|
|
{{ rescue.testimonials.html | safe }} <br />
|
|
|
|
{{ rescue.sources.html | safe }}
|
|
|
|
|
2021-12-03 04:53:31 +01:00
|
|
|
|
2021-12-03 00:23:06 +01:00
|
|
|
|
|
|
|
<h3>Rescuers</h3>
|
2021-12-03 04:53:31 +01:00
|
|
|
|