{% extends "mini_buildd/base.html" %}
{% block title %}{% block titledup %}{% if request.GET.call %}API call {{ request.GET.call }}{% else %}API call index{% endif %}{% endblock %}{% endblock %}
{% block menu %}<li><a href="{% url 'api' %}"><img class="mbd-icon" src="{% static 'icons/actions/go-top.svg' %}" alt="Top" title="API call index"></a></li>{% endblock %}

{% block content %}
	{% if request.GET.call %}
		{% mbd_api request.GET.call verbose=True %}
	{% else %}
		{% for category in mbd.api.Call.CATEGORIES %}
			<section>
				<h3>{{ category }}</h3>
				{% for call in mbd.api.CALLS.values %}
					{% if call.category == category %}
					<details>
						<summary><strong>{{ call.name }}</strong>: <em>{{ call.doc_title }}</em>
							<a href="{{ request.path }}?call={{ call.name }}" title="Dedicated page for this call only" style="text-decoration: none;">
								<img class="mbd-icon mbd-icon-small" src="{% static 'icons/actions/arrow-up.svg' %}" alt="Isolate">
							</a>
						</summary>
						<section>
							{% mbd_api call verbose=True %}
						</section>
					</details>
				{% endif %}
			{% endfor %}
			</section>
		{% endfor %}
	{% endif %}
{% endblock %}
