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 %} {% if article_children %}
<div class="well wiki-article-list"> <div class="well wiki-article-list">
<h3>Articles</h3> <h3>{% trans "Articles" %}</h3>
<br/> <br/>
{% for child in article_children %} {% for child in article_children %}
{% article_list child %} {% article_list child %}
......
{% load wiki_macro_tags %} {% load wiki_macro_tags %}
{% load url from future %} {% load url from future %}
<p><a href="{% url 'wiki:get' path=urlpath.path %}">{{ urlpath.article }}</a></p> <p><a href="{% url 'wiki:get' path=parent.path article_id=parent.article.id %}">{{ parent.article }}</a></p>
{% if urlpath.children.count %} {% if parent.children.count %}
<div class="wiki-article-sublist"> <div class="wiki-article-sublist">
<ul> <ul>
{% for urlpath in urlpath.children.all %} {% for child in parent.children.all %}
<li>{% article_list urlpath %}</li> <li>{% article_list child %}</li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
......
...@@ -8,7 +8,7 @@ register = template.Library() ...@@ -8,7 +8,7 @@ register = template.Library()
takes_context=True takes_context=True
) )
def article_list(context, urlpath): def article_list(context, urlpath):
context['urlpath'] = urlpath context['parent'] = urlpath
return context 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