+Change.author_desc, minor changes
[redakcja.git] / apps / wiki / templates / wiki / document_list.html
index 1f2c9b9..f808a1d 100644 (file)
@@ -1,44 +1,72 @@
-{% extends "base.html" %}
+{% extends "wiki/base.html" %}
 
-{% block extrahead %}
-<link rel="stylesheet" href="{{ STATIC_URL }}css/filelist.css" type="text/css" />
-<script src="{{ STATIC_URL }}js/slugify.js" type="text/javascript" charset="utf-8"></script>
+{% load i18n %}
+
+{% block extrabody %}
+{{ block.super }}
 <script type="text/javascript" charset="utf-8">
 $(function() {
        function search(event) {
         event.preventDefault();
-        
         var expr = new RegExp(slugify($('#file-list-filter').val()), 'i');
-       
-        $('#file-list p').hide().filter(function(index) {
-            console.log(expr.test($(this).attr('title')))
-            return expr.test(slugify($('a', this).html()));
+        $('#file-list tbody tr').hide().filter(function(index) {
+            return expr.test(slugify( $('a', this).attr('data-id') ));
         }).show();
     }
-       
+
     $('#file-list-find-button').click(search).hide();
        $('#file-list-filter').bind('keyup change DOMAttrModified', search);
 });
 </script>
-{% endblock extrahead %}
-
-{% block maincontent %}
-<h1><img src="{{STATIC_URL}}/img/logo.png">Platforma Redakcyjna</h1>
+{% endblock %}
 
-<div class="document-list">
-    <form action="#" method="GET">
-    <p>Filtr: <input autocomplete="off" name="filter" id="file-list-filter" type="text" size="60" />
-        <input type="submit" value="Znajdź" id="file-list-find-button"/>
-        <input type="reset" value="Wyczyść" id="file-list-reset-button"/>
-    </p>
-    </form>
-        
-    <div id="file-list">
-    {% for file in document_list %}
-        <p><a href="{% url wiki.views.document_detail file|urlencode %}">{{ file }}</a></p>
-    {% endfor %}
-    </div>
-</div>
+{% block leftcolumn %}
+       <form method="get" action="#">
+    <table  id="file-list">
+       <thead>
+               <tr><th>Filtr:</th>
+                       <th><input autocomplete="off" name="filter" id="file-list-filter" type="text" size="40" /></th>
+                       <th><input type="reset" value="{% trans "Clear filter" %}" id="file-list-reset-button"/></th>
+                       </tr>
+               </thead>
+               <tbody>
+       {% for book in books %}
+            <tr>
+                <td colspan="3">
+                    <a target="_blank" data-id="{{ book.slug }}"
+                    href="{% url wiki_book book.slug %}">[?]</a>
+                    {% ifequal book.chunk_set.count 1 %}
+                        <a target="_blank" data-id="{{ book.slug }}"
+                                href="{% url wiki_editor book.slug %}">
+                                {{ book.title }}</a>
+                    {% else %}
+                        {{ book.title }}
+                        <div class="chunk-list">
+                        {% for chunk in book %}
+                            <a target="_blank" data-id="{{ book.slug }}"
+                                href="{{ chunk.get_absolute_url }}">
+                                <span class='chunkno'>{{ forloop.counter }}.</span>
+                                {{ chunk.comment }}</a><br/>
+                        {% endfor %}
+                        </div>
+                    {% endifequal %}
+                </td>
+                               <!-- placeholder </td> -->
+                       </tr>
+       {% endfor %}
+               </tbody>
+    </table>
+       </form>
+{% endblock leftcolumn %}
 
-</div>
-{% endblock maincontent %}
+{% block rightcolumn %}
+       <div id="last-edited-list">
+               <h2>{% trans "Your last edited documents" %}</h2>
+           <ol>
+                       {% for slugs, item in last_books %}
+                       <li><a href="{% url wiki_editor slugs.0 slugs.1 %}"
+                               target="_blank">{{ item.title }}</a><br/><span class="date">({{ item.time|date:"H:i:s, d/m/Y" }})</span></li>
+                       {% endfor %}
+               </ol>
+       </div>
+{% endblock rightcolumn %}