Commit d6f37248 by tschmidt-dev

restructured url resolver in article_list macro

parent c0d5f251
{% load wiki_macro_tags %}
{% load i18n wiki_macro_tags %}
{% if article_children %}
<div class="well wiki-article-list">
<h3>Articles</h3>
<h3>{% trans "Articles" %}</h3>
<br/>
{% for child in article_children %}
{% article_list child %}
......
{% load wiki_macro_tags %}
{% load url from future %}
<p><a href="{% url 'wiki:get' path=urlpath.path %}">{{ urlpath.article }}</a></p>
{% if urlpath.children.count %}
<p><a href="{% url 'wiki:get' path=parent.path article_id=parent.article.id %}">{{ parent.article }}</a></p>
{% if parent.children.count %}
<div class="wiki-article-sublist">
<ul>
{% for urlpath in urlpath.children.all %}
<li>{% article_list urlpath %}</li>
{% for child in parent.children.all %}
<li>{% article_list child %}</li>
{% endfor %}
</ul>
</div>
......
......@@ -8,7 +8,7 @@ register = template.Library()
takes_context=True
)
def article_list(context, urlpath):
context['urlpath'] = urlpath
context['parent'] = urlpath
return context
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment