{% block extra_head %}
	<link rel="stylesheet" href="{{prefix}}/files/css/insert.css">
	<script src="{{prefix}}/files/js/insert.js"></script>
{% endblock %}

<form class="form-floating" onsubmit="submitInsert(event);return false;">
	{% for row in structure %}
		<div class="form-floating mb-3">
			<input
			{% if row['type'] in ['INTEGER', 'NUMERIC', 'REAL'] %}
				type="number"
			{% else %}
				type="text"
			{% endif %}
			value="{{row['value']}}"
			class="form-control" name="{{row['name']}}" placeholder="">
			<label>
				{% if row["notnull"] == 1 %}<code>*</code>{% endif %}{{row["name"]}} <code>({{row["type"]}})</code>
			</label>
		</div>
	{% endfor %}

	<div class="alert alert-danger" role="alert" id="sql-error"></div>

	<div style="text-align: center;">
		<button type="submit" class="btn btn-primary">
			{% if current_tab == 'edit' %}Update{% else %}Insert{% endif %}
		</button>
	</div>
</form>
