Librarian in regular requirements.
[redakcja.git] / apps / catalogue / templates / catalogue / document_list.html
index 9a40dfc..fe3598e 100644 (file)
 {% extends "catalogue/base.html" %}
 
 {% load i18n %}
-{% load pagination_tags %}
-{% load catalogue %}
-
-{% 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 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 %}
-
-{% block leftcolumn %}
-       <form method="get" action="#">
-    <table>
-       <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>
-               </tbody>
-    </table>
-       </form>
+{% load catalogue book_list %}
+{% load pipeline %}
 
+{% block titleextra %}{% trans "Book list" %}{% endblock %}
 
 
-       <form method="get" action="#">
-    <table id="file-list">
-               <tbody>
-        {% autopaginate books 100 %}
-        {% if not books %}
-            <tr><td>{% trans "No books found." %}</td></tr>
-        {% endif %}
-       {% for item in books %}
-            {% with item.book as book %}
-
-            {% ifequal item.book_length 1 %}
-                {% with item.chunks.0 as chunk %}
-                <tr>
-                    <td><a target="_blank" href="{% url catalogue_book book.slug %}">[B]</a></td>
-                    <td><a href="{% url catalogue_chunk_edit book.slug chunk.slug %}">[c]</a></td>
-                    <td><a target="_blank"
-                                href="{% url wiki_editor book.slug %}">
-                                {{ book.title }}</a></td>
-                    <td>({{ chunk.stage }})</td>
-                    <td>{% if chunk.user %}<a href="{% url catalogue_user chunk.user.username %}">{{ chunk.user.first_name }} {{ chunk.user.last_name }}</a>{% endif %}</td>
-                </tr>
-                {% endwith %}
-            {% else %}
-                <tr>
-                    <td><a target="_blank" href="{% url catalogue_book book.slug %}">[B]</a></td>
-                    <td></td>
-                    <td>{{ book.title }}</td>
-                </tr>
-                {% for chunk in item.chunks %}
-                    <tr>
-                        <td></td>
-                        <td><a href="{% url catalogue_chunk_edit book.slug chunk.slug %}">[c]</a></td>
-                        <td><a target="_blank" href="{{ chunk.get_absolute_url }}">
-                                <span class='chunkno'>{{ chunk.number }}.</span>
-                                {{ chunk.comment }}</a></td>
-                        <td>({{ chunk.stage }})</td>
-                        <td>{% if chunk.user %}<a href="{% url catalogue_user chunk.user.username %}">{{ chunk.user.first_name }} {{ chunk.user.last_name }}</a>{% endif %}</td>
-                    </td></tr>
-                {% endfor %}
-            {% endifequal %}
-            {% endwith %}
-       {% endfor %}
-        <tr><td colspan="3">{% paginate %}</td></tr>
-               </tbody>
-    </table>
-       </form>
-{% endblock leftcolumn %}
+{% block add_js %}
+{% javascript 'book_list' %}
+{% endblock %}
 
-{% 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>
+{% block add_css %}
+{% stylesheet 'book_list' %}
+{% endblock %}
 
-    <h2>{% trans "Recent activity" %}</h2>
-    {% wall %}
-{% endblock rightcolumn %}
+{% block content %}
+    {% book_list %}
+{% endblock content %}