Lessons - HTMLized and added fixtures.
[wolnelektury.git] / wolnelektury / templates / lessons / document_list.html
1 {% extends "base.html" %}
2 {% load i18n %}
3 {% load catalogue_tags chunks %}
4
5 {% block bodyid %}document-list-body{% endblock %}
6
7 {% block title %}{% trans "Hand-outs for teachers on " %}WolneLektury.pl{% endblock %}
8
9 {% block extrahead %}
10     <script type="text/javascript" charset="utf-8">
11         $(function() {
12             $('#document-list a[data-hash]').click(function() {
13                 if (!$(this).hasClass('active')) {
14                     $('#document-list a[data-hash]').removeClass('active');
15                     $(this).addClass('active');
16                     document.location.hash = $(this).attr('data-hash');
17                 }
18                 return false;
19             });
20
21             var lastHash = null;
22
23             function checkHash() {
24                 if (document.location.hash != lastHash) {
25                     lastHash = document.location.hash;
26                     var documentLink = $('#document-list a[data-hash=' + document.location.hash + ']');
27                     if (!documentLink.hasClass('active')) {
28                         $('#document-list a').removeClass('active');
29                         documentLink.addClass('active');
30                     };
31
32                     if ($('#document-detail').attr('data-hash') != lastHash) {
33                         $('#document-detail')
34                             .attr('data-hash', lastHash)
35                             .load(documentLink.attr('href'));
36                     };
37                 } else if (!document.location.hash) {
38                     $first = $('#document-list a:first');
39                     $first.addClass('active');
40                     location.replace($first.attr('data-hash'));
41                 }
42
43                 setTimeout(checkHash, 500);
44             };
45
46             checkHash();
47         });
48     </script>
49 {% endblock extrahead %}
50 {% block body %}
51     <h1>{% trans "Hand-outs for teachers" %}</h1>
52     <form action="{% url search %}" method="GET" accept-charset="utf-8" id="search-form">
53         <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>
54     </form>
55
56     <div id="document-list">
57         {% chunk "document-list" %}
58     </div>
59     <div id="document-detail">
60     </div>
61 {% endblock %}