X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/0249ff0d913dfaef2a6f5e8518e5736545a23c28..78b3d0dc3fc979d4c2ab507bf95d82b89e2792ad:/project/templates/explorer/file_list.html?ds=sidebyside diff --git a/project/templates/explorer/file_list.html b/project/templates/explorer/file_list.html index bfbafe13..d47a158a 100644 --- a/project/templates/explorer/file_list.html +++ b/project/templates/explorer/file_list.html @@ -1,9 +1,60 @@ {% extends "base.html" %} +{% 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 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(); + event.preventDefault(); + }); +}); +</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> + <div id="file-list"> + {% for file in files %} + <p title="{{file}}"><a href="{% url editor_view file %}">{{ file }}</a></p> + {% endfor %} + </div> +</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"> + <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> + <p><button type="submit">Dodaj ksiÄ Å¼kÄ</button></p> +</form> +</div> +{% endif %} + +</div> {% endblock maincontent %}