d47a158a4a5525d7154d2c44041388096eb52f22
[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     <p><label>{{bookform.file.label}}: {{ bookform.file }}</label></p>
52     <p><label>{{bookform.bookname.label}}: {{bookform.bookname}}</label></p>
53     <p><label>{{bookform.autoxml}} {{bookform.autoxml.label}}</label></p>
54     <p><button type="submit">Dodaj książkę</button></p>
55 </form>
56 </div>
57 {% endif %}
58
59 </div>
60 {% endblock maincontent %}