+Change.author_desc, minor changes
[redakcja.git] / apps / wiki / templates / wiki / document_list.html
index 2ab5ab9..f808a1d 100644 (file)
@@ -1,5 +1,6 @@
 {% extends "wiki/base.html" %}
 
+{% load i18n %}
 
 {% block extrabody %}
 {{ block.super }}
@@ -9,7 +10,7 @@ $(function() {
         event.preventDefault();
         var expr = new RegExp(slugify($('#file-list-filter').val()), 'i');
         $('#file-list tbody tr').hide().filter(function(index) {
-            return expr.test(slugify($('a', this).text()));
+            return expr.test(slugify( $('a', this).attr('data-id') ));
         }).show();
     }
 
@@ -25,13 +26,31 @@ $(function() {
        <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="Wyczyść" id="file-list-reset-button"/></th>
+                       <th><input type="reset" value="{% trans "Clear filter" %}" id="file-list-reset-button"/></th>
                        </tr>
                </thead>
                <tbody>
-       {% for file in document_list %}
+       {% for book in books %}
             <tr>
-               <td colspan="3"><a target="_blank" href="{% url wiki.views.document_detail file|urlencode %}">{{ file }}</a></td>
+                <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 %}
@@ -42,11 +61,11 @@ $(function() {
 
 {% block rightcolumn %}
        <div id="last-edited-list">
-               <h2>Twoje ostatnio otwierane dokumenty:</h2>
-               <ol>
-                       {% for   name, date in last_docs %}
-                       <li><a href="{% url wiki.views.document_detail name|urlencode %}"
-                               target="_blank">{{ name }}</a><br/><span class="date">({{ date|date:"H:i:s, d/m/Y" }})</span></li>
+               <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>