{% extends "base.html" %}

{% block page_header %}
	<div class="left">
		<div class="menu_title">
			Page
		</div>
		{% if api_cmd.args.package %}
			{% with api_cmd.args.package as package %}
				<a href="/mini_buildd/api?command=show&amp;package={{ package|urlencode }}" title="Show {{ package }} source package">Show package</a>
				<br />
				<a href="http://packages.qa.debian.org/common/index.html?src={{ package|urlencode }}" title="Show {{ package }} source package in Debian PTS">Show Debian</a>
				<br />
			{% endwith %}
		{% endif %}
		{% if api_cmd %}
			<hr />
			<a href="/mini_buildd/api?command={{ api_cmd.COMMAND|urlencode }}&amp;{% for k, v in api_cmd.args.items %}{{ k|urlencode }}={{ v|urlencode }}&amp;{% endfor %}output=plain" title="This API call with plain output">API: plain</a>
			<br />
			<a href="/mini_buildd/api?command={{ api_cmd.COMMAND|urlencode }}&amp;{% for k, v in api_cmd.args.items %}{{ k|urlencode }}={{ v|urlencode }}&amp;{% endfor %}output=python" title="This API call with python output">API: python</a>
			<br />
		{% endif %}
	</div>
	<div class="center">
		<div class="title">{% block page_title %}{% endblock %}</div><div class="sub_title">{% block page_sub_title %}{% endblock %}</div>
	</div>
	<div class="right">
		<div class="menu_title">
			Packages
		</div>
		<form action="/mini_buildd/api" method="get">
			<div>
				<input type="hidden" name="command" value="show" />
				<input type="text" name="package" size="12" value="{{ api_cmd.args.package }}" title="Source package name." />
				<input type="submit" value="Show" title="Show source package" style="width: 4em"/>
			</div>
		</form>
		<form action="/mini_buildd/api" method="get">
			<div>
				<input type="hidden" name="command" value="list" />
				<input type="text" name="pattern" size="12" value="{{ api_cmd.args.pattern }}" title="Source or binary package name pattern (shell-like glob)." />
				<input type="submit" value="List" title="List packages matching pattern" style="width: 4em" />
			</div>
		</form>
	</div>

	{% if api_cmd.args %}
		<div class="right">
			<form action="/mini_buildd/api" method="get">
				<div>
					<input type="hidden" name="command" value="{{ api_cmd.COMMAND }}" />
					{% for k, v in api_cmd.args.items %}
						<input type="text" title="{{ k }}" size="8" name="{{ k }}" value="{{ v }}" />
					{% endfor %}
					<input type="submit" value="Refine" title="Refined API call" style="width: 4em" />
				</div>
			</form>
		</div>
	{% endif %}

{% endblock %}
