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

{% block breadcrumbs %}
<ul class="breadcrumb">
	<li><a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> <span class="divider">/</span></li>
	<li><a href="{% url 'django-admindocs-docroot' %}">{% trans 'Documentation' %}</a> <span class="divider">/</span></li>
	<li class="active">{% trans '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 %}
<ul class="nav nav-tabs nav-stacked views-list">
{% for site_views in views_by_site %}
	<li class="nav-header" id="site{{ site_views.grouper.id }}">Views by URL on {{ site_views.grouper.name }}</li>
	{% for view in site_views.list|dictsort:"url" %}
		{% ifchanged %}
		<li>
			<a href="{% url 'django-admindocs-views-detail' view=view.full_name %}">
				{{ view.url }}
				<span>View function: {{ view.full_name }}</span>
				{% if view.title %}
				<span>{{ view.title }}</span>
				{% endif %}
			</a>
		</li>
		{% endifchanged %}
	{% endfor %}
{% endfor %}
{% endblock %}

{% block sidebar %}
	<ul class="nav nav-list well">
		<li class="nav-header">Jump to site</li>
		{% regroup views|dictsort:"site_id" by site as views_by_site %}
	    {% for site_views in views_by_site %}
	    <li><a href="#site{{ site_views.grouper.id }}">{{ site_views.grouper.name }}</a></li>
	    {% endfor %}
	</ul>
{% endblock sidebar %}
