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

{% block page_title %}Logs for: {{ repository }}/{{ package }}/{{ version }}{% endblock %}
{% block mbd_page_footer %} &raquo; 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>
							<a class="button-rebuild"
								 href="/mini_buildd/api?command=retry&amp;package={{ package|urlencode }}&amp;version={{ version|urlencode }}&amp;repository={{ repository|urlencode }}"
								 title="Retry {{ repository }}/{{ package }}/{{ version }}">
								Retry now
							</a>
						</p>
					{% endifequal %}
					<p>
						<a title="Browse log directory" href="/log/{{ repository }}{% ifequal key "Failed" %}/_failed{% endifequal %}/{{ package }}/{{ version }}/">Browse files</a>
						<a title="Show {{ package }} source package" href="/mini_buildd/api?command=show&amp;package={{ package|urlencode }}">Show package</a>
					</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 %}
