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
|
# Form for service on dashboard, connected to database through ORM
|
||||||
class ServiceForm(FlaskForm):
|
class ServiceForm(FlaskForm):
|
||||||
name = StringField("Service name:", validators=[DataRequired()])
|
name = StringField(
|
||||||
url = URLField("Service URL:", validators=[DataRequired()])
|
"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
|
# File field that only allows jpg, jpeg or png
|
||||||
image = FileField(
|
image = FileField(
|
||||||
"Icon:",
|
"Icon:",
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ def delete_service(service_id: int):
|
|||||||
|
|
||||||
|
|
||||||
# Add a service
|
# Add a service
|
||||||
@dash_blueprint.route("/service", methods=["GET", "POST"])
|
@dash_blueprint.route("/add_service", methods=["GET", "POST"])
|
||||||
@login_required
|
@login_required
|
||||||
def add_service():
|
def add_service():
|
||||||
service_form = ServiceForm()
|
service_form = ServiceForm()
|
||||||
|
|||||||
Reference in New Issue
Block a user