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