Commit 3211028e authored by antoine-boiteau's avatar antoine-boiteau
Browse files

error message sent when map can't be loaded can now be translated and is now...

error message sent when map can't be loaded can now be translated and is now nested in the twig template (no more document.innerHTML use)
parent dfd6b949
......@@ -121,10 +121,8 @@ function previewMap(data, divMap, divLeaflet, map, overlay, img) {
}
img.src = response.url;
} else {
let error = document.createElement("p");
error.setAttribute("class", "alert alert-danger");
error.innerHTML = "Erreur : impossible de trouver la carte : " + data.image;
divMap.appendChild(error);
let error = document.getElementById("map-not-found");
error.style.display="block";
img.width = 0;
img.height = 0;
overlay.setUrl("/empty");
......
......@@ -89,7 +89,9 @@
<button class="btn btn-primary" id="hide-map" onclick="switchMapDisplay()" style="display:none; position: absolute; z-index: 9999; top: 60px; right: 35px">{% trans %} course.description.show.map {% endtrans %}</button>
<button class="btn btn-primary" onclick="printMap()" style="position: absolute; z-index: 9999; top: 105px; right: 35px">{% trans %} course.description.print {% endtrans %}</button>
<div id="map-div" style="min-width: 300px">
</div>
<p id="map-not-found" class="alert alert-danger" style="display : none">{% trans %}course.error.map.not.found{% endtrans %}</p>
</div>
<div id="description-tab" class="tab-content list-group">
<div class="d-flex">
......@@ -99,7 +101,7 @@
<p>{% trans %} course.description.date {% endtrans %} : {{ day }}/{{ month }}/{{ year }}</p>
{% else %}
<p>{% trans %} course.description.date {% endtrans %} : {{ month }}/{{ day }}/{{ year }}</p>
{% endif %}
{% endif %}
<p>{% trans %} course.description.control.point.number {% endtrans %} : {{ control_point_number }}</p>
<p>{% trans %} course.description.length {% endtrans %} : {{ length }}</p>
</div>
......
......@@ -162,6 +162,7 @@
<!-- Tab content -->
<div id="map-tab" class="tab-content">
<div id="map-div" style="min-width: 300px"></div>
<p id="map-not-found" class="alert alert-danger" style="display : none">{% trans %}course.error.map.not.found{% endtrans %}</p>
</div>
<div id="times-tab" class="tab-content">
<div id="time-sheet-div" style="min-width: 300px"></div>
......
......@@ -417,6 +417,10 @@ of Computer Science.</target>
<source>course.description.show.map</source>
<target>Show map</target>
</trans-unit>
<trans-unit id="n_2JCer" resname="course.error.map.not.found">
<source>course.error.map.not.found</source>
<target>The corresponding course's map was not found</target>
</trans-unit>
</body>
</file>
</xliff>
......@@ -516,6 +516,10 @@ de l’Informatique.</target>
<source>course.description.show.map</source>
<target>Montrer la carte</target>
</trans-unit>
<trans-unit id="n_2JCer" resname="course.error.map.not.found">
<source>course.error.map.not.found</source>
<target>La carte correspondante n'a pas été trouvée</target>
</trans-unit>
</body>
</file>
</xliff>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment