Revert "simplify: move subscribe form to GET /subscriptions/add"

This reverts commit 25e24efbfa.
This commit is contained in:
blankie 2026-06-14 07:33:38 +00:00
parent 25e24efbfa
commit 0da46d29fc
2 changed files with 6 additions and 4 deletions

View file

@ -59,8 +59,12 @@ def _dispatch_inner(data):
if path == "/": if path == "/":
return handle_search(query) return handle_search(query)
elif path == "/add": elif path == "/add":
action_type = query.get("type", ["index"])[0]
prefill_url = query.get("url", [""])[0].strip() prefill_url = query.get("url", [""])[0].strip()
return handle_add_form(prefill_url=prefill_url) return handle_add_form(
action_type=action_type if action_type == "subscribe" else "index",
prefill_url=prefill_url,
)
elif path == "/pages": elif path == "/pages":
return handle_pages(query) return handle_pages(query)
elif path.startswith("/edit/"): elif path.startswith("/edit/"):
@ -92,8 +96,6 @@ def _dispatch_inner(data):
return handle_api_sites(query) return handle_api_sites(query)
elif path == "/subscriptions": elif path == "/subscriptions":
return handle_subscriptions() return handle_subscriptions()
elif path == "/subscriptions/add":
return handle_add_form(action_type="subscribe")
elif path.startswith("/subscriptions/browse/"): elif path.startswith("/subscriptions/browse/"):
sid = extract_id("/subscriptions/browse/") sid = extract_id("/subscriptions/browse/")
return handle_subscription_browse(sid) if sid is not None else _error(400) return handle_subscription_browse(sid) if sid is not None else _error(400)

View file

@ -198,7 +198,7 @@ def handle_subscriptions(msg=""):
f'<input name="dest_hash" placeholder="destination hash" size="40"> ' f'<input name="dest_hash" placeholder="destination hash" size="40"> '
f'<button>subscribe</button>' f'<button>subscribe</button>'
f'</form>' f'</form>'
f'<p><small>or <a href="/subscriptions/add">subscribe to an instance</a></small></p>' f'<p><small>or <a href="/add?type=subscribe">subscribe to an instance</a></small></p>'
f'<p>{msg}</p>' f'<p>{msg}</p>'
f'<hr>{listing}' f'<hr>{listing}'
f'<br><a href="/">back</a>' f'<br><a href="/">back</a>'