Пример #1
0
    def display(self, value=None, **kwargs):
        if value:
            value = line_break_xhtml(value)

        # Enable the rich text editor, if dictated by the settings:
        if tiny_mce_condition():
            if 'css_classes' in kwargs:
                kwargs['css_classes'].append('tinymcearea')
            else:
                kwargs['css_classes'] = ['tinymcearea']

        return TextArea.display(self, value, **kwargs)
Пример #2
0
    def display(self, value=None, **kwargs):
        if value:
            # XXX: First, try to translate this string. This is necessary for
            #      the "Legal Wording" section of the Upload settings. The
            #      default string was extracted correctly but not translated.
            value = _(value)

            value = line_break_xhtml(value)

        # Enable the rich text editor, if dictated by the settings:
        if tiny_mce_condition():
            if 'css_classes' in kwargs:
                kwargs['css_classes'].append('tinymcearea')
            else:
                kwargs['css_classes'] = ['tinymcearea']

        return TextArea.display(self, value, **kwargs)
Пример #3
0
 def _validate_description(self, key, value):
     self.description_plain = line_break_xhtml(line_break_xhtml(value))
     return value
Пример #4
0
 def _validate_description(self, key, value):
     self.description_plain = line_break_xhtml(
         line_break_xhtml(value)
     )
     return value