{% load url from future %}

<div class="pure-u-5-5 route-item">
    <a class="route-name">{{ route.url }}{% if route.sub_urls %} +{% endif %}</a>

    <div class="route-subitem">

        <div>
            {{ route.view }}
            {% if route.app_name %}[app_name="{{ route.app_name }}"]{% endif %}
            {% if route.name %}
                [name="{{ route.name }}"]
                {% if route.args_count == 0 and route.url_reversed %}
                    <br />
                    Link: <a href="{{ route.url_reversed }}" target="_blank">{{ route.url_reversed }}</a>
                {% endif %}
            {% endif %}
        </div>

        {% if route.args_count > 0 %}
            <div class="pure-form">
                <fieldset>
                {% for index, arg in route.args %}
                    <input type="text" placeholder="{{arg}}" />
                {% endfor %}

                <button class="pure-button" data-reverse="{{route.url}}">Reverse</button>
                <div class="pure-u-5-5 route-link-wrapper is-hidden">
                    Link: <a href="#" target="_blank" class="route-link"></a>
                </div>
                </fieldset>
            </div>
        {% endif %}


        {% with template_name='djangomaster/includes/_routes_item_list.html' %}
            {% for subroute in route.sub_urls %}
                {% include template_name with route=subroute only %}
            {% endfor %}
        {% endwith %}

    </div>
</div>
