~netlandish/django-wiki

0204d723eec1c0a5f19c7f7abd012f046f7353a4 — Yader Velasquez 3 years ago 668619d
New template tag to get article tree used in wiki navigation
1 files changed, 7 insertions(+), 0 deletions(-)

M src/wiki/templatetags/wiki_tags.py
M src/wiki/templatetags/wiki_tags.py => src/wiki/templatetags/wiki_tags.py +7 -0
@@ 9,6 9,7 @@ from django.forms import BaseForm
from django.template.defaultfilters import striptags
from django.utils.http import urlquote
from django.utils.safestring import mark_safe

from wiki import models
from wiki.conf import settings
from wiki.core.plugins import registry as plugin_registry


@@ 213,3 214,9 @@ def wiki_settings(name):
@register.filter
def starts_with(value, arg):
    return value.startswith(arg)

@register.simple_tag
def get_article_tree(node):
    if not node.is_root_node():
        node = node.get_root()
    return node.get_children()