{% extends "admin/base_site.html" %}
{% load i18n %}

{% block coltype %}colSM{% endblock %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'django-admindocs-docroot' %}">{% trans 'Documentation' %}</a>
&rsaquo; {% trans 'Views' %}
</div>
{% endblock %}
{% block title %}{% trans 'Views' %}{% endblock %}

{% block content %}

<h1>{% trans 'View documentation' %}</h1>

{% regroup views|dictsort:'namespace' by namespace as views_by_ns %}

<div id="content-related" class="sidebar">
<div class="module">
<h2>{% trans 'Jump to namespace' %}</h2>
<ul>
{% for ns_views in views_by_ns %}
    <li><a href="#ns|{{ ns_views.grouper }}">
    {% if ns_views.grouper %}{{ ns_views.grouper }}
    {% else %}{% trans "Empty namespace" %}{% endif %}
    </a></li>
{% endfor %}
</ul>
</div>
</div>

<div id="content-main">

{% for ns_views in views_by_ns %}
<div class="module">
<h2 id="ns|{{ ns_views.grouper }}">
{% if ns_views.grouper %}
    {% blocktrans with ns_views.grouper as name %}Views by namespace {{ name }}{% endblocktrans %}
{% else %}
    {% blocktrans %}Views by empty namespace{% endblocktrans %}
{% endif %}
</h2>

{% for view in ns_views.list|dictsort:"url" %}
{% ifchanged %}
<h3><a href="{% url 'django-admindocs-views-detail' view=view.full_name %}">{{ view.url }}</a></h3>
<p class="small quiet">{% blocktrans with view.full_name as full_name and view.url_name as url_name %}
    View function: <code>{{ full_name }}</code>. Name: <code>{{ url_name }}</code>.
{% endblocktrans %}</p>
<p>{{ view.title }}</p>
<hr />
{% endifchanged %}
{% endfor %}
</div>
{% endfor %}
</div>
{% endblock %}
