{% extends "mini_buildd/base.html" %}
{% load mini_buildd_tags %}

{% block page_title %}Logs for: {{ repository }}/{{ package }}/{{ version }}{% endblock %}

{% block content %}
	<div id="mbd-api">
		<div class="box">
			<h1 class="box-caption">Logs for: {{ repository }}/{{ package }}/{{ version }}</h1>
			{% for key, values in logs %}
				{% if values.changes %}
					<h2 class="{{ key }}">{{ key }}</h2>
					{% ifequal key "Failed" %}
						<p>
							{% mbd_api "retry" value_package=package value_version=version value_repository=repository %}
						</p>
					{% endifequal %}
					<p>
						<a title="Browse log directory" href="/log/{{ repository }}{% ifequal key "Failed" %}/_failed{% endifequal %}/{{ package }}/{{ version }}/">Browse files</a>
						{% mbd_api "show" value_package=package %}
					</p>
					<hr/>

					<h3>Build logs</h3>
					<p>
						{% for arch, uri in values.buildlogs.items %}
							<a title="Build log for {{ arch }}" href="/log{{ uri }}">{{ arch }}</a>
						{% endfor %}
					</p>
					<hr/>

					<h3><a title="Download changes for {{ repository }}/{{ package }}/{{ version }}" href="/log{{ values.changes_path }}">Changes</a></h3>
					<pre>{{ values.changes }}</pre>
				{% endif %}
			{% endfor %}
		</div>
	</div>
{% endblock %}
