Wydzielanie utworów. Closes #79 Closes #98
[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     {% load explorer_tags %}
42     {% for file in files %}
43     <p title="{{file|bookname}}"><a href="{% url editor_view file %}">{{ file|bookname }}</a></p>
44     {% endfor %}
45     </div>
46 </div>
47
48 {% if perms.explorer.can_add_files %}
49 <div class="upload-file-widget">
50 <h2>Dodaj nowy utwór</h2>
51 <form action="{% url file_upload %}" method="POST" enctype="multipart/form-data">
52     <p><label>{{bookform.file.label}}: {{ bookform.file }}</label></p>
53     <p><label>{{bookform.bookname.label}}: {{bookform.bookname}}</label></p>
54     <p><label>{{bookform.autoxml}} {{bookform.autoxml.label}}</label></p>
55     <p><button type="submit">Dodaj książkę</button></p>
56 </form>
57 </div>
58 {% endif %}
59
60 </div>
61 {% endblock maincontent %}