Put extensions back so we can start converting

This commit is contained in:
Ben Arc
2021-08-20 12:44:03 +01:00
parent bfd9ca68e4
commit fe123d6d31
273 changed files with 26031 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
from quart import g, abort, render_template
from lnbits.decorators import check_user_exists, validate_uuids
from http import HTTPStatus
from . import streamalerts_ext
from .crud import get_service
@streamalerts_ext.route("/")
@validate_uuids(["usr"], required=True)
@check_user_exists()
async def index():
"""Return the extension's settings page"""
return await render_template("streamalerts/index.html", user=g.user)
@streamalerts_ext.route("/<state>")
async def donation(state):
"""Return the donation form for the Service corresponding to state"""
service = await get_service(0, by_state=state)
if not service:
abort(HTTPStatus.NOT_FOUND, "Service does not exist.")
return await render_template(
"streamalerts/display.html",
twitchuser=service.twitchuser,
service=service.id
)