mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-03-30 07:09:54 +01:00
Refactored code, with an aim of allowing more than one HTMLarea on a page
This commit is contained in:
@@ -133,3 +133,11 @@ class NewWebImageForm(forms.Form):
|
||||
|
||||
class HTMLarea(forms.Textarea):
|
||||
template_name = "widgets/HTMLarea.html"
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.iframeattrs = kwargs.pop('iframeattrs')
|
||||
super(forms.Textarea, self).__init__(*args, **kwargs)
|
||||
def get_context(self, name, value, attrs):
|
||||
c = super(forms.Textarea, self).get_context(name, value, attrs)
|
||||
c["iframe"] = {"attrs": self.iframeattrs}
|
||||
return c
|
||||
|
||||
|
||||
@@ -382,5 +382,6 @@ 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=HTMLarea(attrs={"cols":80, "rows":20, 'placeholder': "Enter page content (using HTML)"}))
|
||||
html = forms.CharField(widget=HTMLarea(iframeattrs = {"height": "80%"},
|
||||
attrs={"height":"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)"}))
|
||||
|
||||
Reference in New Issue
Block a user