예제 #1
0
class AddPageForm(Form):
    date_added = fields.DateField('Publish On:',format="%m-%d-%Y",widget=DateWidget())
    date_end = fields.DateField('Expire On:',format="%m-%d-%Y",validators=[validators.Optional()],widget=DateWidget())
    name = fields.StringField('Page Name',validators=[validators.InputRequired()])
    description = fields.TextAreaField('Description',validators=[validators.Optional()])
    slug = fields.StringField('Page Slug',validators=[validators.InputRequired()])
    short_url = fields.StringField('Url',validators=[validators.Optional()])
    title = fields.StringField('Page Title',validators=[validators.InputRequired()])
    add_to_nav = fields.BooleanField('Add to Navbar')
    add_sidebar = fields.BooleanField('Add Sidebar')
    visible = fields.SelectField(choices=((1,'Publish'),(0,'Draft')))
    meta_title = fields.StringField('Meta Title',validators=[validators.InputRequired()])
    content = CodeMirrorField('Content',language='xml',config={'lineNumbers':'true'})
    template = fields.FormField(BaseTemplateForm,label="Template",separator='_')
    blocks = fields.SelectMultipleField(label="blocks",choices=[('a','a'),('b','b'),('c','c')])
    category = QuerySelectField('category')
    tags = TagField('Tags')
    use_base_template = fields.BooleanField('Use Base Template')
    base_template =  fields.SelectField(
                        'base template',validators=[
                            validators.InputRequired()
                        ],choices=[
                            (x,x) for x in sorted(get_page_templates()) \
                            if not x.startswith('_') and not \
                            x.startswith('.') and x.endswith('.html')
                        ]
    )
    submit = fields.SubmitField('Save')
예제 #2
0
파일: app.py 프로젝트: reynoldsm88/delphi
class MyForm(FlaskForm):
    source_code = CodeMirrorField(
        language="fortran",
        config={
            "lineNumbers": "true",
            "viewportMargin": 800
        },
    )
    submit = SubmitField("Submit", render_kw={"class": "btn btn-primary"})
예제 #3
0
class ModuleForm(Form):
    source_code = CodeMirrorField(
        language='python',
        config={
            'lineNumbers': 'true',
            'matchBrackets': 'true',
            'indentWithTabs': 'true',
            'indentUnit': 4
        },
    )
예제 #4
0
class MyForm(Form):
    source_code = CodeMirrorField(
        language='application/x-httpd-php',
        config={
            'lineNumbers': 'true',
            'matchBrackets': 'true',
            'indentWithTabs': 'true',
            'indentUnit': 4
        },
    )
    submit = SubmitField('Analyze')
예제 #5
0
class ArticlePostForm(FlaskForm):
    section = SelectField('Раздел: ', coerce=int)
    title = StringField('Название: ',
                        validators=[DataRequired(),
                                    Length(min=3, max=80)])
    description = TextAreaField('Описание (опционально): ',
                                validators=[Length(min=0, max=300)],
                                render_kw={
                                    "minlength": "0",
                                    "maxlength": "300",
                                })
    data = CodeMirrorField(language='markdown', config={'lineNumbers': 'true'})
    hash = HiddenField(label=None)
    submit = SubmitField("Отправить")
예제 #6
0
class CodemirrorForm(FlaskForm):
    source_code = CodeMirrorField(language='python',
                                  config={'lineNumbers': 'true'})
    submit = SubmitField('Submit')
    inputs = TextAreaField(u'inputs')
예제 #7
0
class SendProgram(FlaskForm):
    source_code = CodeMirrorField(language='python',
                                config={'lineNumbers' : 'true'})
    
    category = SelectField(choices=[('cpp', 'C++'), ('pas', 'Pascal ABC')])
    submit = SubmitField('Отправить')
예제 #8
0
class MyForm(Form):
    code = CodeMirrorField(language='python',
                           id='test',
                           config={'linenumbers': True})
예제 #9
0
파일: forms.py 프로젝트: ra2003/flask-cms
class CodeForm(Form):
    content = CodeMirrorField('content')
    file_name = fields.HiddenField('file_name')
    submit = fields.SubmitField('submit')
예제 #10
0
class MyForm(FlaskForm):
    source_code = CodeMirrorField(language='sql',
                                  config={'lineNumbers': 'true'})
    submit = SubmitField('执行')
예제 #11
0
class EditorForm(FlaskForm):
    rule_name = StringField('Name')
    rule_partition = StringField('Partition', default='Common')
    rule_body = CodeMirrorField(language='tcl', config={'lineNumbers': 'true'})