{% extends "admin/base_site.html" %}
{% load i18n %}
{% block javascripts %}
    {{ block.super }}
    <script type="text/javascript" charset="utf-8">
        (function($) {
            $(document).ready(function(){
                var anchors = $("#grp-docutils-content").find("h3");
                $(anchors).each(function() {
                    var anchorId = $(this).attr("id");
                    $(this).removeAttr("id");
                    $("<span id=" + anchorId + " class='grp-anchor' />").insertBefore(this);
                });
            });
        })(grp.jQuery);
    </script>
{% endblock %}

{% block bodyclass %}grp-docutils{% endblock %}
{% block content-class %}{% endblock %}
{% block breadcrumbs %}
    <ul>
        <li><a href="../../">{% trans "Home" %}</a></li>
        <li><a href="../">Documentation</a></li>
        <li>Views</li>
    </ul>
{% endblock %}
{% block title %}Views{% endblock %}

{% block content %}
    <h1>View documentation</h1>
    {% regroup views|dictsort:'namespace' by namespace as views_by_ns %}
    <div class="g-d-c">
        <div class="g-d-6">
            <div class="grp-module">
                <h2>Jump to site</h2>
                <ul class="grp-listing-small">
                    {% for ns_views in views_by_ns %}
                        <li class="grp-row"><a href="#ns|{{ ns_views.grouper }}"><strong>
                            {% if ns_views.grouper %}
                                {{ ns_views.grouper }}
                            {% else %}
                                {% trans "Empty namespace" %}
                            {% endif %}
                        </strong></a></li>
                    {% endfor %}
                </ul>
            </div>
        </div>
        <div class="g-d-18 g-d-l grp-rte" id="grp-docutils-content">
            {% for ns_views in views_by_ns %}
                <div class="grp-group">
                    <h2 id="ns|{{ ns_views.grouper }}">
                        {% if ns_views.grouper %}
                            Views by URL on {{ ns_views.grouper }}
                        {% else %}
                            {% blocktrans %}Views by empty namespace{% endblocktrans %}
                        {% endif %}
                    </h2>
                    {% for view in ns_views.list|dictsort:"url" %}
                        {% ifchanged %}
                            <div class="grp-module">
                                <h3><a href="{% url 'django-admindocs-views-detail' view=view.full_name %}">{{ view.url }}</a></h3>
                                <div class="grp-row">
                                    <p>View function: {{ view.full_name }}</p>
                                    {% if view.title %}<p>{{ view.title }}</p>{% endif %}
                                </div>
                            </div>
                        {% endifchanged %}
                    {% endfor %}
                </div>
            {% endfor %}
        </div>
    </div>
{% endblock %}


