a36d353a12828bc376564b649f06f2190c01ba61
[redakcja.git] / project / templates / explorer / file_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 type="text/javascript" charset="utf-8" src="{{ STATIC_URL }}js/jquery.paginate.js"></script>
6 <script type="text/javascript" charset="utf-8">
7 $(function() {
8     $('#file-list').paginate({itemsPerPage: 15});
9
10     $('#file-list-find-button').click(function(event)
11     {
12         var expr = new RegExp( $('#file-list-filter').val() );
13
14         $('#file-list').filterItems( function(filename) {
15             return expr.test(filename);
16         });
17
18         event.preventDefault();
19     });
20
21     $('#file-list-reset-button').click(function(event)
22     {
23         $('#file-list').filterItems();
24         event.preventDefault();
25     });
26 });
27 </script>
28 {% endblock extrahead %}
29
30 {% block maincontent %}
31 <div id="main-page-widgets">
32
33 <div class="file-list-widget">
34     <form action="#" method="GET">
35     <p><input name="filter" id="file-list-filter" type="text" size="60" />
36         <input type="submit" value="Znajdź" id="file-list-find-button"/>
37         <input type="reset" value="Wyczyść" id="file-list-reset-button"/>
38     </p>
39     </form>
40     <div id="file-list">
41     {% for file in files %}
42     <p title="{{file}}"><a href="{% url editor_view file %}">{{ file }}</a></p>
43     {% endfor %}
44     </div>
45 </div>
46
47 {% if perms.explorer.can_add_files %}
48 <div class="upload-file-widget">
49 <h2>Dodaj nowy utwór</h2>
50 <form action="{% url file_upload %}" method="POST" enctype="multipart/form-data">
51     {{ bookform.as_p }}
52     <p><button type="submit">Dodaj książkę</button></p>
53 </form>
54 </div>
55 {% endif %}
56
57 </div>
58 {% endblock maincontent %}