mirror of
https://gitverse.ru/kpa39l/email-assistant.git
synced 2026-11-27 18:33:08 +00:00
fix: email_detail button (HTMX hx-vals вместо onclick, ломавшего HTML). fix: task_toggle Form-params (Без темы). feat: create_task HTMX-ответ (✅/✗).
This commit is contained in:
@@ -20,7 +20,9 @@
|
||||
</div>
|
||||
<div style="display:flex;gap:6px;align-items:center">
|
||||
<button class="pb-btn" title="Создать задачу в Radicale"
|
||||
onclick="var b=this;fetch('/api/tasks/create',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({subject:{{ current.meta.get('subject','(без темы)')|tojson|safe }},from:{{ current.meta.get('from','')|tojson|safe }},body:{{ current.body[:300]|tojson|safe }},path:{{ current.path|tojson|safe }}})}).then(r=>r.json()).then(d=>{if(d.ok){b.textContent='✅';b.disabled=true;b.title='Задача создана'}else{alert('Ошибка: '+d.error)}}).catch(e=>alert('Ошибка: '+e));return false">📋</button>
|
||||
hx-post="/api/tasks/create"
|
||||
hx-vals='{"subject":{{ (current.meta.get('subject') or '(без темы)')|tojson|safe }},"from":{{ (current.meta.get('from') or '')|tojson|safe }},"body":{{ (current.body or '')[:300]|tojson|safe }},"path":{{ (current.path or '')|tojson|safe }},"email":"{{ (current.meta.get('from') or '')|e }}"}'
|
||||
hx-swap="outerHTML">📋</button>
|
||||
<button class="pchev" onclick="this.classList.toggle('open');document.getElementById('phdrs').classList.toggle('open')">⌄</button>
|
||||
</div>
|
||||
<div class="phdrs" id="phdrs" style="flex-basis:100%">
|
||||
|
||||
Reference in New Issue
Block a user