~netlandish/django-wiki

d6f3724866b264beaca4c376fbabda120eae1adb — tschmidt-dev 11 years ago c0d5f25
restructured url resolver in article_list macro
M wiki/plugins/macros/templates/wiki/plugins/macros/article_list.html => wiki/plugins/macros/templates/wiki/plugins/macros/article_list.html +2 -2
@@ 1,8 1,8 @@
{% 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 %}

M wiki/plugins/macros/templates/wiki/plugins/templatetags/article_list.html => wiki/plugins/macros/templates/wiki/plugins/templatetags/article_list.html +4 -4
@@ 1,12 1,12 @@
{% 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>

M wiki/plugins/macros/templatetags/wiki_macro_tags.py => wiki/plugins/macros/templatetags/wiki_macro_tags.py +1 -1
@@ 8,7 8,7 @@ register = template.Library()
    takes_context=True
)
def article_list(context, urlpath):
    context['urlpath'] = urlpath 
    context['parent'] = urlpath 
    return context