From d6f3724866b264beaca4c376fbabda120eae1adb Mon Sep 17 00:00:00 2001 From: tschmidt-dev Date: Thu, 31 Jan 2013 13:58:07 -0800 Subject: [PATCH] restructured url resolver in article_list macro --- .../templates/wiki/plugins/macros/article_list.html | 4 ++-- .../templates/wiki/plugins/templatetags/article_list.html | 8 ++++---- wiki/plugins/macros/templatetags/wiki_macro_tags.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/wiki/plugins/macros/templates/wiki/plugins/macros/article_list.html b/wiki/plugins/macros/templates/wiki/plugins/macros/article_list.html index 899ebafc..3caca13d 100644 --- a/wiki/plugins/macros/templates/wiki/plugins/macros/article_list.html +++ b/wiki/plugins/macros/templates/wiki/plugins/macros/article_list.html @@ -1,8 +1,8 @@ -{% load wiki_macro_tags %} +{% load i18n wiki_macro_tags %} {% if article_children %}
-

Articles

+

{% trans "Articles" %}


{% for child in article_children %} {% article_list child %} diff --git a/wiki/plugins/macros/templates/wiki/plugins/templatetags/article_list.html b/wiki/plugins/macros/templates/wiki/plugins/templatetags/article_list.html index 96a9024e..c3bc5b78 100644 --- a/wiki/plugins/macros/templates/wiki/plugins/templatetags/article_list.html +++ b/wiki/plugins/macros/templates/wiki/plugins/templatetags/article_list.html @@ -1,12 +1,12 @@ {% load wiki_macro_tags %} {% load url from future %} -

{{ urlpath.article }}

-{% if urlpath.children.count %} +

{{ parent.article }}

+{% if parent.children.count %}
    - {% for urlpath in urlpath.children.all %} -
  • {% article_list urlpath %}
  • + {% for child in parent.children.all %} +
  • {% article_list child %}
  • {% endfor %}
diff --git a/wiki/plugins/macros/templatetags/wiki_macro_tags.py b/wiki/plugins/macros/templatetags/wiki_macro_tags.py index e95ce84a..3aee6bf7 100644 --- a/wiki/plugins/macros/templatetags/wiki_macro_tags.py +++ b/wiki/plugins/macros/templatetags/wiki_macro_tags.py @@ -8,7 +8,7 @@ register = template.Library() takes_context=True ) def article_list(context, urlpath): - context['urlpath'] = urlpath + context['parent'] = urlpath return context -- 2.45.2