Fix Vorlagen editor: drop Summernote, use code editor for all templates (STI-82)
Summernote WYSIWYG was mangling Django template syntax ({{ }}, {% %})
on save, causing content to revert to corrupted state. Switched all
template types to the plain code editor textarea which preserves
content exactly as-is.
Also removed jQuery/Summernote JS dependencies from the editor page,
and fixed getEditorContent reference in preview code.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -57,10 +57,9 @@ def vorlage_editor(request, pk):
|
||||
html_json = json.dumps(vorlage.html_inhalt)
|
||||
html_json = html_json.replace("<", "\\u003c").replace(">", "\\u003e")
|
||||
|
||||
# Serienbrief templates are full HTML documents with Django template tags
|
||||
# ({% for %}, {% if %}) — Summernote WYSIWYG mangles these.
|
||||
# Use a plain code editor textarea instead.
|
||||
use_code_editor = vorlage.kategorie == "serienbrief"
|
||||
# All templates contain Django template tags ({{ }}, {% %}) that
|
||||
# Summernote WYSIWYG mangles on save. Use plain code editor for all.
|
||||
use_code_editor = True
|
||||
|
||||
return render(request, "stiftung/vorlage_editor.html", {
|
||||
"vorlage": vorlage,
|
||||
|
||||
Reference in New Issue
Block a user