mirror of
https://github.com/StefBuwalda/WebTech.git
synced 2025-10-30 03:10:00 +00:00
We balling
This commit is contained in:
@@ -6,8 +6,16 @@ from flask_wtf.file import FileField, FileAllowed # type: ignore
|
||||
|
||||
# Form for service on dashboard, connected to database through ORM
|
||||
class ServiceForm(FlaskForm):
|
||||
name = StringField("Service name:", validators=[DataRequired()])
|
||||
url = URLField("Service URL:", validators=[DataRequired()])
|
||||
name = StringField(
|
||||
"Service name:",
|
||||
validators=[DataRequired()],
|
||||
render_kw={"placeholder": "Service Name"},
|
||||
)
|
||||
url = URLField(
|
||||
"Service URL:",
|
||||
validators=[DataRequired()],
|
||||
render_kw={"placeholder": "https://example.com"},
|
||||
)
|
||||
# File field that only allows jpg, jpeg or png
|
||||
image = FileField(
|
||||
"Icon:",
|
||||
|
||||
@@ -35,7 +35,7 @@ def delete_service(service_id: int):
|
||||
|
||||
|
||||
# Add a service
|
||||
@dash_blueprint.route("/service", methods=["GET", "POST"])
|
||||
@dash_blueprint.route("/add_service", methods=["GET", "POST"])
|
||||
@login_required
|
||||
def add_service():
|
||||
service_form = ServiceForm()
|
||||
|
||||
Reference in New Issue
Block a user