{% extends "mini_buildd/includes/api/base.html" %}
{% block results %}
	<h2><strong>&quot;<code>{{ view.mbd_call.pattern }}</code>&quot;</strong>: {{ view.mbd_call.result|length }} matching source package(s)</h2>
	{% for source, results in view.mbd_call.result.items %}
		<section class="mbd-search-results">
			<details>
				<summary title="Show matching files"><img class="mbd-icon" src="{% static 'icons/files.svg' %}" alt="matching files"> {% mbd_api "ls" hide_options=True name=source value_source=source %} (<a href="{% url 'events' source %}" title="Show events for {{ source }}">Events</a>)</summary>
				{% mbd_token as table_id %}
				<table id="{{ table_id }}" style="width: 100%;">
					{% mbd_datatable table_id columns='[{"searchable": false, "orderable": false}, null, ]'%}
					<thead>
						<tr>
							<th>Found&nbsp;in</th>
							<th>Matching files</th>
						</tr>
					</thead>
					<tbody>
						{% for typ, matches in results.items %}
							{% for match in matches %}
								<tr class="mbd-search-match-{{typ}}" title="{% mbd_dict_get view.mbd_call.MSG typ %}">
									<td><em>{{ typ }}</em></td>
									<td data-search="{{ match }}" style="width: 100%">
										<a href="{% url typ|add:'-static' match %}">{{ match }}</a>
										<a class="mbd-icon" href="{% url typ|add:'-dir' match %}" title="Details/Browse of {{ match }}"><img class="mbd-icon" src="{% static 'icons/'|add:'details.svg' %}" alt="Details or Browse"></a>
									</td>
								</tr>
							{% endfor %}
						{% endfor %}
					</tbody>
				</table>
			</details>
		</section>
	{% endfor %}
{% endblock %}
