pyfedi/app/topic/forms.py

20 lines
1,019 B
Python
Raw Normal View History

2024-01-28 18:11:32 +13:00
from flask import request
from flask_login import current_user
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, TextAreaField, BooleanField, HiddenField, SelectField, FileField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo, Length, Optional
from flask_babel import _, lazy_gettext as _l
from app.utils import MultiCheckboxField
from app import db
class ChooseTopicsForm(FlaskForm):
chosen_topics = MultiCheckboxField(_l('Choose some topics you are interested in'), coerce=int)
submit = SubmitField(_l('Choose'))
2024-08-06 16:25:27 -04:00
class SuggestTopicsForm(FlaskForm):
2024-08-07 12:21:00 -04:00
topic_name = TextAreaField(_l('New Topic Name'), validators=[DataRequired(), Length(min=1, max=100)], render_kw={'placeholder': 'New Topic name here...'})
2024-08-06 16:25:27 -04:00
communities_for_topic = TextAreaField(_l('Suggested Communities'), validators=[DataRequired(), Length(min=1, max=5000)], render_kw={'placeholder': 'Comma seperated list of community suggestions'})
submit = SubmitField(_l('Submit'))