Fixed search. Changes stylesheet name, so changes can propagate faster.
[redakcja.git] / apps / wiki / templates / wiki / document_list.html
index 5bc53e8..415c3bc 100644 (file)
@@ -1,18 +1,19 @@
 {% extends "base.html" %}
+{% load compressed %}
 
 {% block extrahead %}
-<link rel="stylesheet" href="{{ STATIC_URL }}css/filelist.css" type="text/css" />
-<script src="{{ STATIC_URL }}js/slugify.js" type="text/javascript" charset="utf-8"></script>
+{% compressed_css 'listing' %}
+{% endblock extrahead %}
+
+{% block extrabody %}
+{% compressed_js 'listing' %}
 <script type="text/javascript" charset="utf-8">
 $(function() {
        function search(event) {
-        event.preventDefault();
-        
-        var expr = new RegExp(slugify($('#file-list-filter').val()), 'i');
-       
-        $('#file-list p').hide().filter(function(index) {
-            console.log(expr.test($(this).attr('title')))
-            return expr.test(slugify($('a', this).html()));
+        event.preventDefault();        
+        var expr = new RegExp(slugify($('#file-list-filter').val()), 'i');     
+        $('#file-list tbody tr').hide().filter(function(index) {            
+            return expr.test(slugify($('a', this).text()));
         }).show();
     }
        
@@ -20,23 +21,41 @@ $(function() {
        $('#file-list-filter').bind('keyup change DOMAttrModified', search);
 });
 </script>
-{% endblock extrahead %}
+{% endblock %}
 
 {% block maincontent %}
-<div id="main-page-widgets">
+<h1><img src="{{STATIC_URL}}/img/logo.png">Platforma Redakcyjna</h1>
 
-<div class="file-list-widget">
-    <form action="#" method="GET">
-    <p><input autocomplete="off" name="filter" id="file-list-filter" type="text" size="60" />
-        <input type="submit" value="Znajdź" id="file-list-find-button"/>
-        <input type="reset" value="Wyczyść" id="file-list-reset-button"/>
-    </p>
-    </form> 
-    <div id="file-list">
-    {% for file in document_list %}
-        <p><a href="{% url wiki.views.document_detail file|urlencode %}">{{ file }}</a></p>
-    {% endfor %}
-    </div>
+
+<div id="document-list">
+       <form method="get" action="#">           
+    <table  id="file-list">
+       <thead>         
+               <tr><th>Filtr:</th>
+                       <th><input autocomplete="off" name="filter" id="file-list-filter" type="text" size="40" /></th>
+                       <th><input type="reset" value="Wyczyść" id="file-list-reset-button"/></th>
+                       </tr>           
+               </thead>                
+               <tbody>
+       {% for file in document_list %}
+            <tr>
+               <td colspan="3"><a target="_blank" href="{% url wiki.views.document_detail file|urlencode %}">{{ file }}</a></td>
+                               <!-- placeholder </td> -->
+                       </tr>
+       {% endfor %}
+               </tbody>
+    </table>
+       </form>
+       
+       <div id="last-edited-list">
+               <h2>Twoje ostatnio otwierane dokumenty:</h2>
+               <ol>
+                       {% for   name, date in last_docs %}
+                       <li><a href="{% url wiki.views.document_detail name|urlencode %}"
+                               target="_blank">{{ name }}</a><br/><span class="date">({{ date|date:"H:i:s, d/m/Y" }})</span></li>
+                       {% endfor %}                    
+               </ol>
+       </div>
 </div>
 
 </div>