diff --git a/app/sockets.py b/app/sockets.py index 38a45ee..3db8824 100644 --- a/app/sockets.py +++ b/app/sockets.py @@ -22,7 +22,6 @@ def authenticated_only(f): def command_json(c): ingredient = " - ".join([s.id for s in c.content]) sauces = " - ".join([s.id for s in c.sauce]) - sandwich = None if c.error: state = "error" elif c.give: @@ -35,13 +34,16 @@ def command_json(c): state = "waiting" else: state = "unknown" - if c.sandwich_id: - try: - sandwich = User.query.get(c.sandwich_id).username - except AttributeError: - pass + try: + client = User.query.get(c.client_id).username + except AttributeError: + client = None + try: + sandwich = User.query.get(c.sandwich_id).username + except AttributeError: + sandwich = None return {"id": c.number, "plate": c.plate_id, "ingredient": ingredient, "sauce": sauces, "drink": c.drink_id, - "dessert": c.dessert_id, "state": state, "sandwich": sandwich} + "dessert": c.dessert_id, "state": state, "sandwich": sandwich, "client": client} @socketio.on("connect") diff --git a/app/static/css/main.css b/app/static/css/main.css index 262efe9..a7de22d 100644 --- a/app/static/css/main.css +++ b/app/static/css/main.css @@ -729,11 +729,11 @@ audio{ color: rgb(122, 233, 105); } -#attente div :nth-child(2), #attente div :nth-child(3) { +#attente div :nth-child(2), #attente div :nth-child(4), #attente div :nth-child(5) { display: none; } -#realisee div :nth-child(2), #realisee div :nth-child(3){ +#realisee div :nth-child(2), #realisee div :nth-child(4), #realisee div :nth-child(5){ display: none; } diff --git a/app/static/js/kitchen.js b/app/static/js/kitchen.js index 3551aa8..e95a566 100644 --- a/app/static/js/kitchen.js +++ b/app/static/js/kitchen.js @@ -3,10 +3,10 @@ let WIP = document.getElementById("encours"); let done = document.getElementById("realisee"); let waiting = document.getElementById("attente"); -function addcmd(id, plate, ingredient, sauce, drink, dessert, state, sandwich) { +function addcmd(id, plate, ingredient, sauce, drink, dessert, state, client, sandwich) { if (!sandwich) sandwich = ""; - done.insertAdjacentHTML("beforeend", `
${plate} | ${ingredient}
${sauce}
${drink}
${dessert}
${plate} | ${ingredient}
${sauce}
${drink}
${dessert}
${plate}
${ingredient}
${sauce}
${drink}
${dessert}
${plate}
${ingredient}
${sauce}
${drink}
${dessert}