You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.8 KiB
56 lines
1.8 KiB
{% extends "_layout" %}
|
|
{% import "_form_macros" as form %}
|
|
|
|
{% block title -%}
|
|
Define property
|
|
{%- endblock %}
|
|
|
|
{% block nav -%}
|
|
<a href="/" class="btn btn-link"><i class="icon icon-home"></i>Home</a>
|
|
{%- endblock %}
|
|
|
|
{% block content -%}
|
|
|
|
<form action="/model/property/create" method="POST">
|
|
{{ form::header_with_save_button(heading="Add new property to "~object.describe) }}
|
|
|
|
<input type="hidden" name="object" value="{{object.id}}">
|
|
|
|
<div class="form-horizontal container">
|
|
{{ form::text(name="name", label="Name", value=old.name) }}
|
|
|
|
{{ form::checkbox(name="unique", label="Unique", checked=old.unique) }}
|
|
{{ form::checkbox(name="optional", label="Optional", checked=old.optional) }}
|
|
{{ form::checkbox(name="multiple", label="Multiple", checked=old.multiple) }}
|
|
|
|
<div class="form-group cols">
|
|
<div class="col-3 pl-2">
|
|
<label class="form-label" for="data_type">Data type</label>
|
|
</div>
|
|
<div class="col-9 pr-2">
|
|
<select name="data_type" class="form-select input-inline" id="data_type" autocomplete="off">
|
|
<option value="String" {{selected(opt="String",val=old.data_type)}}>String</option>
|
|
<option value="Integer" {{selected(opt="Integer",val=old.data_type)}}>Integer</option>
|
|
<option value="Decimal" {{selected(opt="Decimal",val=old.data_type)}}>Decimal</option>
|
|
<option value="Boolean" {{selected(opt="Boolean",val=old.data_type)}}>Boolean</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
{{ form::text(name="default", label="Default", value=old.default) }}
|
|
|
|
{{ form::integer(name="sort_key", label="Sort order", value=old.sort_key) }}
|
|
|
|
<div class="hidden" id="string-options">
|
|
{{ form::checkbox(name="opt_multiline", label="Multi-line", checked=old.opt_multiline) }}
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<script>
|
|
(function () {
|
|
Yopa.propertyEditForm()
|
|
})();
|
|
</script>
|
|
|
|
{%- endblock %}
|
|
|