forked from crunk/distribusi-verse
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
941 B
35 lines
941 B
"""Form to save your CSS editor work."""
|
|
from wtforms import (
|
|
StringField,
|
|
TextAreaField,
|
|
BooleanField,
|
|
SubmitField,
|
|
)
|
|
|
|
from wtforms import validators
|
|
from wtforms.validators import Length
|
|
from flask_wtf.file import FileField, FileAllowed, FileSize
|
|
from flask_wtf import FlaskForm
|
|
|
|
|
|
class EditorForm(FlaskForm):
|
|
"""Css editor form class."""
|
|
|
|
cssname = StringField(
|
|
"fill in a name for your css style:",
|
|
validators=[validators.InputRequired(), Length(5, 200)],
|
|
)
|
|
cssfile = FileField(
|
|
"(Optional) upload your own css file:",
|
|
validators=[
|
|
FileAllowed(["css"], "css files only!"),
|
|
FileSize(
|
|
max_size=10485760,
|
|
message="css file size must be smaller than 10MB",
|
|
),
|
|
],
|
|
)
|
|
css = TextAreaField()
|
|
public = BooleanField("Make your CSS public so others can use it")
|
|
|
|
submit = SubmitField("Save")
|
|
|