Allow for a list of URLs to be entered into the system.

This commit is contained in:
Josako
2024-07-08 15:17:10 +02:00
parent c55fc6b7ce
commit 8f08d6e1ae
3 changed files with 98 additions and 1 deletions

View File

@@ -37,6 +37,21 @@ class AddURLForm(FlaskForm):
session.get('tenant').get('allowed_languages')]
class AddURLsForm(FlaskForm):
urls = TextAreaField('URL(s) (one per line)', validators=[DataRequired()])
name = StringField('Name Prefix', validators=[Length(max=100)])
language = SelectField('Language', choices=[], validators=[Optional()])
user_context = TextAreaField('User Context', validators=[Optional()])
valid_from = DateField('Valid from', id='form-control datepicker', validators=[Optional()])
submit = SubmitField('Submit')
def __init__(self):
super().__init__()
self.language.choices = [(language, language) for language in
session.get('tenant').get('allowed_languages')]
class AddYoutubeForm(FlaskForm):
url = URLField('Youtube URL', validators=[DataRequired(), URL()])
name = StringField('Name', validators=[Length(max=100)])