1f2c9b931445bab920fd11d68f7257dbe147f04d
[redakcja.git] / apps / wiki / templates / wiki / document_list.html
1 {% extends "base.html" %}
2
3 {% block extrahead %}
4 <link rel="stylesheet" href="{{ STATIC_URL }}css/filelist.css" type="text/css" />
5 <script src="{{ STATIC_URL }}js/slugify.js" type="text/javascript" charset="utf-8"></script>
6 <script type="text/javascript" charset="utf-8">
7 $(function() {
8         function search(event) {
9         event.preventDefault();
10         
11         var expr = new RegExp(slugify($('#file-list-filter').val()), 'i');
12         
13         $('#file-list p').hide().filter(function(index) {
14             console.log(expr.test($(this).attr('title')))
15             return expr.test(slugify($('a', this).html()));
16         }).show();
17     }
18         
19     $('#file-list-find-button').click(search).hide();
20         $('#file-list-filter').bind('keyup change DOMAttrModified', search);
21 });
22 </script>
23 {% endblock extrahead %}
24
25 {% block maincontent %}
26 <h1><img src="{{STATIC_URL}}/img/logo.png">Platforma Redakcyjna</h1>
27
28 <div class="document-list">
29     <form action="#" method="GET">
30     <p>Filtr: <input autocomplete="off" name="filter" id="file-list-filter" type="text" size="60" />
31         <input type="submit" value="Znajdź" id="file-list-find-button"/>
32         <input type="reset" value="Wyczyść" id="file-list-reset-button"/>
33     </p>
34     </form>
35          
36     <div id="file-list">
37     {% for file in document_list %}
38         <p><a href="{% url wiki.views.document_detail file|urlencode %}">{{ file }}</a></p>
39     {% endfor %}
40     </div>
41 </div>
42
43 </div>
44 {% endblock maincontent %}