fix(diarization-ui): escape braces in inline JS template to restore startup

This commit is contained in:
2026-03-21 14:38:40 +01:00
parent 90dd0c0e4b
commit 9e12bf4397

26
app.py
View File

@@ -369,27 +369,27 @@ def view_document(doc_id: int):
<div class='card mdview'>{rendered}</div>
<script>
window.postForm = async function(url, data) {
window.postForm = async function(url, data) {{
const body = new URLSearchParams(data);
const r = await fetch(url, {method:'POST', headers:{'Content-Type':'application/x-www-form-urlencoded'}, body});
if (!r.ok) { alert('Fehler: '+r.status); return; }
const r = await fetch(url, {{method:'POST', headers:{{'Content-Type':'application/x-www-form-urlencoded'}}, body}});
if (!r.ok) {{ alert('Fehler: '+r.status); return; }}
location.href = '/library';
};
window.renameDoc = function() {
}};
window.renameDoc = function() {{
const v = prompt('Neuer Dokumentname:', {json.dumps(d['title'])});
if (v===null) return;
window.postForm('/document/{doc_id}/rename', {title:v});
};
window.moveDoc = function() {
window.postForm('/document/{doc_id}/rename', {{title:v}});
}};
window.moveDoc = function() {{
const info = {json.dumps(project_list)};
const v = prompt('Ziel-Projekt-ID eingeben:\n'+info, '');
if (v===null) return;
window.postForm('/document/{doc_id}/move', {project_id:v});
};
window.deleteDoc = function() {
window.postForm('/document/{doc_id}/move', {{project_id:v}});
}};
window.deleteDoc = function() {{
if (!confirm('Dokument wirklich löschen?')) return;
window.postForm('/document/{doc_id}/delete', {});
};
window.postForm('/document/{doc_id}/delete', {{}});
}};
</script>
"""
return layout("Dokument", body)