diff options
| author | 2019-04-15 12:18:49 +0100 | |
|---|---|---|
| committer | 2019-04-15 12:18:49 +0100 | |
| commit | b6f6dcd6d9b3246a16a803f094bd1329b6797d20 (patch) | |
| tree | 79c73c8e77697844d958aa8a6b121f2cc6be41f7 /pydis_site/apps | |
| parent | Remove TOC, link headers, fix breadcrumb padding (diff) | |
Finish creation form, remove weird article title addons
Diffstat (limited to 'pydis_site/apps')
| -rw-r--r-- | pydis_site/apps/home/templatetags/wiki_extra.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pydis_site/apps/home/templatetags/wiki_extra.py b/pydis_site/apps/home/templatetags/wiki_extra.py index ab70eeb4..ae168ae3 100644 --- a/pydis_site/apps/home/templatetags/wiki_extra.py +++ b/pydis_site/apps/home/templatetags/wiki_extra.py @@ -8,6 +8,8 @@ from django.template import Template from django.template.loader import get_template from django.utils.safestring import mark_safe from wiki.editors.markitup import MarkItUpWidget +from wiki.forms import WikiSlugField +from wiki.models import URLPath from wiki.plugins.notifications.forms import SettingsModelChoiceField TEMPLATE_PATH = "wiki/forms/fields/{0}.html" @@ -45,6 +47,7 @@ TEMPLATES = { ModelMultipleChoiceField: TEMPLATE_PATH.format("model_multiple_choice"), SettingsModelChoiceField: TEMPLATE_PATH.format("model_choice"), + WikiSlugField: TEMPLATE_PATH.format("wiki_slug_render"), } @@ -88,3 +91,9 @@ def get_field_options(context, field: BoundField): context["options"] = widget.optgroups(field.name, value) return "" + + +def render_urlpath(value: URLPath): + return value.path or "/" + |