ops bot: task lists go out one card per task with Сделано / Перенести buttons

This commit is contained in:
maksarsanjeev
2026-11-09 00:47:21 +03:00
parent 1889439ed7
commit a4f5a89026
2 changed files with 42 additions and 19 deletions
+10
View File
@@ -55,6 +55,16 @@ def tree(nodes: list, depth: int = 0) -> list[str]:
return out
def task_line(t: dict, depth: int, today: date) -> str:
"""One task as a standalone card text (sent as its own message with buttons)."""
mark = "⏱" if t["running"] else ("▶️" if t["status"] == "doing" else "📌")
due = f"\nСрок: {human_day(t['due'], today)}" if t["due"] else ""
mins = f"\nУчтено: {t['minutes']} мин" if t["minutes"] else ""
client = f" [{client_name(t['client'])}]" if t["client"] else ""
indent = "└ " * depth
return f"{indent}{mark} <b>{escape(t['title'])}</b>{client}{due}{mins}"
def subs(rows: list, by_client: dict, today: date) -> str:
"""Grouped by company, each with its monthly total."""
if not rows: