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

{% block page_title %}{{ api_cmd.args.pattern.value }}{% endblock %}
{% block page_sub_title %}Source and binary package matches{% endblock %}

{% block content %}
	<div id="mbd-api_list">
		{% for repository, results in api_cmd.repositories.items %}
			<div class="box">
				<h1 class="box-caption">
					<a class="box-anchor"
						 title="goto repository {{ repository }}"
						 href="/mini_buildd/repositories/{{ repository }}/">Repository '{{ repository }}': {{ results|length }} packages
					</a>
				</h1>
				<table>
					<tr>
						<th>Package</th>
						<th>Type</th>
						<th>Architecture</th>
						<th>Distribution</th>
						<th>Component</th>
						<th>Version</th>
						<th>Source</th>
					</tr>
					{% for package in results %}
						<tr>
							<td>{{ package.package }}</td>
							<td>{{ package.type }}</td>
							<td>{{ package.architecture }}</td>
							<td>{{ package.distribution }}</td>
							<td>{{ package.component }}</td>
							<td>{{ package.version }}</td>
							<td>{{ package.source|urlencode }}{% mbd_api "show" value_package=package.source %}</td>
						</tr>
					{% endfor %}
				</table>
			</div>
		{% endfor %}
	</div>
{% endblock %}
