95 lines
2.9 KiB
HTML
95 lines
2.9 KiB
HTML
{% load static %}
|
|
{% load i18n %}
|
|
{% load controls_custom_filters %}
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% translate "Rapport de Contrôle" %}</title>
|
|
|
|
<!-- Bootstrap 5.3.3 (local) -->
|
|
<link rel="stylesheet" href="{% static 'common/bootstrap.min.css' %}">
|
|
|
|
<!-- MapLibre GL 5.7.0 (local) -->
|
|
<link href="{% static 'common/maplibre-gl.css' %}" rel="stylesheet" />
|
|
<script src="{% static 'common/maplibre-gl.js' %}"></script>
|
|
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
padding: 20px;
|
|
}
|
|
.map-container {
|
|
width: 100%;
|
|
height: 400px;
|
|
border: 1px solid #ddd;
|
|
margin-bottom: 20px;
|
|
}
|
|
.photos img {
|
|
width: 150px;
|
|
height: auto;
|
|
margin: 5px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<h1 class="text-center">{% translate "Rapport de Contrôle" %}</h1>
|
|
<h2 class="text-center">{{ control.name }}</h2>
|
|
<p><strong>{% translate "Numéro du rapport" %}:</strong> {{ control.report_number }}</p>
|
|
<p><strong>{% translate "Date" %}:</strong> {{ control.date|date:"d/m/Y H:i" }}</p>
|
|
|
|
<!-- ✅ Carte interactive -->
|
|
<div id="map" class="map-container"></div>
|
|
|
|
<div class="section">
|
|
<h3>{% translate "Statut du Projet" %}</h3>
|
|
<p>{{ control.status }}</p>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h3>{% translate "Photos d'Avancement" %}</h3>
|
|
<div class="photos">
|
|
{% for photo in control.photos.all %}
|
|
<img src="{{ photo.url }}" alt="Photo">
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h3>{% translate "Observations" %}</h3>
|
|
<ul>
|
|
{% for remark in control.remarks.all %}
|
|
<li>{{ remark.remark_number }} - {{ remark.description }}</li>
|
|
{% for image in remark.images.all %}
|
|
{% private_file_url image 'file' as image_file_url %}
|
|
{% private_file_url image 'thumbnail' as image_thumb_url %}
|
|
<a href="{{ image_file_url }}" target="_blank">
|
|
<img src="{{ image_thumb_url }}" alt="Remark Image">
|
|
</a>
|
|
{% endfor %}
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
|
|
<p>{% translate "Rapport généré par" %} {{ user.get_username }}</p>
|
|
|
|
<!-- ✅ Bouton pour exporter en PDF -->
|
|
<a href="{% url 'controls:export_pdf' control.id %}" class="btn btn-danger">📄 {% translate "Télécharger le PDF" %}</a>
|
|
|
|
<script>
|
|
// ✅ Initialiser la carte
|
|
var map = new maplibregl.Map({
|
|
container: 'map',
|
|
style: 'https://demotiles.maplibre.org/style.json',
|
|
center: [2.3522, 48.8566], // Coordonnées par défaut (Paris)
|
|
zoom: 4
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|