From 308901306bbd7c111111e7e706fe7ee0155af7f3 Mon Sep 17 00:00:00 2001 From: metalune Date: Sat, 31 Jul 2021 13:13:48 +0200 Subject: [PATCH] Add go-to-specific-instance field --- main.py | 7 +++++++ templates/index.html | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 276f96b..fbd71b7 100644 --- a/main.py +++ b/main.py @@ -266,6 +266,12 @@ async def main(): subscriptions=subscriptions, ) + +@app.route("/instance", methods=["POST"]) +async def jump_to_instance(): + domain = (await request.form)["domain"] + return redirect("/" + domain) + @app.route("/search", methods = ["POST"]) async def simpleer_search_redirect(): query = (await request.form)["query"] @@ -373,6 +379,7 @@ async def instance_videos_recently_added(domain, page): + @app.route("//search", methods=["POST"]) async def search_redirect(domain): query = (await request.form)["query"] diff --git a/templates/index.html b/templates/index.html index e6106b8..ad9432a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -14,7 +14,19 @@
-
{% if videos|length > 0 %} + + +
+ +
+ +
+ + +
+ + + {% if videos|length > 0 %}

{{ videos|length }} latest videos from local subscriptions

{% for sub in subscriptions %}{% if not loop.first %}, {% endif %}{{ sub.displayName }} (@{{ sub.name }}@{{ sub.host }}){% endfor %}