{% extends "mini_buildd/base.html" %}
{% block title %}{% block titledup %}{{ route|title }} dir: /{{ path }}{% endblock %}{% endblock %}
{% block tooltip %}Directory Listing{% endblock %}

{% block content %}
	{% if view.mbd_scandir %}
		{% mbd_token as table_id %}
		<table id="{{ table_id }}" style="width: 100%;">
			{% mbd_datatable table_id order='[1, "asc"]' %}
			<thead>
				<tr>
					<th>Type</th>
					<th>Name</th>
					<th>Size</th>
					<th>Modified</th>
				</tr>
			</thead>
			<tbody>
				{% for direntry in view.mbd_scandir %}
					{% with typ=direntry.is_dir|yesno:"places/folder,mimetypes/text-x-generic" apx=direntry.is_dir|yesno:"/," mtime=direntry.stat.st_mtime|mbd_fromtimestamp %}
						<tr>
							<td>
								<img class="mbd-icon" src="{% static 'icons/'|add:typ|add:'.svg' %}" alt="{{ typ }}">
							</td>
							<td>
								<a href="{% mbd_join request.path direntry.name %}{{ apx }}"><code>{{ direntry.name }}{{ apx }}</code></a>
							</td>
							<td>
								{{ direntry.stat.st_size }}
							</td>
							<td class="mbd-localize-date" title="{{ mtime|date:"r" }}" data-order="{{ mtime|date:"U:u" }}">
								{{ mtime|date:"r" }}
							</td>
						</tr>
					{% endwith %}
				{% endfor %}
			</tbody>
		</table>
	{% else %}
		{% mbd_file file_path=view.mbd_fullpath uri=view.mbd_static_uri %}
	{% endif %}
{% endblock %}
