Rename Flask template app to pbpl

Signed-off-by: Arija A. <ari@ari.lt>
This commit is contained in:
2025-10-23 20:38:04 +03:00
parent caf4ac7c06
commit 56aee59790
15 changed files with 11 additions and 352 deletions

36
src/pbpl/forms/text.py Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Text form"""
import typing as t
from flask_wtf import FlaskForm # type: ignore
from wtforms import HiddenField, SubmitField, TextAreaField # type: ignore
from wtforms.validators import DataRequired, Length # type: ignore
from pbpl.const import TEXT_SIZE_MAX
__all__: t.Tuple[str, ...] = ("TextForm",)
class TextForm(FlaskForm):
"""Example text form"""
text = TextAreaField(
"Enter some text here",
validators=(
DataRequired(message="You must enter text"),
Length(
min=1,
max=TEXT_SIZE_MAX,
message=f"Invalid length (min=1, max={TEXT_SIZE_MAX}",
),
),
)
pow_solution = HiddenField(
"Proof of Work Solution",
validators=[DataRequired(message="Proof of work is required to submit.")],
)
form_submit = SubmitField("Submit text")