feat: jinja template for cards
Python Lint CI / ruff (push) Successful in 1m13s
Python Lint CI / ty (push) Successful in 1m23s
Python Lint CI / ruff-format-check (push) Successful in 1m23s
TS Lint / Oxlint (push) Failing after 2m17s
TS Lint / ESLint (push) Successful in 3m0s
TS Lint / TypeScript (push) Successful in 2m47s
Docker Build / build (push) Successful in 6m4s

This commit is contained in:
2026-07-14 16:08:32 +02:00
parent 34fadcf6f6
commit b0f1f0db62
11 changed files with 67 additions and 97 deletions
+10 -4
View File
@@ -8,6 +8,7 @@ import gunicorn.app.base
import tortoise
from app import PKG_NAME
from app.lang import get_lang
from app.models import Task
if typing.TYPE_CHECKING:
@@ -36,11 +37,16 @@ class Server(gunicorn.app.base.BaseApplication):
super().__init__()
def register_routes(self) -> typing.Self:
@self.app.route("/", defaults={"_": ""})
@self.app.route("/<_>")
@self.app.route("/", defaults={"path": ""})
@self.app.route("/<path>")
@self.limiter.exempt
def index(_: str) -> str:
return flask.render_template("index.html")
def index(path: str) -> str:
lang = flask.request.args.get("lang", "en")
return flask.render_template(
"index.html",
title=("Tout Doux" if not len(path) else f"Tout Doux - {path}"),
lang=lambda key: get_lang(lang, key),
)
@self.app.route("/api/lists/<list_name>/tasks", methods=["GET"])
async def get_tasks(list_name: str) -> list: