From a31f676b46a4d904954b8b7227dcde779aedca54 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Mon, 5 Dec 2022 19:21:00 -0700 Subject: Policy pages and signup tests. Fixes #113 --- users/views/admin/__init__.py | 6 +++++- users/views/admin/settings.py | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) (limited to 'users/views/admin') diff --git a/users/views/admin/__init__.py b/users/views/admin/__init__.py index 04e1195..b8ebc40 100644 --- a/users/views/admin/__init__.py +++ b/users/views/admin/__init__.py @@ -17,7 +17,11 @@ from users.views.admin.hashtags import ( # noqa HashtagEdit, Hashtags, ) -from users.views.admin.settings import BasicSettings, TuningSettings # noqa +from users.views.admin.settings import ( # noqa + BasicSettings, + PoliciesSettings, + TuningSettings, +) @method_decorator(admin_required, name="dispatch") diff --git a/users/views/admin/settings.py b/users/views/admin/settings.py index dc56693..a4e0190 100644 --- a/users/views/admin/settings.py +++ b/users/views/admin/settings.py @@ -44,7 +44,7 @@ class BasicSettings(AdminSettingsPage): }, "site_about": { "title": "About This Site", - "help_text": "Displayed on the homepage and the about page.\nNewlines are preserved; HTML also allowed.", + "help_text": "Displayed on the homepage and the about page.\nUse Markdown for formatting.", "display": "textarea", }, "site_icon": { @@ -155,3 +155,34 @@ class TuningSettings(AdminSettingsPage): "cache_timeout_identity_feed", ], } + + +class PoliciesSettings(AdminSettingsPage): + + section = "policies" + + options = { + "policy_terms": { + "title": "Terms of Service Page", + "help_text": "Will only be shown if it has content. Use Markdown for formatting.", + "display": "textarea", + }, + "policy_privacy": { + "title": "Privacy Policy Page", + "help_text": "Will only be shown if it has content. Use Markdown for formatting.", + "display": "textarea", + }, + "policy_rules": { + "title": "Server Rules Page", + "help_text": "Will only be shown if it has content. Use Markdown for formatting.", + "display": "textarea", + }, + } + + layout = { + "Policies": [ + "policy_rules", + "policy_terms", + "policy_privacy", + ], + } -- cgit v1.2.3