mirror of
https://gitverse.ru/kpa39l/email-assistant.git
synced 2026-11-27 18:33:08 +00:00
fix: add-task button visibility — explicit hx-trigger=click + hide on click
This commit is contained in:
+1
-1
@@ -392,7 +392,7 @@ def tasks_reload(request: Request, _: AuthDep):
|
|||||||
</div>''')
|
</div>''')
|
||||||
items_html = "".join(items) or '<div class="empty">Задач нет или Radicale недоступен</div>'
|
items_html = "".join(items) or '<div class="empty">Задач нет или Radicale недоступен</div>'
|
||||||
active = sum(1 for t in tasks if not t["completed"])
|
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>
|
html = f'''<div class="chead">✅ Текущие задачи <span class="cnt">{active}</span></div>
|
||||||
<div class="cbody">
|
<div class="cbody">
|
||||||
{items_html}{btn}</div>'''
|
{items_html}{btn}</div>'''
|
||||||
|
|||||||
Reference in New Issue
Block a user