diff --git a/handlers/__init__.py b/handlers/__init__.py index 0b4365e..e7eda3e 100644 --- a/handlers/__init__.py +++ b/handlers/__init__.py @@ -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_about +from .customize import handle_style_form, handle_style_submit, handle_style_template_submit, handle_field_save, handle_about from .tags import handle_tags, handle_tag_browse from .data import ( handle_export, handle_import_form, handle_import_submit, @@ -125,6 +125,8 @@ def _dispatch_inner(data): return handle_style_submit(body, gateway_host=gateway_host, scheme=scheme) elif path == "/style/template": return handle_style_template_submit(body, gateway_host=gateway_host, scheme=scheme) + elif path == "/style/field": + 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) diff --git a/handlers/customize.py b/handlers/customize.py index 02ad2d2..6808046 100644 --- a/handlers/customize.py +++ b/handlers/customize.py @@ -1,7 +1,7 @@ from db import get_db, return_db, get_setting, set_setting, get_site_name import templates as templates_mod from templates import esc, DEFAULT_TEMPLATE -from ._helpers import _respond, _csrf_field, _get_bookmark_token +from ._helpers import _respond, _json_response, _csrf_field, _get_bookmark_token from .subscriptions import _count_shared_pages @@ -54,7 +54,7 @@ def handle_style_form(msg="", gateway_host="", scheme="http"): return _respond( f"
Edit the full page template. Use {esc('{{content}}')} "
f"where page content should appear.