remove demo pages, rename themes, add Content-Length header

This commit is contained in:
blankie 2026-06-16 05:11:37 +00:00
parent 0f614c88f8
commit 66a9fafd26
10 changed files with 1652 additions and 2370 deletions

View file

@ -32,7 +32,7 @@ from .subscriptions import (
handle_subscription_delete, handle_subscription_syncall,
_sync_threads,
)
from .customize import handle_style_form, handle_style_submit, handle_style_template_submit, handle_field_save, handle_about
from .customize import handle_style_form, handle_style_submit, handle_style_template_submit, handle_field_save, handle_about, _set_flash
from .tags import handle_tags, handle_tag_browse
from .data import (
handle_export, handle_import_form, handle_import_submit,
@ -66,7 +66,7 @@ def _dispatch_inner(data):
return handle_pages(query)
elif path.startswith("/edit/"):
pid = extract_id("/edit/")
return handle_edit_form(pid) if pid is not None else _error(400)
return handle_edit_form(pid, page=query.get("p", [""])[0]) if pid is not None else _error(400)
elif path.startswith("/delete/"):
pid = extract_id("/delete/")
return handle_delete_confirm(pid) if pid is not None else _error(400)
@ -129,11 +129,13 @@ def _dispatch_inner(data):
return handle_field_save(body)
elif path == "/style/reset":
set_setting("custom_template", "")
return handle_style_form("Template reset to default.", gateway_host=gateway_host, scheme=scheme)
_set_flash("Template reset to default.")
return _redirect("/style")
elif path == "/style/vacuum":
from db import vacuum_db
vacuum_db()
return handle_style_form("Database vacuumed.", gateway_host=gateway_host, scheme=scheme)
_set_flash("Database vacuumed.")
return _redirect("/style")
elif path == "/import":
return handle_import_submit(body)
elif path == "/reindex":