diff options
author | Denise sur Lya <sekhmet@lya> | 2020-07-28 00:19:54 +0200 |
---|---|---|
committer | Denise sur Lya <sekhmet@lya> | 2020-07-28 00:19:54 +0200 |
commit | 8b5845ffdbffa3cf291bfef8e224c1d81bdd09de (patch) | |
tree | 1741943e151131c590641bb7d4de9f963f2e4c1d /static | |
parent | bc1faf7cc9cf3a6c41e077c361edcc93419cc77d (diff) | |
download | oms-8b5845ffdbffa3cf291bfef8e224c1d81bdd09de.tar.gz oms-8b5845ffdbffa3cf291bfef8e224c1d81bdd09de.tar.zst oms-8b5845ffdbffa3cf291bfef8e224c1d81bdd09de.zip |
Courbe de taille ajoutée + plein de params qui vont avec
Diffstat (limited to 'static')
-rw-r--r-- | static/requetes.js | 31 | ||||
-rw-r--r-- | static/style.css | 2 |
2 files changed, 25 insertions, 8 deletions
diff --git a/static/requetes.js b/static/requetes.js index bf8d484..57330b3 100644 --- a/static/requetes.js +++ b/static/requetes.js | |||
@@ -14,7 +14,8 @@ function appelle_image() | |||
14 | 14 | ||
15 | // on récupère les différents champs de la réponse | 15 | // on récupère les différents champs de la réponse |
16 | var result = this.response.result ; | 16 | var result = this.response.result ; |
17 | var image = this.response.image ; | 17 | var image_poids = this.response.image_poids ; |
18 | var image_taille = this.response.image_taille ; | ||
18 | var liste_warnings = this.response.messages | 19 | var liste_warnings = this.response.messages |
19 | var texte = this.response.export_txt; | 20 | var texte = this.response.export_txt; |
20 | var nomenfant = this.response.nomenfant ; | 21 | var nomenfant = this.response.nomenfant ; |
@@ -30,13 +31,29 @@ function appelle_image() | |||
30 | 31 | ||
31 | if(result == "success") | 32 | if(result == "success") |
32 | { | 33 | { |
33 | // On affiche l'image | 34 | // On affiche l'image, si elle est là |
34 | document.getElementById('courbe').src = 'data:image/png;base64,'+(image); | 35 | if (image_poids != "") { |
35 | document.getElementById('sectioncourbe').style.display = "block"; | 36 | document.getElementById('sectioncourbe').style.display = "block"; |
37 | document.getElementById('section_courbe_poids').style.display = "block" ; | ||
38 | document.getElementById('courbe_poids').src = 'data:image/png;base64,'+(image_poids); | ||
39 | boutondl = document.getElementById("courbe_dl_poids") ; | ||
40 | boutondl.setAttribute('onclick',"download_file('courbe_poids_"+nomenfant+".png', 'image/png;base64','"+image_poids +"')") | ||
41 | } | ||
42 | else { | ||
43 | document.getElementById('section_courbe_poids').style.display = "none" ; | ||
44 | } | ||
45 | |||
46 | if (image_taille != "") { | ||
47 | document.getElementById('sectioncourbe').style.display = "block"; | ||
48 | document.getElementById('section_courbe_taille').style.display = "block" ; | ||
49 | document.getElementById('courbe_taille').src = 'data:image/png;base64,'+(image_taille); | ||
50 | boutondl = document.getElementById("courbe_dl_taille") ; | ||
51 | boutondl.setAttribute('onclick',"download_file('courbe_taille_"+nomenfant+".png', 'image/png;base64','"+image_taille +"')") | ||
52 | } | ||
53 | else { | ||
54 | document.getElementById('section_courbe_taille').style.display = "none" ; | ||
55 | } | ||
36 | 56 | ||
37 | //document.getElementById("courbe_dl").setAttribute('href', 'data:image/png;base64,' + image); | ||
38 | boutondl = document.getElementById("courbe_dl") ; | ||
39 | boutondl.setAttribute('onclick',"download_file('courbe_"+nomenfant+".png', 'image/png;base64','"+image +"')") | ||
40 | 57 | ||
41 | // Si y'a eu des warnings, faut les afficher | 58 | // Si y'a eu des warnings, faut les afficher |
42 | if(liste_warnings.length != 0) | 59 | if(liste_warnings.length != 0) |
diff --git a/static/style.css b/static/style.css index 414f996..e967761 100644 --- a/static/style.css +++ b/static/style.css | |||
@@ -22,7 +22,7 @@ img#courbe { | |||
22 | max-width: 100% | 22 | max-width: 100% |
23 | } | 23 | } |
24 | 24 | ||
25 | #sectioncourbe { | 25 | #sectioncourbe, #section_courbe_poids, #section_courbe_taille { |
26 | display: none; | 26 | display: none; |
27 | } | 27 | } |
28 | 28 | ||