Dodanie restartowania serwera do fabfile.
[redakcja.git] / project / templates / explorer / file_list.html
index a36d353..f44a105 100644 (file)
@@ -2,27 +2,54 @@
 
 {% block extrahead %}
 <link rel="stylesheet" href="{{ STATIC_URL }}css/filelist.css" type="text/css" />
 
 {% 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() {
 <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);
-        });
-
+       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();
         event.preventDefault();
-    });
+    }
+       
+    $('#file-list-find-button').click(search);
+       $('#file-list-filter').bind('keyup change DOMAttrModified', search);
+               
+    var defaultOptions = {
+        panels: [
+        {
+            name: 'htmleditor',
+            ratio: 0.5
+        },
 
 
-    $('#file-list-reset-button').click(function(event)
-    {
-        $('#file-list').filterItems();
-        event.preventDefault();
-    });
+        {
+            name: 'gallery',
+            ratio: 0.5
+        }
+        ],
+        recentFiles: [],
+        lastUpdate: 0
+    };
+    
+       var options = null;
+    try {
+        var cookie = $.cookie('options');
+        options = $.secureEvalJSON(cookie);
+        if (!options) {
+            options = defaultOptions;
+        }
+    } catch (e) {    
+        options = defaultOptions;
+    };
+       
+       $.each(options.recentFiles, function(index) {
+               var fileId = options.recentFiles[index].fileId;
+               $('#recent-file-list ul').append('<li><a href="{% url editor_base %}'+fileId+'">' + fileId + '</a></li>');
+       });
 });
 </script>
 {% endblock extrahead %}
 });
 </script>
 {% endblock extrahead %}
@@ -37,20 +64,29 @@ $(function() {
         <input type="reset" value="Wyczyść" id="file-list-reset-button"/>
     </p>
     </form>
         <input type="reset" value="Wyczyść" id="file-list-reset-button"/>
     </p>
     </form>
-    <div id="file-list">
-    {% for file in files %}
-    <p title="{{file}}"><a href="{% url editor_view file %}">{{ file }}</a></p>
+    {% load explorer_tags %}
+    <ul class="file-tree-part file-tree-top">
+    {% for file in filetree %}    
+        {% tree_part file %}            
     {% endfor %}
     {% endfor %}
-    </div>
+    </ul>
+</div>
+
+<div id="recent-file-list">
+       <h2>Ostatnio oglądane pliki:</h2>
+       <ul>
+       </ul>
 </div>
 
 {% if perms.explorer.can_add_files %}
 <div class="upload-file-widget">
 <h2>Dodaj nowy utwór</h2>
 </div>
 
 {% 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">
 <form action="{% url file_upload %}" method="POST" enctype="multipart/form-data">
-    {{ bookform.as_p }}
+    {{ bookform }}
     <p><button type="submit">Dodaj książkę</button></p>
 </form>
     <p><button type="submit">Dodaj książkę</button></p>
 </form>
+
 </div>
 {% endif %}
 
 </div>
 {% endif %}