"""Decisions: decision blocks with their fields, options considered, and a vertical timeline. CSS: decisions.css.""" from .links import e, link, links, text from .status import lz def decision(x): """One decision in the chain, headed with what it is and its status, then its fields: Decided (the record's words, quoted, with its link), When and Who decided (each with how it's known), and Also recorded. Data: {"heading", "status": lozenge, "decided", "link", "when", "whenHow"?, "who", "whoHow"?, "also"?: [links], "alsoHow"?}. decision({"heading": "Newest decision", "status": {"text": "Decided", "tone": "success"}, "decided": "Cut over on Nov 16.", "link": {"title": "Search migration decision log", "url": "#", "icon": "page"}, "when": "Decided on Oct 16, 2026", "whenHow": "decision log row", "who": "Amara Lindqvist"}) """ def how(key): return f' ({e(x[key])})' if x.get(key) else '' fields = [('Decided', f'
{e(x["decided"])}{link(x["link"]) if x.get("link") else ""}'), ('When', e(x.get('when', '')) + how('whenHow')), ('Who decided', e(x.get('who') or 'No decider recorded') + how('whoHow'))] if x.get('also'): also = f' {e(x["alsoHow"])}' if x.get('alsoHow') else '' fields.append(('Also recorded', links(x['also']) + also)) dl = ''.join(f'
{text(x)}
{link(x["link"]) if x.get("link") else ""}