X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/3ac9cb26acd9b7c5ba421dac123ba8f75b782bd2..5cd788950250809058f2d6770ae95c826f76f2e7:/wolnelektury/templates/lessons/document_list.html?ds=sidebyside
diff --git a/wolnelektury/templates/lessons/document_list.html b/wolnelektury/templates/lessons/document_list.html
index 9d30d519e..00d161fdd 100644
--- a/wolnelektury/templates/lessons/document_list.html
+++ b/wolnelektury/templates/lessons/document_list.html
@@ -1,5 +1,5 @@
-{% load i18n %}
{% extends "base.html" %}
+{% load i18n %}
{% load catalogue_tags chunks %}
{% block bodyid %}document-list-body{% endblock %}
@@ -9,17 +9,17 @@
{% 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');
}
return false;
});
-
+
var lastHash = null;
-
+
function checkHash() {
if (document.location.hash != lastHash) {
lastHash = document.location.hash;
@@ -28,19 +28,21 @@
$('#document-list a').removeClass('active');
documentLink.addClass('active');
};
-
+
if ($('#document-detail').attr('data-hash') != lastHash) {
$('#document-detail')
.attr('data-hash', lastHash)
.load(documentLink.attr('href'));
};
} else if (!document.location.hash) {
- $('#document-list a:first').click();
+ $first = $('#document-list a:first');
+ $first.addClass('active');
+ location.replace($first.attr('data-hash'));
}
-
+
setTimeout(checkHash, 500);
};
-
+
checkHash();
});
</script>
@@ -48,17 +50,12 @@
{% block body %}
<h1>{% trans "Hand-outs for teachers" %}</h1>
<form action="{% url search %}" method="GET" accept-charset="utf-8" id="search-form">
- <p>{{ form.q }} <input type="submit" value="{% trans "Search" %}" /> <strong>{% trans "or" %}</strong> <a href="{% url main_page %}">{% trans "return to homepage" %}</a></p>
+ <p>{{ form.q }} <input type="submit" value="{% trans "Search" %}" /> <strong>{% trans "or" %}</strong> <a href="{% url main_page %}">{% trans "return to main page" %}</a></p>
</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>
{% endblock %}
-
\ No newline at end of file