示例#1
0
 def test_CKEditorWidget_output_with_editor_options(self):
     widget = CKEditorWidget(editor_options={'iframe': True})
     name = 'body'
     value = '123'
     output = widget.render(name, value)
     self.assertHTMLEqual(
         output,
         ('<textarea cols="40" name="%s" rows="10">%s</textarea><script '
          'type="text/javascript">CKEDITOR.replace("%s", {"iframe": '
          'true});</script>' % (name, value, name)))
示例#2
0
 def test_CKEditorWidget_output(self):
     widget = CKEditorWidget()
     name = 'body'
     value = '123'
     output = widget.render(name, value)
     self.assertHTMLEqual(
         output,
         ('<textarea cols="40" name="%s" rows="10">%s</textarea><script '
          'type="text/javascript">CKEDITOR.replace("%s", {});</script>' %
          (name, value, name)))
示例#3
0
 class Meta:
     models = Category
     widgets = {# 'name': widgets.TextInput(attrs={'size': 63, }, ),
                # 'title': widgets.TextInput(attrs={'size': 63, }, ),
                #'name': AutosizedTextarea(attrs={'class': 'input-xxlarge', }, ),  # 'class': 'input-xlarge', 'style': 'with:500px;',
                'title': AutosizedTextarea(attrs={'class': 'input-xxlarge', }, ),
                # You can also specify html attributes
                # 'description': AutosizedTextarea(attrs={'rows': 3, 'class': 'input-xlarge'}),
                # 'item_description': CKEditorWidget(editor_options={'startupFocus': False, }, ),
                'item_description': CKEditorWidget(editor_options={'startupFocus': False, }, ),
                'description': CKEditorWidget(editor_options={'startupFocus': False, }, ),
                'bottom_description': CKEditorWidget(editor_options={'startupFocus': False, }, ),
                }
示例#4
0
文件: admin.py 项目: pugpe/pugpe
 class Meta:
     model = Event
     widgets = {
         'full_description': CKEditorWidget(
             editor_options={'startupFocus': True}
         )
     }
示例#5
0
 def test_CKEditorWidget_media(self):
     widget = CKEditorWidget()
     js_url = static(widget.Media.js[0])
     css_url = static(widget.Media.css['all'][0])
     self.assertHTMLEqual(
         str(widget.media), '<link href="%s" media="all" rel="stylesheet" '
         'type="text/css" /><script src="%s" '
         'type="text/javascript" />' % (css_url, js_url))
示例#6
0
 class Meta:
     model = Trip
     fields = '__all__'
     widgets = {
         'purpose_of_travel':
         AutosizedTextarea(attrs={'class': 'input-xlarge'}),
         'main_observations':
         CKEditorWidget(editor_options={'startupFocus': False}),
     }
示例#7
0
    class Meta:
        _ck_editor_toolbar = [
            {'name': 'basicstyles', 'groups': ['basicstyles', 'cleanup']},
            {'name': 'documents', 'groups': ['mode']}
        ]

        _ck_editor_config = {'autoGrow_onStartup': True,
                             'autoGrow_minHeight': 100,
                             'autoGrow_maxHeight': 250,
                             'extraPlugins': 'autogrow',
                             'toolbarGroups': _ck_editor_toolbar}

        widgets = {
            'address': CKEditorWidget(editor_options=_ck_editor_config),
            'specialisation_note': CKEditorWidget(editor_options=_ck_editor_config),
            'description_note': CKEditorWidget(editor_options=_ck_editor_config),
            'registration_note': CKEditorWidget(editor_options=_ck_editor_config)
        }
示例#8
0
class MixinModelAdmin:
    formfield_overrides = {
        models.ForeignKey: {
            'widget': Select2Widget
        },
        models.OneToOneField: {
            'widget': Select2Widget
        },
        models.TextField: {
            'widget': CKEditorWidget(editor_options={'startupFocus': True})
        },
    }
示例#9
0
    class Meta:
        _ck_editor_toolbar = [{
            'name': 'basicstyles',
            'groups': ['basicstyles', 'cleanup']
        }, {
            'name': 'documents',
            'groups': ['mode']
        }]

        _ck_editor_config = {
            'autoGrow_onStartup': True,
            'autoGrow_minHeight': 100,
            'autoGrow_maxHeight': 250,
            'extraPlugins': 'autogrow',
            'toolbarGroups': _ck_editor_toolbar
        }

        widgets = {
            'qa_requirement_note':
            CKEditorWidget(editor_options=_ck_editor_config),
            'eligibility':
            CKEditorWidget(editor_options=_ck_editor_config),
            'external_QAA_note':
            CKEditorWidget(editor_options=_ck_editor_config),
            'european_approach_note':
            CKEditorWidget(editor_options=_ck_editor_config),
            'general_note':
            CKEditorWidget(editor_options=_ck_editor_config),
            'recognition':
            CKEditorWidget(editor_options=_ck_editor_config)
        }
示例#10
0
    class Meta:
        model = WysiwygEditor

        _ck_editor_toolbar = [{
            'name': 'basicstyles',
            'groups': ['basicstyles', 'cleanup']
        }, {
            'name': 'paragraph',
            'groups': ['list', 'indent', 'blocks', 'align']
        }, {
            'name': 'document',
            'groups': ['mode']
        }, '/', {
            'name': 'styles'
        }, {
            'name': 'colors'
        }, {
            'name':
            'insert_custom',
            'items': ['Image', 'Flash', 'Table', 'HorizontalRule']
        }, {
            'name': 'about'
        }]

        _ck_editor_config = {
            'autoGrow_onStartup': True,
            'autoGrow_minHeight': 100,
            'autoGrow_maxHeight': 250,
            'extraPlugins': 'autogrow',
            'toolbarGroups': _ck_editor_toolbar
        }
        widgets = {
            'redactor':
            RedactorWidget(editor_options={
                'buttons': ['html', '|', 'formatting', '|', 'bold', 'italic']
            }),
            'redactor2':
            RedactorWidget,
            'ckeditor':
            CKEditorWidget(editor_options=_ck_editor_config),
        }
示例#11
0
 def test_CKEditorWidget_with_editor_options(self):
     options = {'iframe': True}
     widget = CKEditorWidget(editor_options=options)
     self.assertEqual(options, widget.editor_options)
示例#12
0
 class Meta:
     widgets = {
         'content': CKEditorWidget(attrs={'class': 'input-mini'}),
         'arrange_time': SuitSplitDateTimeWidget(),
     }
示例#13
0
 class Meta:
     model = Trip
     widgets = {
         'main_observations':
         CKEditorWidget(editor_options={'startupFocus': False})
     }
示例#14
0
 class Meta:
     widgets = {
         'text_ru': CKEditorWidget(editor_options={'lang': 'en'}),
         'text_en': CKEditorWidget(editor_options={'lang': 'en'})
     }
示例#15
0
文件: admin.py 项目: loaif/CSIR-API
 class Meta:
     exclude = []
     model = Section
     widgets = {
         'content': CKEditorWidget(),
     }
示例#16
0
 class Meta:
     widgets = {
         'patient_info':
         CKEditorWidget(editor_options={'startupFocus': True})
     }
示例#17
0
 def test_CKEditorWidget(self):
     widget = CKEditorWidget()
     self.assertEqual({}, widget.editor_options)
示例#18
0
 class Meta:
     widgets = {
         'name': CKEditorWidget(editor_options={'startupFocus': True})
     }