diff --git a/core/views/editor_helpers.py b/core/views/editor_helpers.py index f85d582..0051138 100644 --- a/core/views/editor_helpers.py +++ b/core/views/editor_helpers.py @@ -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 + diff --git a/core/views/expo.py b/core/views/expo.py index d84aa5f..1d07d6b 100644 --- a/core/views/expo.py +++ b/core/views/expo.py @@ -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)"})) diff --git a/templates/editexpopage.html b/templates/editexpopage.html index 22c9106..ae44333 100644 --- a/templates/editexpopage.html +++ b/templates/editexpopage.html @@ -1,15 +1,18 @@ {% extends "expobase.html" %} {% block title %}Edit {{ path }}{% endblock %} {% block extrahead %} - +{% include 'html_editor_scripts_css.html' %} {% endblock %} {% block body %} -

Edit {{ path }}

+

Edit {{ path }}

+{% include 'html_editor_pop_ups.html' %}
{% csrf_token %} {{ form.as_p }}

{% include "menu.html" %} -{% include 'html_editor_scripts_css.html' %} + + {% endblock %} + diff --git a/templates/html_editor_pop_ups.html b/templates/html_editor_pop_ups.html new file mode 100644 index 0000000..dfdc66d --- /dev/null +++ b/templates/html_editor_pop_ups.html @@ -0,0 +1,19 @@ + + + + + + diff --git a/templates/html_editor_scripts_css.html b/templates/html_editor_scripts_css.html index 5bd56d4..78dad9f 100644 --- a/templates/html_editor_scripts_css.html +++ b/templates/html_editor_scripts_css.html @@ -1,3 +1,5 @@ + + @@ -7,7 +9,64 @@ + + - - diff --git a/templates/widgets/HTMLarea.html b/templates/widgets/HTMLarea.html index 9837327..1f1c99a 100644 --- a/templates/widgets/HTMLarea.html +++ b/templates/widgets/HTMLarea.html @@ -1,32 +1,15 @@ - -
- - - +
{% include "django/forms/widgets/textarea.html" %} - - - - - - - - - - - - + + + + + + + + + + + +