X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/09444838209cb9fd08f799553889ff04a015e8ad..69a0d5ba5c8f90d0c0006f7c14aae89875f66441:/project/templates/explorer/file_list.html diff --git a/project/templates/explorer/file_list.html b/project/templates/explorer/file_list.html index bfbafe13..f44a105c 100644 --- a/project/templates/explorer/file_list.html +++ b/project/templates/explorer/file_list.html @@ -1,9 +1,94 @@ {% extends "base.html" %} +{% block extrahead %} +<link rel="stylesheet" href="{{ STATIC_URL }}css/filelist.css" type="text/css" /> + <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() { + 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: [ + { + name: 'htmleditor', + ratio: 0.5 + }, + + { + 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 %} + {% block maincontent %} -<ul> -{% for blob in objects %} - <li><a href="{% url editor_view blob %}">{{ blob }}</a></li> -{% endfor %} -</ul> +<div id="main-page-widgets"> + +<div class="file-list-widget"> + <form action="#" method="GET"> + <p><input 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> + {% load explorer_tags %} + <ul class="file-tree-part file-tree-top"> + {% for file in filetree %} + {% tree_part file %} + {% endfor %} + </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> + +<form action="{% url file_upload %}" method="POST" enctype="multipart/form-data"> + {{ bookform }} + <p><button type="submit">Dodaj ksiÄ Å¼kÄ</button></p> +</form> + +</div> +{% endif %} + +</div> {% endblock maincontent %}