fix: add-task button visibility — explicit hx-trigger=click + hide on click

This commit is contained in:
2026-10-24 07:19:14 +00:00
parent c1cbd4bc46
commit ed024f3822
+1 -1
View File
@@ -392,7 +392,7 @@ def tasks_reload(request: Request, _: AuthDep):
</div>''')
items_html = "".join(items) or '<div class="empty">Задач нет или Radicale недоступен</div>'
active = sum(1 for t in tasks if not t["completed"])
btn = '<button class="add-task" hx-get="/api/tasks/new-form" hx-target="closest .cbody" hx-swap="beforeend">+ Новая задача</button>'
btn = '<button class="add-task" hx-get="/api/tasks/new-form" hx-target="closest .cbody" hx-swap="beforeend" hx-trigger="click" onclick="this.style.display=\'none\'">+ Новая задача</button>'
html = f'''<div class="chead">✅ Текущие задачи <span class="cnt">{active}</span></div>
<div class="cbody">
{items_html}{btn}</div>'''