Lessons - HTMLized and added fixtures.
[wolnelektury.git] / wolnelektury / templates / lessons / document_list.html
index 1a5ab01..00d161f 100644 (file)
@@ -1,24 +1,25 @@
 {% extends "base.html" %}
 {% extends "base.html" %}
+{% load i18n %}
 {% load catalogue_tags chunks %}
 
 {% block bodyid %}document-list-body{% endblock %}
 
 {% load catalogue_tags chunks %}
 
 {% block bodyid %}document-list-body{% endblock %}
 
-{% block title %}Materiały pomocnicze dla nauczycieli w WolneLektury.pl{% endblock %}
+{% block title %}{% trans "Hand-outs for teachers on " %}WolneLektury.pl{% 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() {
+            $('#document-list a[data-hash]').click(function() {
                 if (!$(this).hasClass('active')) {
                 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;
             });
                     $(this).addClass('active');
                     document.location.hash = $(this).attr('data-hash');
                 }
                 return false;
             });
-            
+
             var lastHash = null;
             var lastHash = null;
-            
+
             function checkHash() {
                 if (document.location.hash != lastHash) {
                     lastHash = document.location.hash;
             function checkHash() {
                 if (document.location.hash != lastHash) {
                     lastHash = document.location.hash;
                         $('#document-list a').removeClass('active');
                         documentLink.addClass('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) {
                     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);
             };
                 setTimeout(checkHash, 500);
             };
-            
+
             checkHash();
         });
     </script>
 {% endblock extrahead %}
 {% block body %}
             checkHash();
         });
     </script>
 {% endblock extrahead %}
 {% block body %}
-    <h1>Materiały pomocnicze dla nauczycieli</h1>
+    <h1>{% trans "Hand-outs for teachers" %}</h1>
     <form action="{% url search %}" method="GET" accept-charset="utf-8" id="search-form">
     <form action="{% url search %}" method="GET" accept-charset="utf-8" id="search-form">
-        <p>{{ form.q }} <input type="submit" value="Szukaj" /> <strong>lub</strong> <a href="{% url main_page %}">wróć do strony głównej</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>
     </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>
 {% endblock %}
     </div>
     <div id="document-detail">
     </div>
 {% endblock %}
-            
\ No newline at end of file