From 739e8da215ba8390f7e690bdb4792c0a9e951619 Mon Sep 17 00:00:00 2001 From: Christophe St-Georges <christophe.st-georges@polymtl.ca> Date: Sat, 5 Dec 2020 11:15:48 -0500 Subject: [PATCH] Added fridge disponibility to Listefrigo --- css/styles.css | 10 ++++++++++ html/listeFrigos.html | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/css/styles.css b/css/styles.css index cb8b73f..42be712 100644 --- a/css/styles.css +++ b/css/styles.css @@ -202,6 +202,7 @@ iframe { text-decoration: none; color:black; margin-top:1em; + position: relative; } .grey-label{ @@ -248,6 +249,15 @@ iframe { top: 12px; } +.img-dispo{ + position: absolute; + width: 40px; + height: 39px; + top: 29px; + left: 842px; +} + + .insc { width: 418px; diff --git a/html/listeFrigos.html b/html/listeFrigos.html index 9c378a2..ee8ccef 100644 --- a/html/listeFrigos.html +++ b/html/listeFrigos.html @@ -17,13 +17,20 @@ function retrieveFrigos(){ var obj = httpGetJson(); var builtUpHTML = ""; + var dispo = ""; for(let i = 0; i<obj.array.length; i++) { + if(obj.array[i].dispo == true){ + dispo = '<img src="../dispo.png" class="img-dispo"}/>' + }else{ + dispo = '<img src="../nondispo.png" class="img-dispo"}/>' + } builtUpHTML += '<a class="fridgeOutline" onclick="saveFrigoIndex(event,'+i+')" href="chercherUnRepas.html" >' + ' <span class="bold">' + obj.array[i].nom + ' </span><br>' + obj.array[i].addresse + ' <br>Situé à '+obj.array[i].distance+' mètres\n' + + dispo + ' </a>' } document.getElementById("listeFrigo").innerHTML+= builtUpHTML; -- GitLab