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

{% block content %}
	<header class="mbd-grid-lr">
		<h2>Showing latest <code>{{ view.mbd_buildlogs|length }}</code> of <code>{{ view.mbd_buildlogs_total }}</code> total buildlogs before <code class="mbd-localize-date" title="{{ view.mbd_before|date:'r' }}">{{ view.mbd_before|date:"r" }}</code></h2>
		<nav>
			<ul>
				{% include "mini_buildd/includes/range_menu.html" %}
			</ul>
		</nav>
	</header>

	{% mbd_hash "mbd-builds-"|add:path as table_id %}
	<table id="{{ table_id }}" style="width: 100%;">
		{% mbd_datatable table_id order='[0, "desc"]' columns='[null, {"orderable": false}]' %}
		<thead>
			<tr>
				<th>Timestamp</th>
				<th>Buildlog</th>
			</tr>
		</thead>
		<tbody>
			{% for timestamp, uri in view.mbd_buildlogs.items %}
				<tr>
					<td class="mbd-localize-date" data-order="{{ timestamp|date:"U:u" }}" title="{{ timestamp|date:"r" }}">{{ timestamp|date:"r" }}</td>
					<td>
						<a href="{% url 'builds-dir' uri|mbd_parent %}">
							<img class="mbd-icon" src="{% static 'icons/places/folder.svg' %}" alt="browse" title="Browse build dir">
						</a>
						<a href="{% url 'builds-dir' uri %}">{{ uri|mbd_basename }}</a>
					</td>
				</tr>
			{% endfor %}
		</tbody>
	</table>
{% endblock %}
