From a7bbf186d41bd2f89d97b22773eae397e8d1f2b1 Mon Sep 17 00:00:00 2001 From: tschmidt-dev Date: Wed, 30 Jan 2013 09:13:30 -0800 Subject: [PATCH] added Django 1.5 url syntax to macros plugin; added condition to avoid generating empty lists for each child in article_list macro --- .../wiki/plugins/macros/article_list.html | 1 + .../plugins/templatetags/article_list.html | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 10 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 4cbb8049..899ebafc 100644 --- a/wiki/plugins/macros/templates/wiki/plugins/macros/article_list.html +++ b/wiki/plugins/macros/templates/wiki/plugins/macros/article_list.html @@ -1,4 +1,5 @@ {% load wiki_macro_tags %} + {% if article_children %}

Articles

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 411e57ba..1ef26740 100644 --- a/wiki/plugins/macros/templates/wiki/plugins/templatetags/article_list.html +++ b/wiki/plugins/macros/templates/wiki/plugins/templatetags/article_list.html @@ -1,11 +1,15 @@ {% load wiki_macro_tags %} -

{{ urlpath.article }}

-
-
    -
  • - {% for urlpath in urlpath.children.all %} - {% article_list urlpath %} - {% endfor %} -
  • -
-
+{% load url from future %} + +

{{ urlpath.article }}

+{% if urlpath.children.count %} +
+
    +
  • + {% for urlpath in urlpath.children.all %} + {% article_list urlpath %} + {% endfor %} +
  • +
+
+{% endif %} -- 2.45.2