Commit 014610b6 authored by Nicolas Dumazet's avatar Nicolas Dumazet

fix TestListbox.test_08_ExtraAndCssFieldsInLinesField: when rendering

non-editable LinesField/TextArea, use a <div> instead of the bare value to
be able to include CSS and Extra attributes


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33633 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2ecc033c
...@@ -531,9 +531,10 @@ class TextAreaWidget(Widget): ...@@ -531,9 +531,10 @@ class TextAreaWidget(Widget):
extra=field.get_value('extra')) extra=field.get_value('extra'))
def render_view(self, field, value, REQUEST, render_prefix=None): def render_view(self, field, value, REQUEST, render_prefix=None):
if value is None: return render_element("div",
return '' css_class=field.get_value('css_class'),
return value contents=html_quote(value),
extra=field.get_value('extra'))
def render_odt_view(self, field, value, as_string, ooo_builder, REQUEST, def render_odt_view(self, field, value, as_string, ooo_builder, REQUEST,
render_prefix, attr_dict, local_name): render_prefix, attr_dict, local_name):
...@@ -593,7 +594,12 @@ class LinesTextAreaWidget(TextAreaWidget): ...@@ -593,7 +594,12 @@ class LinesTextAreaWidget(TextAreaWidget):
return '' return ''
elif isinstance(value, (str, unicode)): elif isinstance(value, (str, unicode)):
value = [value] value = [value]
return string.join(value, field.get_value('view_separator')) return TextAreaWidget.render_view(
self,
field,
string.join(value, field.get_value('view_separator')),
REQUEST,
)
def render_odt_view(self, field, value, as_string, ooo_builder, REQUEST, def render_odt_view(self, field, value, as_string, ooo_builder, REQUEST,
render_prefix, attr_dict, local_name): render_prefix, attr_dict, local_name):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment