{% 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:"site_id" by site as views_by_site %}
    <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 site_views in views_by_site %}
                        <li class="grp-row"><a href="#site{{ site_views.grouper.id }}"><strong>{{ site_views.grouper.name }}</strong></a></li>
                    {% endfor %}
                </ul>
            </div>
        </div>
        <div class="g-d-18 g-d-l grp-rte" id="grp-docutils-content">
            {% for site_views in views_by_site %}
                <div class="grp-group">
                    <h2 id="site{{ site_views.grouper.id }}">Views by URL on {{ site_views.grouper.name }}</h2>
                    {% for view in site_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 %}


