1
0
Fork 0

Sandwitch and CSS fix

This commit is contained in:
Ethanell 2020-02-02 22:12:33 +01:00
parent 988f04f179
commit 97324b7342
3 changed files with 16 additions and 5 deletions

View file

@ -521,6 +521,13 @@ textarea.input2 + .focus-input2::after {
display: none;
}
.liste .WIP {
background-color: rgb(70, 170, 185);
}
.liste .finis {
background-color: rgb(185, 176, 30);
}
.liste .donnee {
background-color: rgb(0, 105, 0);

View file

@ -5,7 +5,9 @@ let done = document.getElementById("realisee");
let waiting = document.getElementById("attente");
function addcmd(id, plate, ingredient, sauce, drink, dessert, state, sandwitch) {
done.insertAdjacentHTML("beforeend", `<div id=cmd${id}> <h1>${id}</h1><h2></h2><p>${plate} | ${ingredient}</p><p>${sauce}</p><p>${drink}</p><p>${dessert}</p> </div>`);
if (!sandwitch)
sandwitch = "";
done.insertAdjacentHTML("beforeend", `<div id=cmd${id}> <h1>${id}</h1><h2>${sandwitch}</h2><p>${plate} | ${ingredient}</p><p>${sauce}</p><p>${drink}</p><p>${dessert}</p> </div>`);
let e = document.getElementById(`cmd${id}`);
switch (state) {
case "WIP":
@ -71,7 +73,7 @@ socket.on("list command", data => {
});
socket.on("list service", data => {
service = data["list"]
service = data["list"];
if (service.length === 0)
alert("No service set !");
else
@ -79,7 +81,7 @@ socket.on("list service", data => {
});
socket.on("new command", data => {
addcmd(data.id, data.plate, data.ingredient, data.sauce, data.drink, data.dessert, data.state);
addcmd(data.id, data.plate, data.ingredient, data.sauce, data.drink, data.dessert, data.state, data.sandwitch);
waiter();
});

View file

@ -10,7 +10,9 @@ let radios = {"plate": null, "drink": null, "dessert": null};
function addcmd(id, plate, ingredient, sauce, drink, dessert, state, sandwitch) {
list.insertAdjacentHTML("beforeend", `<div class="com" id="cmd${id}"> <button class="donner">Donnée</button> <h1>${id}</h1> <div class="spec"> <h2></h2><p>${plate}</p><p>${ingredient}</p><p>${sauce}</p><p>${drink}</p><p>${dessert}</p><button class="annuler">Annuler</button><button class="erreur">Erreur</button> </div> </div>`);
if (!sandwitch)
sandwitch = "";
list.insertAdjacentHTML("beforeend", `<div class="com" id="cmd${id}"> <button class="donner">Donnée</button> <h1>${id}</h1> <div class="spec"> <h2>${sandwitch}</h2><p>${plate}</p><p>${ingredient}</p><p>${sauce}</p><p>${drink}</p><p>${dessert}</p><button class="annuler">Annuler</button><button class="erreur">Erreur</button> </div> </div>`);
let e = document.querySelector(`.liste #cmd${id}`);
e.addEventListener( "click" ,ev => {
ev.stopPropagation();
@ -230,7 +232,7 @@ socket.on("list dessert", data => {
});
socket.on("new command", data => {
addcmd(data.id, data.plate, data.ingredient, data.sauce, data.drink, data.dessert, data.state);
addcmd(data.id, data.plate, data.ingredient, data.sauce, data.drink, data.dessert, data.state, data.sandwitch);
});
socket.on("cleared command", data => {