Exemple #1
0
class TestUEditorForm(forms.Form):
    content = UEditorField('', width=900, height=300, toolbars="full", imagePath="static/images/",
                           filePath="static/files/",

                           upload_settings={"imageMaxSize": 1204000},

                           settings={})
Exemple #2
0
class ActivityForm(Form):
    """党日活动Form"""

    title = fields.CharField(required=False,
                             label='活动主题',
                             max_length=128,
                             error_messages={'required': '活动主题不能为空'},
                             widget=forms.TextInput(attrs={
                                 'class': 'form-control',
                                 'placeholder': "请输入活动主题"
                             }))

    time = fields.DateField(required=False,
                            label='活动时间',
                            error_messages={'required': '活动日期不能为空!'},
                            widget=forms.TextInput(attrs={
                                'class': 'form-control',
                                'type': 'date'
                            }))

    place = fields.CharField(required=False,
                             label='活动地点',
                             max_length=64,
                             error_messages={'required': '活动地点不能为空'},
                             widget=forms.TextInput(attrs={
                                 'class': 'form-control',
                                 'placeholder': "请输入活动地点"
                             }))
    content = UEditorField(
        u'活动内容',
        required=False,
        height=450,
        toolbars="full",
        error_messages={'required': '活动内容不能为空'},
    )
Exemple #3
0
class UEditorForm(forms.Form):

    try:
        CATEGORY = Category.objects.all().values_list('id', 'name')
    except Category.DoesNotExist as e:
        print(e)
    else:
        CATEGORY = [
            (0,'python'),
            (1,u'前端'),
        ]
    ARTICLE_FROM = [
        (0, u'原创'),
        (1, u'转载'),
    ]
    title = forms.CharField(label=u'标题',widget=forms.TextInput(attrs={'class': 'form-control', 'name':'title','placeholder':u'请输入文章标题'}))
    category = forms.IntegerField(label=u'类型',widget=forms.Select(choices=CATEGORY,attrs={'class':'form-control'}))
    article_from = forms.IntegerField(label=u'来源',widget=forms.Select(choices=ARTICLE_FROM,attrs={'class':'form-control'}))
    summary = forms.CharField(label=u'摘要',widget=forms.Textarea(attrs={'class': 'form-control','placeholder':u'请输入文章摘要'}))
    tags = forms.CharField(label=u'标签',widget=forms.TextInput(attrs={'class': 'form-control','placeholder':u'请输入文章标签,用逗号分隔,最多输入三个标签'}))
    content = UEditorField(label=u'正文', width=810, height=500, imagePath='article/ueditor/',filePath='article/ueditor/',toolbars='full')

    def __init__(self, *args, **kwargs):
        super(UEditorForm, self).__init__(*args, **kwargs)
        self.fields['category'].widget.choices = Category.objects.all().values_list('id','name')

    def clean(self):
        title = self.cleaned_data.get('title')
        article_from = self.cleaned_data.get('article_from')
        category = self.cleaned_data.get('category')
        summary = self.cleaned_data.get('summary')
        tags = self.cleaned_data.get('tags')
        content = self.cleaned_data.get('content')
        return self.cleaned_data
class ArticleForm(forms.ModelForm):
    art_title = forms.CharField(label='标题', max_length=50,widget=forms.TextInput(attrs={'class':'form-control'}))
    art_intro = forms.CharField(label='简介', max_length=50,widget=forms.TextInput(attrs={'class':'form-control'}))
    art_content = UEditorField(label='正文', height=300, width=600, toolbars='full', imagePath='images/', filePath='files/', upload_settings={'imageMasSize': 1204000}, settings={})
    class Meta:
        model = models.Article
        fields = ('art_title', 'art_content', 'art_intro')
Exemple #5
0
class ArticleCommentsForm(forms.Form):
    body = UEditorField("",
                        width=650,
                        height=160,
                        max_length=10000,
                        toolbars="mini",
                        imagePath="./FileDir/blogmaterials/uploadpic/",
                        filePath="./FileDir/blogmaterials/uploadFile/")
Exemple #6
0
class CommentForm(forms.Form):
    comment_body = UEditorField('内容',
                                width=400,
                                height=300,
                                toolbars="mini",
                                imagePath="images/",
                                filePath="files/",
                                upload_settings={"imageMaxSize": 1204000},
                                settings={})
Exemple #7
0
class UeditorForm(forms.Form):
    content_udt = UEditorField(label="富文本编辑器",
                               width=922,
                               height=600,
                               toolbars="full",
                               imagePath=getImagePath(),
                               filePath=getUploadPath(),
                               upload_settings={"imageMaxSize": 1204000},
                               settings={})
Exemple #8
0
class TestForm(forms.Form):
    content = UEditorField('内容',
                           width=600,
                           height=300,
                           toolbars="full",
                           imagePath="updates/imgs",
                           filePath="updates/files/",
                           upload_settings={"imageMaxSize": 1204000},
                           settings={})
Exemple #9
0
class ArticleForm(forms.Form):
    category = forms.CharField(label=u"类别")
    title = forms.CharField(max_length=100, label=u"文章标题")
    content = UEditorField(label=u"文章内容",width=1000, height=300, imagePath="ueitor/image",
                           toolbars='full', filePath='ueitor/image')
    poll_num = forms.IntegerField(label=u"点击量")
    comment_num = forms.IntegerField(label=u"评论数量")
    keep_num = forms.IntegerField(label=u"收藏数量")
    add_time = forms.DateTimeField(label=u"添加时间")
Exemple #10
0
class ArticlePostForm(forms.Form):
    title = forms.CharField()
    content = UEditorField('内容',
                           width=800,
                           height=900,
                           toolbars="full",
                           imagePath="images/",
                           filePath="files/",
                           upload_settings={"imageMaxSize": 1204000},
                           settings={})
Exemple #11
0
class ArticalForm(forms.Form):
    biaoti = forms.CharField()
    lanmu_name = forms.CharField()
    file = forms.FileField(required=False)
    neirong = UEditorField(u'内容	',
                           width=960,
                           height=500,
                           toolbars="full",
                           imagePath="",
                           filePath="",
                           upload_settings={"imageMaxSize": 12040000})
Exemple #12
0
class CommentForm(forms.Form):
    visitor = forms.CharField(max_length=20)
    email = forms.EmailField(max_length=20, required=False, label='E-mail')
    content = UEditorField(u"评论内容",initial=u"很好吃",width=800,height=100)
    # content = forms.CharField(max_length=200, widget=forms.Textarea())

    def clean_content(self):
        content = self.cleaned_data['content']
        if len(content) < 5:
            raise forms.ValidationError(u'字数不足')
        return content
Exemple #13
0
class PhotoUeditorForm(forms.Form):
    content = UEditorField('',
                           initial='',
                           width=800,
                           height=800,
                           settings={
                               'toolbars': [[
                                   'fullscreen', 'undo', 'redo', 'cleardoc',
                                   '|', 'simpleupload', 'insertimage',
                                   'imageleft', 'imageright', 'imagecenter'
                               ]]
                           })
Exemple #14
0
class TestUEditorForm(forms.Form):
    Name = forms.CharField(label=u'姓名')
    ImagePath = forms.CharField()
    Description = UEditorField(u"描述", initial="abc", width=1000, height=300)
    Content = forms.CharField(label=u"内容",
                              widget=UEditorWidget({
                                  "width": 600,
                                  "height": 100,
                                  "imagePath": 'aa',
                                  "filePath": 'bb',
                                  "toolbars": "full"
                              }))
Exemple #15
0
class NotifyForm(forms.Form):

    # level = forms.ChoiceField(label='通知等级', choices=(('success','成功'),('info', '信息'),
    #                                                  ('warning', '警告'),('error', '错误')))

    recipient = forms.IntegerField(label='接收者ID', help_text='请输入接收者的用户ID')

    verb = forms.CharField(label='通知主题', )

    description = UEditorField(label='通知内容',
                               imagePath='notify/img',
                               filePath='notify/file',
                               toolbars='mini')
Exemple #16
0
class MemoForm(forms.ModelForm):
    content = UEditorField('内容',
                           width=600,
                           height=300,
                           toolbars="full",
                           imagePath="images/",
                           filePath="files/",
                           upload_settings={"imageMaxSize": 120400000},
                           settings={})

    class Meta:
        model = Memo
        fields = ('title', 'content', 'category', 'image2')
class Commitform(forms.Form):
    commitcontent = UEditorField(
        label="评论内容",
        width=860,
        required=True,
        settings={
            "toolbars": [[
                'undo', 'redo', 'bold', 'indent', 'justifyleft',
                'justifyright', 'justifycenter', 'justifyjustify',
                'superscript', 'formatmatch', 'insertimage', 'emotion',
                'spechars', 'fullscreen'
            ]],
            "maximumWords":
            1000,
        },
    )
Exemple #18
0
class DocumentForm(forms.ModelForm):
    author = forms.CharField(
        label='作者', widget=widgets.TextInput(attrs={'class': 'form-control'}))
    title = forms.CharField(
        label='标题',
        max_length=128,
        widget=widgets.TextInput(attrs={'class': 'form-control'}))
    content = UEditorField(label='内容',
                           width=950,
                           height=300,
                           toolbars="full",
                           imagePath="wiki/images/",
                           filePath="wiki/files/",
                           upload_settings={"imageMaxSize": 1204000},
                           settings={})

    class Meta:
        model = Documents
        fields = ['title', 'content', 'author']
Exemple #19
0
class CommonUeditorForm(forms.Form):
    content = UEditorField(
        '',
        initial='',
        width=800,
        height=800,
        settings={
            'toolbars':
            [[
                'source', 'fullscreen', 'undo', 'redo', 'cleardoc', '|',
                'fontfamily', 'fontsize', 'bold', 'italic', 'underline',
                'strikethrough', 'justifyleft', 'justifyright',
                'justifycenter', 'forecolor', 'backcolor'
            ],
             [
                 'inserttable', 'inserttitle', 'insertrow', 'insertcol',
                 'mergeright', 'mergedown', 'deleterow', 'deletecol',
                 'splittorows', 'splittocols', 'splittocells', 'deletecaption',
                 'mergecells', 'deletetable', 'edittable', 'edittd', '|',
                 'simpleupload', 'insertimage', 'insertvideo', 'imageleft',
                 'imageright', 'imagecenter', '|', 'attachment'
             ]]
        })
Exemple #20
0
class TestUEditorForm(forms.Form):
	Description=UEditorField("test-ueditor",initial="这是一个测试的富文本编辑器!!",width=600,height=800)
Exemple #21
0
class ContentForm(forms.Form):
    content = UEditorField("描述", initial="abc", width=600, height=800)
Exemple #22
0
class TestUEditorForm(forms.Form):
    content = UEditorField('content',initial='success',width=600,height=800)
Exemple #23
0
class TestUEditorForm(forms.Form):
    Name=forms.CharField('姓名')
    ImagePath=forms.CharField()
    Description=UEditorField("描述",initial="abc",width=600,height=800)
    Content=forms.CharField(label="内容",widget=UEditorWidget(width=800,height=500, imagePath='aa', filePath='bb',toolbars={}))
Exemple #24
0
class TestUEditorForm(forms.Form):
    title = forms.CharField(max_length=100)
    content = UEditorField(u"描述", initial="", width=1100, height=400)
Exemple #25
0
class BlankEditor(forms.Form):
    Content = UEditorField("", initial="", height=430)
class TestUEditorForm(forms.Form):
    Description = UEditorField("描述", initial="abc", width=600, height=800)
Exemple #27
0
class TestUEditorForm(forms.Form):
    content = UEditorField('内容(不能为空)', width=720, height=400, toolbars="full", imagePath="images/", filePath="files/",
    upload_settings={"imageMaxSize":1204000},settings={})
Exemple #28
0
 class TestUEditorForm(forms.Form):
     # initial 指定Ueditor内容
     content=UEditorField("",initial=sqldata.content,width=782,height=400,imagePath="uploads/images/",toolbars='full', filePath='uploads/files/')
Exemple #29
0
class ContentForm(Form):
    title = fields.CharField(max_length=100)
    content = UEditorField(u'内容	', height=300, toolbars="full")
Exemple #30
0
 class TestUEditorForm(forms.Form):
     intro=UEditorField("",initial=sqldata.intro,width=782,height=400,imagePath="uploads/images/",toolbars='full', filePath='uploads/files/')