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

{% block page_title %}Repository {{ object.identity }}{% endblock %}
{% block page_sub_title %}Overview{% endblock %}

{% block content %}

	<div id="mbd_repository">
		{% mbd_api "getuploaders" value_repository=object.identity %}

		{% for d in object.distributions.all %}
			<div class="inner-box">
				<details>
					<summary class="header">{{ d }}</summary>
					{% for s in object.layout.suiteoption_set.all %}
						<details>
							<summary class="header">
								<span style="color: black">{{ d.base_source.codename }}-{{ object.identity }}-{{ s.suite.name }}</span>:
								<span class="emphasize-headline">{% mbd_repository_desc object d s %}</span>
								{% if s.uploadable %}
									<kbd style="font-size: 0.8em; color: purple">(U='{% mbd_repository_mandatory_version object d s %}')</kbd>
								{% endif %}
								{% if s.experimental %}
									<kbd style="font-size: 0.8em; color: red">(E)</kbd>
								{% endif %}
								<span id="mbd_dist_{{ d.base_source.codename }}_{{ s.suite.name }}_header" style="float: right">(show)</span>
								{% if s.migrates_to %}
									<kbd style="font-size: 0.8em; color: green"> =&gt; {{ s.migrates_to.suite.name }}</kbd>
								{% endif %}
							</summary>
							<ul>
								<li>APT line
									(Download:
									{% mbd_api "getkey" name="APT key" output="plain" %}
									{% mbd_api "getsourceslist" output="plain" value_suite=s.suite.name value_codename=d.base_source.codename value_with_extra_sources=False value_repository=object.identity name="deb" value_with_deb_src=False %}
									{% mbd_api "getsourceslist" output="plain" value_suite=s.suite.name value_codename=d.base_source.codename value_with_extra_sources=False value_repository=object.identity name="deb+src" value_with_deb_src=True %})
									:
									<pre class="pre-block">{% mbd_distribution_apt_line d object s %}</pre></li>
								{% if s.uploadable %}
									<li>Building with APT sources.list:<div class="pre-block"><pre>{% mbd_distribution_apt_sources_list d object s %}</pre></div></li>
									<li>Building with APT preferences:<div class="pre-block"><pre>{% mbd_distribution_apt_preferences d object s %}</pre></div></li>
								{% endif %}
								<li>Browse repository:
									<a href="/repositories/{{ object.identity }}/pool/">pool/</a>
									<a href="/repositories/{{ object.identity }}/dists/{{ d.base_source.codename }}-{{ object.identity }}-{{ s.suite.name }}/">dists/</a>
								</li>
							</ul>
						</details>
					{% endfor %}
				</details>
			</div>
		{% endfor %}
	</div>
{% endblock %}
