fix chaining querysets for pagination
[wolnelektury.git] / wolnelektury / templates / lessons / document_list.html
index d8564a5..b4e44e2 100644 (file)
@@ -4,59 +4,35 @@
 
 {% block bodyid %}document-list-body{% endblock %}
 
 
 {% block bodyid %}document-list-body{% endblock %}
 
-{% block title %}{% trans "Hand-outs for teachers on " %}WolneLektury.pl{% endblock %}
+{% block titleextra %}{% trans "Hand-outs for teachers" %}{% endblock %}
+
+{% block metadescription %}Scenariusze lekcji. MateriaƂy dla nauczycieli na wolnej licencji.{% endblock %}
 
 {% block extrahead %}
     <script type="text/javascript" charset="utf-8">
         $(function() {
 
 {% block extrahead %}
     <script type="text/javascript" charset="utf-8">
         $(function() {
-            $('#document-list a').click(function() {
-                if (!$(this).hasClass('active')) {
-                    $('#document-list a').removeClass('active');
-                    $(this).addClass('active');
-                    document.location.hash = $(this).attr('data-hash');
-                }
-                return false;
+            $("#document-list a").click(function(e){
+                  e.preventDefault();
+                  if($("#presentation-frame").length == 0){
+                    $("<iframe id='presentation-frame' width='600' height='500' border='0' src=''>").appendTo($("#document-detail"));
+                  }
+                  $("#presentation-frame").attr("src", this.href);
+                  $('#document-list li').css('background-color', 'white');
+                  $('#document-list li a').css('background-color', 'white');
+                  $(this).closest('li').css('background-color', '#EEEEEE');
+                  $(this).css('background-color', '#EEEEEE');
+                  $(this).next('a').css('background-color', '#EEEEEE');                                    
+                  $('.download-doc').hide();
+                  $(this).next('.download-doc').show();
             });
             });
-
-            var lastHash = null;
-
-            function checkHash() {
-                if (document.location.hash != lastHash) {
-                    lastHash = document.location.hash;
-                    var documentLink = $('#document-list a[data-hash=' + document.location.hash + ']');
-                    if (!documentLink.hasClass('active')) {
-                        $('#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();
-                }
-
-                setTimeout(checkHash, 500);
-            };
-
-            checkHash();
         });
     </script>
 {% endblock extrahead %}
 {% block body %}
     <h1>{% trans "Hand-outs for teachers" %}</h1>
         });
     </script>
 {% endblock extrahead %}
 {% 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 main page" %}</a></p>
-    </form>
 
     <div id="document-list">
 
     <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>
     </div>
     <div id="document-detail">
     </div>