From 97324b7342d36bceb939fe4989774bc50e00c1b5 Mon Sep 17 00:00:00 2001 From: flifloo Date: Sun, 2 Feb 2020 22:12:33 +0100 Subject: [PATCH] Sandwitch and CSS fix --- app/static/css/main.css | 7 +++++++ app/static/js/kitchen.js | 8 +++++--- app/static/js/pc.js | 6 ++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/static/css/main.css b/app/static/css/main.css index 1028cc3..5808761 100644 --- a/app/static/css/main.css +++ b/app/static/css/main.css @@ -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); diff --git a/app/static/js/kitchen.js b/app/static/js/kitchen.js index bdf0ae6..b34a6b9 100644 --- a/app/static/js/kitchen.js +++ b/app/static/js/kitchen.js @@ -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", `

${id}

${plate} | ${ingredient}

${sauce}

${drink}

${dessert}

`); + if (!sandwitch) + sandwitch = ""; + done.insertAdjacentHTML("beforeend", `

${id}

${sandwitch}

${plate} | ${ingredient}

${sauce}

${drink}

${dessert}

`); 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(); }); diff --git a/app/static/js/pc.js b/app/static/js/pc.js index c11ce47..14eead5 100644 --- a/app/static/js/pc.js +++ b/app/static/js/pc.js @@ -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", `

${id}

${plate}

${ingredient}

${sauce}

${drink}

${dessert}

`); + if (!sandwitch) + sandwitch = ""; + list.insertAdjacentHTML("beforeend", `

${id}

${sandwitch}

${plate}

${ingredient}

${sauce}

${drink}

${dessert}

`); 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 => {