diff --git a/mayan/apps/appearance/templates/appearance/forms/widgets/textareadiv.html b/mayan/apps/appearance/templates/appearance/forms/widgets/textareadiv.html new file mode 100644 index 0000000000..fa5afb719e --- /dev/null +++ b/mayan/apps/appearance/templates/appearance/forms/widgets/textareadiv.html @@ -0,0 +1,3 @@ +
+{% if widget.value %}{{ widget.value }}{% endif %}
+ diff --git a/mayan/apps/common/widgets.py b/mayan/apps/common/widgets.py index b9a402f7c3..fa52d50545 100644 --- a/mayan/apps/common/widgets.py +++ b/mayan/apps/common/widgets.py @@ -109,6 +109,7 @@ class TextAreaDiv(forms.widgets.Widget): Class to define a form widget that simulates the behavior of a Textarea widget but using a div tag instead """ + template_name = 'appearance/forms/widgets/textareadiv.html' def __init__(self, attrs=None): # The 'rows' and 'cols' attributes are required for HTML correctness. @@ -117,15 +118,6 @@ class TextAreaDiv(forms.widgets.Widget): default_attrs.update(attrs) super(TextAreaDiv, self).__init__(default_attrs) - def render(self, name, value, attrs=None): - if value is None: - value = '' - - flat_attrs = flatatt(self.build_attrs(attrs, name=name)) - content = conditional_escape(force_text(value)) - result = '%s' % (flat_attrs, content) - return mark_safe(result) - def two_state_template(state, ok_icon='fa fa-check', fail_icon='fa fa-times'): if state: