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)))
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)))
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, }, ), }
class Meta: model = Event widgets = { 'full_description': CKEditorWidget( editor_options={'startupFocus': True} ) }
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))
class Meta: model = Trip fields = '__all__' widgets = { 'purpose_of_travel': AutosizedTextarea(attrs={'class': 'input-xlarge'}), 'main_observations': CKEditorWidget(editor_options={'startupFocus': False}), }
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) }
class MixinModelAdmin: formfield_overrides = { models.ForeignKey: { 'widget': Select2Widget }, models.OneToOneField: { 'widget': Select2Widget }, models.TextField: { 'widget': CKEditorWidget(editor_options={'startupFocus': True}) }, }
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) }
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), }
def test_CKEditorWidget_with_editor_options(self): options = {'iframe': True} widget = CKEditorWidget(editor_options=options) self.assertEqual(options, widget.editor_options)
class Meta: widgets = { 'content': CKEditorWidget(attrs={'class': 'input-mini'}), 'arrange_time': SuitSplitDateTimeWidget(), }
class Meta: model = Trip widgets = { 'main_observations': CKEditorWidget(editor_options={'startupFocus': False}) }
class Meta: widgets = { 'text_ru': CKEditorWidget(editor_options={'lang': 'en'}), 'text_en': CKEditorWidget(editor_options={'lang': 'en'}) }
class Meta: exclude = [] model = Section widgets = { 'content': CKEditorWidget(), }
class Meta: widgets = { 'patient_info': CKEditorWidget(editor_options={'startupFocus': True}) }
def test_CKEditorWidget(self): widget = CKEditorWidget() self.assertEqual({}, widget.editor_options)
class Meta: widgets = { 'name': CKEditorWidget(editor_options={'startupFocus': True}) }