Refactorising CodeMirror HTML editor, with an ultimate aim to make it reusable. However more work if required...

This commit is contained in:
Martin Green
2022-06-26 14:16:42 +01:00
parent 8f0ea8ed82
commit f1fcef2a6f
6 changed files with 210 additions and 233 deletions

View File

@@ -23,6 +23,8 @@ import troggle.settings as settings
from troggle.lib import version_control
from troggle.core.views.editor_helpers import HTMLarea
'''Formerly a separate package called 'flatpages' written by Martin Green 2011.
This was NOT django.contrib.flatpages which stores HTML in the database, so the name was changed to expopages.
@@ -380,5 +382,5 @@ class ExpoPageForm(forms.Form):
'''The form used by the editexpopage function
'''
title = forms.CharField(widget=forms.TextInput(attrs={'size':'60', 'placeholder': "Enter title (displayed in tab)"}))
html = forms.CharField(widget=forms.Textarea(attrs={"cols":80, "rows":20, 'placeholder': "Enter page content (using HTML)"}))
html = forms.CharField(widget=HTMLarea(attrs={"cols":80, "rows":20, 'placeholder': "Enter page content (using HTML)"}))
change_message = forms.CharField(widget=forms.Textarea(attrs={"cols":80, "rows":3, 'placeholder': "Descibe the change made (for git)"}))