'''
def tasks_card(tasks: list[dict[str, Any]], error: str = "") -> str:
"""Полный фрагмент карточки задач: заголовок + список + кнопка создания."""
if error:
body = f'
{html.escape(error)}
'
active = 0
else:
rows = "".join(task_row(t) for t in tasks)
body = rows or '
Задач нет или Radicale недоступен
'
active = sum(1 for t in tasks if not t.get("completed"))
return f'''
✅ Текущие задачи {active}
{body}
'''
def new_task_form() -> str:
"""Инлайн-форма создания задачи (Alpine x-data + hx-vals, без "
)
def object_chips() -> str:
'''Ряд чипов объектов: клик включает/выключает тег (Alpine).'''
from tasktracker.board import OBJECT_TAGS
chips = "".join(
f''
for tag in OBJECT_TAGS
)
return f'
{chips}
'
def quick_form(contacts: list[str] | None = None, error: str = "") -> str:
'''Форма быстрого создания заявки: описание, срок, приоритет, от кого, теги.'''
prio_opts = "".join(f'' for p in range(1, 6))
options = "".join(f'' for c in (contacts or []) if c)
err = f'
")
def board_html(board_data: dict[str, Any], contacts: list[str] | None = None,
error: str = "") -> str:
'''Вся доска (HTMX-корень #board): фильтры + форма быстрого создания + колонки.'''
show_all = bool(board_data.get("show_all_done"))
filters = board_data.get("filters") or {}
people = board_data.get("people") or []
if board_data.get("view") == "person":
lanes = []
for group in board_data.get("groups") or []:
columns = "".join(board_column(c, show_all, filters, people)
for c in group.get("columns") or [])
lanes.append(f'