+Change.author_desc, minor changes
[redakcja.git] / apps / wiki / templates / wiki / document_list.html
index 6853801..f808a1d 100644 (file)
@@ -1,7 +1,6 @@
 {% extends "wiki/base.html" %}
 
 {% load i18n %}
-{% load wiki %}
 
 {% block extrabody %}
 {{ block.super }}
@@ -31,10 +30,27 @@ $(function() {
                        </tr>
                </thead>
                <tbody>
-       {% for doc in docs %}
+       {% for book in books %}
             <tr>
-               <td colspan="3"><a target="_blank" data-id="{{doc}}"
-                                       href="{% url wiki_editor doc %}">{{ doc|wiki_title }}</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 %}
@@ -47,9 +63,9 @@ $(function() {
        <div id="last-edited-list">
                <h2>{% trans "Your last edited documents" %}</h2>
            <ol>
-                       {% for name, date in last_docs %}
-                       <li><a href="{% url wiki_editor name %}"
-                               target="_blank">{{ name|wiki_title }}</a><br/><span class="date">({{ date|date:"H:i:s, d/m/Y" }})</span></li>
+                       {% 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>