#
from django.conf.urls.defaults import *
from catalogue import forms
-from lessons import models
urlpatterns = patterns('',
- url(r'^$', 'django.views.generic.list_detail.object_list', {
- 'queryset': models.Document.objects.all(),
- 'template_name': 'lessons/document_list.html',
+ url(r'^$', 'django.views.generic.simple.direct_to_template', {
+ 'template': 'lessons/document_list.html',
'extra_context': {
'form': forms.SearchForm(),
},
{% block extrahead %}
<script type="text/javascript" charset="utf-8">
$(function() {
- $('#document-list a').click(function() {
+ $('#document-list a[data-hash]').click(function() {
if (!$(this).hasClass('active')) {
- $('#document-list a').removeClass('active');
+ $('#document-list a[data-hash]').removeClass('active');
$(this).addClass('active');
document.location.hash = $(this).attr('data-hash');
}
</form>
<div id="document-list">
- <ol>
- {% for object in object_list %}
- <li><a href="{{ object.get_absolute_url }}" data-hash="#{{ object.slug }}">{{ object }}</a></li>
- {% endfor %}
- </ol>
+ {% chunk "document-list" %}
</div>
<div id="document-detail">
</div>