f808a1d3422a77a553ffcba930bbd780bfe0108e
[redakcja.git] / apps / wiki / templates / wiki / document_list.html
1 {% extends "wiki/base.html" %}
2
3 {% load i18n %}
4
5 {% block extrabody %}
6 {{ block.super }}
7 <script type="text/javascript" charset="utf-8">
8 $(function() {
9         function search(event) {
10         event.preventDefault();
11         var expr = new RegExp(slugify($('#file-list-filter').val()), 'i');
12         $('#file-list tbody tr').hide().filter(function(index) {
13             return expr.test(slugify( $('a', this).attr('data-id') ));
14         }).show();
15     }
16
17     $('#file-list-find-button').click(search).hide();
18         $('#file-list-filter').bind('keyup change DOMAttrModified', search);
19 });
20 </script>
21 {% endblock %}
22
23 {% block leftcolumn %}
24         <form method="get" action="#">
25     <table  id="file-list">
26         <thead>
27                 <tr><th>Filtr:</th>
28                         <th><input autocomplete="off" name="filter" id="file-list-filter" type="text" size="40" /></th>
29                         <th><input type="reset" value="{% trans "Clear filter" %}" id="file-list-reset-button"/></th>
30                         </tr>
31                 </thead>
32                 <tbody>
33         {% for book in books %}
34             <tr>
35                 <td colspan="3">
36                     <a target="_blank" data-id="{{ book.slug }}"
37                     href="{% url wiki_book book.slug %}">[?]</a>
38                     {% ifequal book.chunk_set.count 1 %}
39                         <a target="_blank" data-id="{{ book.slug }}"
40                                 href="{% url wiki_editor book.slug %}">
41                                 {{ book.title }}</a>
42                     {% else %}
43                         {{ book.title }}
44                         <div class="chunk-list">
45                         {% for chunk in book %}
46                             <a target="_blank" data-id="{{ book.slug }}"
47                                 href="{{ chunk.get_absolute_url }}">
48                                 <span class='chunkno'>{{ forloop.counter }}.</span>
49                                 {{ chunk.comment }}</a><br/>
50                         {% endfor %}
51                         </div>
52                     {% endifequal %}
53                 </td>
54                                 <!-- placeholder </td> -->
55                         </tr>
56         {% endfor %}
57                 </tbody>
58     </table>
59         </form>
60 {% endblock leftcolumn %}
61
62 {% block rightcolumn %}
63         <div id="last-edited-list">
64                 <h2>{% trans "Your last edited documents" %}</h2>
65             <ol>
66                         {% for slugs, item in last_books %}
67                         <li><a href="{% url wiki_editor slugs.0 slugs.1 %}"
68                                 target="_blank">{{ item.title }}</a><br/><span class="date">({{ item.time|date:"H:i:s, d/m/Y" }})</span></li>
69                         {% endfor %}
70                 </ol>
71         </div>
72 {% endblock rightcolumn %}