--- a/app/soc/views/helper/widgets.py Sun Feb 15 13:59:36 2009 +0000
+++ b/app/soc/views/helper/widgets.py Sun Feb 15 14:54:42 2009 +0000
@@ -37,16 +37,30 @@
class ReadOnlyInput(forms.widgets.Input):
"""Read only input widget.
"""
+
input_type = 'text'
def render(self, name, value, attrs=None):
"""Render ReadOnlyInput widget as HTML.
"""
+
attrs['readonly'] = 'readonly'
attrs['class'] = 'plaintext'
+
return super(ReadOnlyInput, self).render(name, value, attrs)
+class PlainTextWidget(forms.widgets.Widget):
+ """Read only input widget.
+ """
+
+ def render(self, name, value, attrs=None):
+ """Render ReadOnlyInput widget as HTML.
+ """
+
+ return str(value) if value else ""
+
+
class FullTinyMCE(forms.widgets.Textarea):
"""TinyMCE widget.