예제 #1
0
 class Meta:
     model = UserProfile
     password = forms.CharField(label='Password', help_text='')
     bio = forms.CharField(
         label='Reporter beats',
         help_text='What will you focus on in your reporting?')
     widgets = {'bio': RedactorWidget(editor_options={'lang': 'en'})}
     fields = ['first_name', 'last_name', 'email', 'phone', 'bio', 'byline']
     exclude = [
         'pub_name', 'pub_type', 'user', 'user_type', 'can_publish',
         'about', 'last_login', 'date_joined', 'is_staff', 'is_active',
         'address', 'city', 'state', 'zipcode', 'pub_area', 'twitter',
         'facebook', 'website', 'is_superuser', 'groups', 'user_permissions'
     ]
예제 #2
0
class RegularMeetingAdmin(ModelAdmin):
    # form = RegularMeetingForm
    list_display = ('speaker', 'title', 'meeting_time')
    list_display_links = list_display
    autocomplete_fields = ['speaker']
    list_filter = ['speaker', 'meeting_time']
    formfield_overrides = {
        models.TextField: {
            'widget':
            RedactorWidget(editor_options={
                'lang': 'en',
                'minHeight': '200'
            })
        }
    }
예제 #3
0
 class Meta:
     model = TemplateEmail
     fields = ('subject', 'sender', 'html_content', 'text_content',
               'content_type')
     widgets = {
         'html_content':
         RedactorWidget(editor_options={
             'buttons': ['html', '|', 'formatting', '|', 'bold', 'italic']
         }),
         'text_content':
         AutosizedTextarea(attrs={
             'class': 'span-12',
             'rows': 10
         }),
     }
예제 #4
0
 def formfield_for_dbfield(self, db_field, **kwargs):
     if not 'widget' in kwargs:
         if db_field.name in ('descripcion'):
             kwargs['widget'] = RedactorWidget(
                 editor_options=REDACTOR_OPTIONS_SM)
         elif db_field.name in ('meta_descripcion', ):
             kwargs['widget'] = AutosizedTextarea(
                 attrs={
                     'rows': 3,
                     'class': 'input-block-level'
                 })
         #elif db_field.name in ('tags',):
         #     kwargs['widget'] = Select2TagWidget(
         #        attrs={'data-token-separators': '[","]'})
     return super(ModelAdminBase,
                  self).formfield_for_dbfield(db_field, **kwargs)
예제 #5
0
 class Meta:
     model = Video
     exclude = ['pk']
     widgets = {
         'archivo_original':
         TextInput(
             attrs={
                 'data-fp-apikey': 'Ajx8hpwBjSzWFvcASlVIOz',
                 'data-fp-button-text': 'Elegir archivo...',
                 'data-fp-language': 'es',
                 'type': 'filepicker-dragdrop',
                 'onchange':
                 '$("button[name=_save]").removeAttr("disabled")'
             }),
         'descripcion':
         RedactorWidget(editor_options=REDACTOR_OPTIONS_LG),
         'fecha_creacion':
         TextInput(attrs={'class': 'input-small'}),
         'metadescripcion':
         AutosizedTextarea(attrs={
             'rows': 6,
             'class': 'input-block-level'
         }),
         'pais':
         Select2Widget(attrs={
             'data-placeholder': 'Ninguno',
             'data-minimumResultsForSearch': 10
         }),
         'resumen':
         AutosizedTextarea(attrs={
             'class': 'input-block-level',
             'rows': 2
         }),
         'sprites':
         AdminImageWidget,
         #'tags': Select2TagWidget(attrs={'data-token-separators': '[","]'}),
         'territorio':
         Select2Widget(
             attrs={
                 'data-placeholder': 'Ninguno',
                 'data-minimum-results-for-search': 10
             }),
         'titulo':
         TextInput(attrs={'class': 'input-block-level'}),
         'usuario_creacion':
         TextInput(attrs={'class': 'input-small'}),
     }
예제 #6
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),
        }
예제 #7
0
 class Meta:
     widgets = {
         'image':
         AdminImageWidget(),
         'description':
         RedactorWidget(
             editor_options={
                 'lang':
                 'en',
                 'buttons': [
                     'html', '|', 'formatting', '|', 'bold', 'italic', '|',
                     'unorderedlist', 'orderedlist', 'outdent', 'indent',
                     'alignment', 'horizontalrule', 'underline', '|',
                     'image', '|', 'link'
                 ],
                 'imageUpload':
                 '/clients/redactor/image/',
             }),
         'price':
         NumberInput(attrs={'min': '0'}),
         'price':
         EnclosedInput(prepend='$'),
         'brand':
         Select2Widget(select2_options={'width': '220px'}),
         'model':
         SfWidget(app_name='phone',
                  model_name='model',
                  chain_field='brand',
                  model_field='brand',
                  show_all=False,
                  auto_choose=False,
                  attrs={'class': 'form-control'},
                  select2_options={"width": "220px"}),
         'type':
         Select2Widget(select2_options={'width': '220px'}),
     }
예제 #8
0
 class Meta:
     model = Testimonial
     widgets = {
         'body': RedactorWidget(editor_options={'lang': 'en'}),
     }
     fields = '__all__'  #
예제 #9
0
 class Meta:
     widgets = {'content': RedactorWidget(editor_options={'lang': 'en'})}
     model = Post
     exclude = ['date_posted']
예제 #10
0
파일: forms.py 프로젝트: ketanbhatt/tmrw
 class Meta:
     widgets = {
         'notes': RedactorWidget(editor_options={}),
     }
예제 #11
0
class FlatPageCustom(FlatPageAdmin):
    formfield_overrides = {
        models.TextField: {
            'widget': RedactorWidget(editor_options={'lang': 'en'})
        }
    }
예제 #12
0
 class Meta:
     widgets = {
         'description': RedactorWidget(editor_options={'lang': 'en'})
     }
예제 #13
0
 class Meta:
     model = CruiseDeal
     fields = ('description', )
     widgets = {
         'description': RedactorWidget(editor_options={'lang': 'en'})
     }
예제 #14
0
파일: forms.py 프로젝트: axeliodiaz/Umail
 class Meta:
     model = Comentarios
     widgets = {'comentario': RedactorWidget(editor_options={'lang': 'es'})}
예제 #15
0
 def test_RedactorWidget_with_editor_options(self):
     options = {'iframe': True}
     widget = RedactorWidget(editor_options=options)
     self.assertEqual(options, widget.editor_options)
예제 #16
0
 class Meta:
     model = Message
     widgets = {
                 'body': RedactorWidget(editor_options={'lang': 'es'})
             }
예제 #17
0
 class Meta:
     widgets = {
         'content':
         RedactorWidget(
             editor_options={'buttons': ['html', '|', 'bold', 'italic']})
     }
예제 #18
0
파일: admin.py 프로젝트: thezak48/Tacnet
 class Meta:
     widgets = {
         'intro': RedactorWidget(editor_options={'lang': 'en'}),
         'text': RedactorWidget(editor_options={'lang': 'en'})
     }
예제 #19
0
 def test_RedactorWidget(self):
     widget = RedactorWidget()
     self.assertEqual({}, widget.editor_options)
예제 #20
0
 class Meta:
     model = TeamMember
     widgets = {
         'bio': RedactorWidget(editor_options={'lang': 'en'}),
     }
     fields = '__all__'  #
예제 #21
0
 class Meta:
     widgets = {'post': RedactorWidget(editor_options={'lang': 'en'})}
예제 #22
0
파일: admin.py 프로젝트: secclesia/newshaus
 class Meta:
     widgets = {'text': RedactorWidget(editor_options={'lang': 'es'})}
예제 #23
0
 class Meta:
     widgets = {'content': RedactorWidget(editor_options={'lang': 'ru'})}
예제 #24
0
파일: forms.py 프로젝트: Wayne1316/game
 class Meta:
     widgets = {
         'html': RedactorWidget(editor_options={'startupFocus': True, 'width': 640, 'height': 400}),
     }
예제 #25
0
파일: forms.py 프로젝트: ketanbhatt/tmrw
 class Meta:
     widgets = {
         'day_summary': RedactorWidget(editor_options={}),
         'scrum_summary': RedactorWidget(editor_options={})
     }
예제 #26
0
 class Meta:
     model = ContactInfo
     widgets = {
         'statement': RedactorWidget(editor_options={'lang': 'en'}),
     }
     fields = '__all__'  #
예제 #27
0
파일: forms.py 프로젝트: ketanbhatt/tmrw
 class Meta:
     widgets = {'response': RedactorWidget(editor_options={})}
예제 #28
0
 class Meta:
     model = ConsultationType
     widgets = {
         'description': RedactorWidget(editor_options={'lang': 'en'}),
     }
     fields = '__all__'  #
예제 #29
0
 class Meta:
     model = RegularMeeting
     exclude = ['user']
     widgets = {
         'main_content': RedactorWidget(editor_options={'lang': 'en'})
     }
예제 #30
0
 class Meta:
     model = Article
     widgets = {
         'body': RedactorWidget(editor_options={'lang': 'en'}),
     }
     fields = '__all__'  #