{% if arg.header %}  {# Note (See ``api.py`` ``header=``): Only use case is API call setup. #}
	<strong>{{ arg.header }}</strong><span></span><span></span>
{% endif %}

{# Note: Argument.choices may run code to determine resp. values; running these only once via 'with' variables does speed things up. #}
{% with id=token|add:"-"|add:arg.identity choices=arg.choices strdefault=arg.strdefault %}
	<label for="{{ id }}"><em>{{ arg.identity }}</em></label>
	<span>
		{% if arg.HTML_TYPE == "text" or arg.HTML_TYPE == "url" or arg.HTML_TYPE == "number" %}
			<input id="{{ id }}"
						 name="{{ arg.identity }}"
						 type="{{ arg.HTML_TYPE }}"
						 title="{{ arg.usage }}"
						 {% if choices %}list="{{ id }}-choices"{% endif %}
						 {{ arg.required|yesno:"required," }}
						 value="{{ arg.strgiven }}"
						 placeholder="{% if strdefault %}{{ strdefault }}{% else %}{{ arg.doc }}{% endif %}"
			>
			{% if choices %}
				<datalist id="{{ id }}-choices">
					{% for choice in choices %}
						<option value="{{ choice }}"></option>
					{% endfor %}
				</datalist>
			{% endif %}

			<img class="mbd-icon mbd-icon-small" src="{% static 'icons/clear.svg' %}" alt="Clear" title="Clear" onclick="$('#{{ id }}').prop('value', null);">
			{% if arg.strgiven %}
				<img class="mbd-icon mbd-icon-small" src="{% static 'icons/restore.svg' %}" alt="Restore" title="Restore initial value" onclick="$('#{{ id }}').prop('value', '{{ arg.strgiven }}');">
			{% endif %}
			{% if strdefault %}
				<img class="mbd-icon mbd-icon-small" src="{% static 'icons/paste.svg' %}" alt="Paste default" title="Paste default value for edit" onclick="$('#{{ id }}').prop('value', '{{ strdefault }}');">
			{% endif %}

		{% elif arg.HTML_TYPE == "select" %}
			<select id="{{ id }}" name="{{ arg.identity }}" title="{{ arg.usage }}">
				{% for choice in choices %}
					<option value="{{ choice }}"{% if arg.strvalue == choice %} selected{% endif %}>{{ choice }}</option>
				{% endfor %}
			</select>
		{% elif arg.HTML_TYPE == "checkbox" %}
			<input id="{{ id }}" name="{{ arg.identity }}" type="{{ arg.HTML_TYPE }}" title="{{ arg.usage }}" value="{{ True }}"{{ arg.given|yesno:" checked," }}>
		{% elif arg.HTML_TYPE == "textarea" %}
			<textarea id="{{ id }}" name="{{ arg.identity }}" title="{{ arg.usage }}" {{ arg.required|yesno:"required," }}>{{ arg.strgiven }}</textarea>
		{% else %}
			{{ arg.identity }}: Internal error: Unknown argument type {{ arg.HTML_TYPE }}.
		{% endif %}

	</span>
	<pre>{% if verbose %}{{ arg.usage }}{% endif %}</pre>
{% endwith %}
