realms-wiki/realms/templates/wiki/index.html
2015-12-13 03:59:56 -05:00

41 lines
1.2 KiB
HTML

{% extends 'layout.html' %}
{% block js %}
<script>
$(document).ready(function() {
$('.data-table').dataTable();
});
</script>
{% endblock %}
{% block body %}
<h2>Index of <a href="{{ url_for('wiki.index') }}">/</a>
{%- set parts = path.split('/') -%}
{%- for dir in parts if dir -%}
<a href="{{ url_for('wiki.index', path='/'.join(parts[:loop.index])) }}">{{ dir }}/</a>
{%- endfor -%}
</h2>
<table class="table table-bordered data-table">
<thead>
<tr>
<th>Name</th>
<th class="hidden-xs">Bytes</th>
<th>Created</th>
<th class="hidden-xs hidden-sm">Modified</th>
</tr>
</thead>
{% for file in index %}
<tr>
{% if file['dir'] %}
<td><a href="{{ url_for('wiki.index', path=file['name']) }}">{{ file['name'][path|length:] }}</a></td>
{% else %}
<td><a href="{{ url_for('wiki.page', name=file['name']) }}">{{ file['name'][path|length:] }}</a></td>
{% endif %}
<td class="hidden-xs">{{ file['size'] }}</td>
<td>{{ file['ctime']|datetime }}</td>
<td class="hidden-xs hidden-sm">{{ file['mtime']|datetime }}</td>
</tr>
{% endfor %}
</table>
{% endblock %}