a small relational database with user-editable schema for manual data entry
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.
 
 
 
 
 
 
yopa/yopa-web/resources/templates/models/relation_create.html.tera

41 lines
1.3 KiB

{% extends "_layout" %}
{% import "_form_macros" as form %}
{% block title -%}
Define relation
{%- endblock %}
{% block nav -%}
<a href="/" class="btn btn-link"><i class="icon icon-home"></i>Home</a>
{%- endblock %}
{% block content -%}
<form action="/model/relation/create" method="POST">
<input type="hidden" name="object" value="{{object.id}}">
{{ form::header_with_save_button(heading='Define new relation from "'~object.name~'"') }}
<div class="form-horizontal container">
{{ form::text(name="name", label="Name", value=old.name) }}
{{ form::text(name="reciprocal_name", label="Reciprocal name", value=old.reciprocal_name) }}
{{ form::checkbox(name="optional", label="Optional", checked=old.optional) }}
{{ form::checkbox(name="multiple", label="Multiple", checked=old.multiple) }}
{{ form::integer(name="sort_key", label="Sort order", value=old.sort_key) }}
<div class="form-group cols">
<div class="col-3 pl-2">
<label class="form-label" for="related">Related object</label>
</div>
<div class="col-9 pr-2">
<select name="related" class="form-select input-inline" id="related" autocomplete="off">
{% for m in models %}
<option value="{{ m.id }}" {{selected(val=old.related, opt=m.id)}}>{{ m.name }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
</form>
{%- endblock %}