{% extends "_layout" %}
{% import "_form_macros" as form %}

{% block title -%}
Edit object model
{%- endblock %}

{% block nav -%}
<a href="/" class="btn btn-link"><i class="icon icon-home"></i>Home</a>
{%- endblock %}

{% block content -%}

<form action="/model/object/update/{{ model.id }}" method="POST">
	{{ form::header_with_save_button(heading="Edit object model "~model.name) }}

	<div class="form-horizontal container">
		{{ form::text(name="name", label="Name", value=model.name) }}

		<div class="form-group cols">
			<div class="col-3 pl-2">
				<label class="form-label" for="name_property">Name property</label>
			</div>
			<div class="col-9 pr-2">
				<select name="name_property" class="form-select input-inline" id="name_property" autocomplete="off">
					<option value=""></option>
					{% for p in properties %}
					<option value="{{ p.id }}" {{selected(val=old.name_property, opt=p.id)}}>{{ p.name }}</option>
					{% endfor %}
				</select>
			</div>
		</div>
	</div>
</form>

{%- endblock %}