2020-09-13 21:31:05 -03:00
|
|
|
from quart import g, abort, render_template
|
2020-05-03 15:57:05 +02:00
|
|
|
from http import HTTPStatus
|
2020-04-14 11:39:54 +01:00
|
|
|
|
|
|
|
from lnbits.decorators import check_user_exists, validate_uuids
|
|
|
|
from lnbits.extensions.amilk import amilk_ext
|
|
|
|
|
|
|
|
from .crud import get_amilk
|
|
|
|
|
|
|
|
|
|
|
|
@amilk_ext.route("/")
|
|
|
|
@validate_uuids(["usr"], required=True)
|
|
|
|
@check_user_exists()
|
2020-09-13 21:31:05 -03:00
|
|
|
async def index():
|
|
|
|
return await render_template("amilk/index.html", user=g.user)
|
2020-04-14 11:39:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
@amilk_ext.route("/<amilk_id>")
|
2020-09-13 21:31:05 -03:00
|
|
|
async def wall(amilk_id):
|
2020-05-03 15:57:05 +02:00
|
|
|
amilk = get_amilk(amilk_id) or abort(HTTPStatus.NOT_FOUND, "AMilk does not exist.")
|
2020-09-13 21:31:05 -03:00
|
|
|
return await render_template("amilk/wall.html", amilk=amilk)
|