2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 15:37:16 +00:00

Refactored code, with an aim of allowing more than one HTMLarea on a page

This commit is contained in:
Martin Green
2022-06-26 18:29:20 +01:00
parent f1fcef2a6f
commit 4e5d8d1d76
6 changed files with 197 additions and 140 deletions

View File

@@ -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