Code-Input was updated to 1.2.2 and currently works! I have the upload functionality working and have begun working on an undo button. It currently saves all the files to a dir everytime you access /templates but I haven't implemented a full undo yet.
This commit is contained in:
57
app/forms.py
57
app/forms.py
@ -1,10 +1,55 @@
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms.fields import SubmitField
|
||||
from wtforms.fields import (SubmitField,
|
||||
PasswordField,
|
||||
StringField,
|
||||
TextAreaField,
|
||||
IntegerField,
|
||||
BooleanField,
|
||||
RadioField)
|
||||
from wtforms.validators import InputRequired, Length
|
||||
from flask_wtf.file import FileField, FileRequired
|
||||
from werkzeug.utils import secure_filename
|
||||
from flask_codemirror.fields import CodeMirrorField
|
||||
|
||||
class TemplateForm(FlaskForm):
|
||||
template_code = CodeMirrorField(
|
||||
language='htmlembedded',
|
||||
config={'lineNumbers': 'true'})
|
||||
submit = SubmitField('Submit')
|
||||
|
||||
class ApiKey(FlaskForm):
|
||||
api_key = PasswordField('Api Key',
|
||||
validators=[InputRequired(),
|
||||
Length(min=20, max=25)]
|
||||
)
|
||||
|
||||
|
||||
class TemplateForm(FlaskForm):
|
||||
name = StringField("Template File Name",
|
||||
validators=[InputRequired()])
|
||||
|
||||
body = TextAreaField("Template Code",
|
||||
validators=[InputRequired()])
|
||||
|
||||
submit = SubmitField('Upload Templates')
|
||||
|
||||
# template_code = CodeMirrorField( language='htmlembedded',
|
||||
# config={'lineNumbers': 'true'})
|
||||
|
||||
class CsvForm(FlaskForm):
|
||||
file = FileField(validators=[FileRequired()])
|
||||
all_or_some = RadioField("All or Some",
|
||||
choices=['All learners in all groups',
|
||||
'Learners only in adjacent groups'],
|
||||
validators=[InputRequired()])
|
||||
|
||||
|
||||
|
||||
class CourseForm(FlaskForm):
|
||||
title = StringField('Title',
|
||||
validators=[InputRequired(),
|
||||
Length(min=10, max=100)])
|
||||
description = TextAreaField('Course Description',
|
||||
validators=[InputRequired(),
|
||||
Length(max=200)])
|
||||
price = IntegerField('Price', validators=[InputRequired()])
|
||||
level = RadioField('Level',
|
||||
choices=['Beginner', 'Intermediate', 'Advanced'],
|
||||
validators=[InputRequired()])
|
||||
available = BooleanField('Available', default='checked')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user