{% mbd_token as token %}  {# Still needed for some ids (here and in api_arg.html) #}

{% if verbose %}
	<h3>{{ call.doc_title }}</h3>
	<pre>{{ call.doc_body }}</pre>
{% endif %}

<form id="{{ token }}" class="mbd-api" method="get" action="{{ call.uri }}" onsubmit="return mbd_api_call(this, '{{ call.name }}');">
	{% include "mini_buildd/includes/tags/api_args.html" with args=args.mandatory %}

	<input type="submit" value="{{ name }}" title="{{ call.doc }}{{ is_authorized|yesno:', ⚠ Please log in to run this API call ⚠' }}" {{ is_authorized|yesno:',disabled' }}>

	{% if call.CONFIRM %}
		<input type="checkbox" name="confirm" value="{{ call.name }}" title="This call needs to be explicitly confirmed (by checking this box)" required {{ is_authorized|yesno:',disabled' }}>
	{% endif %}

	{% for arg in args.hidden %}
		<input name="{{ arg.identity }}" type="hidden" value="{{ arg.strvalue }}">
	{% endfor %}

	{% if args.optional %}
		<details {{ verbose|yesno:'open,' }}>
			<summary title="Optional arguments"><img class="mbd-icon" src="{% static 'icons/arguments.svg' %}" alt="Optional arguments"></summary>
			{% include "mini_buildd/includes/tags/api_args.html" with args=args.optional %}
		</details>
	{% endif %}
</form>
