feat(signage): menu look part by part, board-only names, stack bar, Delete key (owner review 3)
- Menus (slides and widgets): headings / names / prices each with size, colour, font, bold / italic / underline and alignment; dots size, colour and style; line and letter spacing; photo size and shape (menuLook) - Names aligned right end together, prices in a page-wide column - Names for one board only (names, category_names) with a pencil on the board's list; the catalogue name stays for the waiters - Fixed: menu lists inherited the page's fixed line height (big text overlapped); a menu slide's list grew past the screen (no 2nd column) - Stacks: parts sized by dragging the lines on the bar; "Add a widget" - Delete / Backspace removes the picked widget Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -95,3 +95,25 @@ def test_the_editor_previews_any_slide(client, owner_h, menu):
|
||||
m = r.json()["menu"]
|
||||
assert "Beer" in [i["name"] for g in m["groups"] for i in g["items"] if i.get("hidden")] and m["count"] == 3
|
||||
assert err(client.post("/api/signage/preview/slide", headers=owner_h, json={"kind": "text", "content": {"widgets": [stack()]}})) == "signage.content_invalid"
|
||||
|
||||
|
||||
def test_a_board_has_its_own_names_and_the_look_of_each_part(client, owner_h, menu):
|
||||
"""Owner review 3 (2026-11-21): names only for this board (the catalogue keeps its own), the look
|
||||
of headings, names, prices and the dots, spacing, photos."""
|
||||
content = {"category_ids": [menu["cats"]["drinks"]], "names": {str(menu["beer"].id): " Craft beer "}, "category_names": {str(menu["cats"]["drinks"]): "Bar"},
|
||||
"heading_style": {"size": 180, "colour": "#ff0000", "font": "serif", "align": "center", "italic": True},
|
||||
"price_style": {"align": "right", "bold": False}, "dot_style": {"style": "dashed", "size": 150},
|
||||
"line_height": 1.4, "letter_spacing": 0.05, "photo_size": 150, "photo_shape": "round"}
|
||||
r = client.post("/api/signage/preview/slide", headers=owner_h, json={"kind": "menu", "content": content})
|
||||
assert r.status_code == 200, r.text
|
||||
g = r.json()["menu"]["groups"][0]
|
||||
assert g["category"] == {"id": menu["cats"]["drinks"], "name": "Bar", "original": "Drinks"}
|
||||
assert g["items"][0]["name"] == "Craft beer" and g["items"][0]["original"] == "Beer"
|
||||
p = playlist(client, owner_h)
|
||||
s = slide(client, owner_h, p["id"], "menu", content=content)
|
||||
c = s["content"]
|
||||
assert c["names"] == {str(menu["beer"].id): "Craft beer"} and c["heading_style"]["italic"] and c["item_style"]["bold"]
|
||||
assert c["price_style"] == {"size": None, "colour": None, "font": None, "bold": False, "italic": False, "underline": False, "align": "right"}
|
||||
url = f"/api/signage/playlists/{p['id']}/slides"
|
||||
for bad in ({"names": {"x": "a"}}, {"heading_style": {"size": 20}}, {"dot_style": {"style": "wavy"}}, {"line_height": 9}, {"photo_shape": "star"}):
|
||||
assert err(client.post(url, headers=owner_h, json={"kind": "menu", "content": bad})) == "signage.content_invalid", bad
|
||||
|
||||
Reference in New Issue
Block a user