X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/d96e0c45b35295d3e6012b8e2c93fe42d8d72ca9..320fd24b68185b73f1180c425271e037331baa46:/project/templates/explorer/file_list.html?ds=inline

diff --git a/project/templates/explorer/file_list.html b/project/templates/explorer/file_list.html
index 1eac095b..a9b59e4c 100644
--- a/project/templates/explorer/file_list.html
+++ b/project/templates/explorer/file_list.html
@@ -2,30 +2,23 @@
 
 {% block extrahead %}
 <link rel="stylesheet" href="{{ STATIC_URL }}css/filelist.css" type="text/css" />
-<script type="text/javascript" charset="utf-8" src="{{ STATIC_URL }}js/jquery.paginate.js"></script>
     <script src="{{STATIC_URL}}js/jquery.json.js" type="text/javascript" charset="utf-8"></script>
     <script src="{{STATIC_URL}}js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
 <script type="text/javascript" charset="utf-8">
 $(function() {
-    $('#file-list').paginate({itemsPerPage: 15});
-
-    $('#file-list-find-button').click(function(event)
-    {
-        var expr = new RegExp( $('#file-list-filter').val() );
-
-        $('#file-list').filterItems( function(filename) {
-            return expr.test(filename);
-        });
-
-        event.preventDefault();
-    });
-
-    $('#file-list-reset-button').click(function(event)
-    {
-        $('#file-list').filterItems();
+	function search(event) {
+        var expr = new RegExp($('#file-list-filter').val(), 'i');
+    	
+        $('#file-list p').hide().filter(function(index) {
+            return expr.test($(this).attr('title'));
+        }).show();
+    
         event.preventDefault();
-    });
+    }
 	
+    $('#file-list-find-button').click(search);
+	$('#file-list-filter').bind('keyup change DOMAttrModified', search);
+		
     var defaultOptions = {
         panels: [
         {
@@ -51,7 +44,7 @@ $(function() {
         }
     } catch (e) {    
         options = defaultOptions;
-    }
+    };
 	
 	$.each(options.recentFiles, function(index) {
 		var fileId = options.recentFiles[index].fileId;
@@ -71,12 +64,12 @@ $(function() {
         <input type="reset" value="Wyczyść" id="file-list-reset-button"/>
     </p>
     </form>
-    <div id="file-list">
     {% load explorer_tags %}
-    {% for file in files %}
-    <p title="{{file|bookname}}"><a href="{% url editor_view file %}">{{ file|bookname }}</a></p>
+    <ul class="file-tree-part file-tree-top">
+    {% for file in filetree %}    
+        {% tree_part file %}            
     {% endfor %}
-    </div>
+    </ul>
 </div>
 
 <div id="recent-file-list">
@@ -88,12 +81,12 @@ $(function() {
 {% if perms.explorer.can_add_files %}
 <div class="upload-file-widget">
 <h2>Dodaj nowy utwór</h2>
-<form action="{% url file_upload %}" method="POST" enctype="multipart/form-data">
-    <p><label>{{bookform.file.label}}: {{ bookform.file }}</label></p>
-    <p><label>{{bookform.bookname.label}}: {{bookform.bookname}}</label></p>
-    <p><label>{{bookform.autoxml}} {{bookform.autoxml.label}}</label></p>
+
+<form action="/api/documents" method="POST" enctype="multipart/form-data">
+    {{ bookform }}
     <p><button type="submit">Dodaj książkę</button></p>
 </form>
+
 </div>
 {% endif %}