feat: the venue's identity in every app: its colour as the accent of the waiters' phones and every terminal screen, customer display looks on the identity, the signage logo widget falls back to the venue's logo
Settings -> Venue -> accent "The venue's identity" (venue.theme = identity): bootstrap carries the identity's first colour and logos; @xenia/ui applyVenueTheme makes the accent tokens (light and dark, readable foregrounds) from it. A display look's "Colours and logo" can be the venue's identity. Plan 6R.20, F-117. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,7 @@ class IdleBody(BaseModel):
|
||||
qr_url: Optional[str] = Field(default=None, max_length=300)
|
||||
qr_caption: Optional[str] = Field(default=None, max_length=80)
|
||||
theme: Literal["dark", "light"] = "dark"
|
||||
brand: Literal["own", "identity"] = "own" # 6R.20: the venue's identity: its colour as the accent, its logo when the look has none
|
||||
|
||||
@field_validator("qr_url")
|
||||
@classmethod
|
||||
@@ -157,7 +158,15 @@ def idle_out(db, look: DisplayLook | None) -> dict:
|
||||
cfg = config_of(look)
|
||||
pics = _pictures(db, [cfg["logo"], cfg["image"], *cfg["slides"]])
|
||||
url = lambda i, size: (media_store.image_of(pics[i]) or {}).get(size) if i in pics else None # noqa: E731
|
||||
return {**cfg, "logo_url": url(cfg["logo"], "card"), "image_url": url(cfg["image"], "full"),
|
||||
logo = url(cfg["logo"], "card")
|
||||
accent = None
|
||||
if cfg.get("brand") == "identity":
|
||||
from core.modules.api import _identity_brief
|
||||
ib = _identity_brief(db)
|
||||
accent = ib["colour"]
|
||||
# its own logo first; else the identity's (the one made for this background, else the main one)
|
||||
logo = logo or (ib["logo_light"] if cfg.get("theme", "dark") == "dark" else ib["logo_dark"]) or ib["logo"]
|
||||
return {**cfg, "logo_url": logo, "accent": accent, "image_url": url(cfg["image"], "full"),
|
||||
"slide_urls": [u for u in (url(i, "full") for i in cfg["slides"]) if u],
|
||||
"qr_link": _qr_link(cfg) if cfg["style"] == "qr" else None}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user