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>''')
|
||||
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>'''
|
||||
|
||||
Reference in New Issue
Block a user