Merge pull request #93 from gazpachoking/index_icons

Add an icon and sort column for pages/dirs in the index
This commit is contained in:
Matthew Scragg 2015-12-13 21:20:42 -06:00
commit dd5cbf5910

View file

@ -3,7 +3,7 @@
{% block js %} {% block js %}
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('.data-table').dataTable(); $('.data-table').dataTable({'aaSorting': [[0, "asc"], [1, "asc"]]});
}); });
</script> </script>
{% endblock %} {% endblock %}
@ -18,17 +18,20 @@ $(document).ready(function() {
<table class="table table-bordered data-table"> <table class="table table-bordered data-table">
<thead> <thead>
<tr> <tr>
<th style="width: 1px;"></th>
<th>Name</th> <th>Name</th>
<th class="hidden-xs">Bytes</th> <th class="hidden-xs">Bytes</th>
<th>Created</th> <th class="hidden-xs hidden-sm">Created</th>
<th class="hidden-xs hidden-sm">Modified</th> <th>Modified</th>
</tr> </tr>
</thead> </thead>
{% for file in index %} {% for file in index %}
<tr> <tr>
{% if file['dir'] %} {% if file['dir'] %}
<td><i class="fa fa-folder-open-o"><span style="display:none;">Dir</span></i></td>
<td><a href="{{ url_for('wiki.index', path=file['name']) }}">{{ file['name'][path|length:] }}</a></td> <td><a href="{{ url_for('wiki.index', path=file['name']) }}">{{ file['name'][path|length:] }}</a></td>
{% else %} {% else %}
<td><i class="fa fa-file-text-o"><span style="display:none;">Page</span></i></td>
<td><a href="{{ url_for('wiki.page', name=file['name']) }}">{{ file['name'][path|length:] }}</a></td> <td><a href="{{ url_for('wiki.page', name=file['name']) }}">{{ file['name'][path|length:] }}</a></td>
{% endif %} {% endif %}
<td class="hidden-xs">{{ file['size'] }}</td> <td class="hidden-xs">{{ file['size'] }}</td>