fix(diarization-ui): escape braces in inline JS template to restore startup
This commit is contained in:
26
app.py
26
app.py
@@ -369,27 +369,27 @@ def view_document(doc_id: int):
|
|||||||
<div class='card mdview'>{rendered}</div>
|
<div class='card mdview'>{rendered}</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.postForm = async function(url, data) {
|
window.postForm = async function(url, data) {{
|
||||||
const body = new URLSearchParams(data);
|
const body = new URLSearchParams(data);
|
||||||
const r = await fetch(url, {method:'POST', headers:{'Content-Type':'application/x-www-form-urlencoded'}, body});
|
const r = await fetch(url, {{method:'POST', headers:{{'Content-Type':'application/x-www-form-urlencoded'}}, body}});
|
||||||
if (!r.ok) { alert('Fehler: '+r.status); return; }
|
if (!r.ok) {{ alert('Fehler: '+r.status); return; }}
|
||||||
location.href = '/library';
|
location.href = '/library';
|
||||||
};
|
}};
|
||||||
window.renameDoc = function() {
|
window.renameDoc = function() {{
|
||||||
const v = prompt('Neuer Dokumentname:', {json.dumps(d['title'])});
|
const v = prompt('Neuer Dokumentname:', {json.dumps(d['title'])});
|
||||||
if (v===null) return;
|
if (v===null) return;
|
||||||
window.postForm('/document/{doc_id}/rename', {title:v});
|
window.postForm('/document/{doc_id}/rename', {{title:v}});
|
||||||
};
|
}};
|
||||||
window.moveDoc = function() {
|
window.moveDoc = function() {{
|
||||||
const info = {json.dumps(project_list)};
|
const info = {json.dumps(project_list)};
|
||||||
const v = prompt('Ziel-Projekt-ID eingeben:\n'+info, '');
|
const v = prompt('Ziel-Projekt-ID eingeben:\n'+info, '');
|
||||||
if (v===null) return;
|
if (v===null) return;
|
||||||
window.postForm('/document/{doc_id}/move', {project_id:v});
|
window.postForm('/document/{doc_id}/move', {{project_id:v}});
|
||||||
};
|
}};
|
||||||
window.deleteDoc = function() {
|
window.deleteDoc = function() {{
|
||||||
if (!confirm('Dokument wirklich löschen?')) return;
|
if (!confirm('Dokument wirklich löschen?')) return;
|
||||||
window.postForm('/document/{doc_id}/delete', {});
|
window.postForm('/document/{doc_id}/delete', {{}});
|
||||||
};
|
}};
|
||||||
</script>
|
</script>
|
||||||
"""
|
"""
|
||||||
return layout("Dokument", body)
|
return layout("Dokument", body)
|
||||||
|
|||||||
Reference in New Issue
Block a user