fix: tasks card loads via hx-trigger=load (всегда содержит add-task кнопку + inline edit). Убран статический Jinja-рендер блока задач.
This commit is contained in:
+3
-1
@@ -395,7 +395,9 @@ def tasks_reload(request: Request, _: AuthDep):
|
||||
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>'''
|
||||
{items_html}
|
||||
<button class="add-task" hx-get="/api/tasks/new-form" hx-target="closest .card .cbody" hx-swap="beforeend">+ Новая задача</button>
|
||||
</div>'''
|
||||
return HTMLResponse(html)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user