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.
43 lines
1.2 KiB
43 lines
1.2 KiB
4 years ago
|
{% extends "_layout" %}
|
||
|
|
||
|
{% block title -%}
|
||
|
Define relation
|
||
|
{%- endblock %}
|
||
|
|
||
|
{% block nav -%}
|
||
|
<a href="/">Home</a>
|
||
|
{%- endblock %}
|
||
|
|
||
|
{% block content -%}
|
||
|
|
||
|
<h1>Define new relation from "{{object.name}}"</h1>
|
||
|
|
||
|
<form action="/model/relation/create" method="POST">
|
||
|
<input type="hidden" name="object" value="{{object.id}}">
|
||
|
|
||
|
<label for="name">Name:</label>
|
||
4 years ago
|
<input type="text" id="name" name="name" value="{{old.name}}" autocomplete="off"><br>
|
||
4 years ago
|
|
||
4 years ago
|
<label for="reciprocal_name">Reciprocal name:</label>
|
||
4 years ago
|
<input type="text" id="reciprocal_name" name="reciprocal_name" value="{{old.reciprocal_name}}" autocomplete="off"><br>
|
||
4 years ago
|
|
||
4 years ago
|
<label for="optional">Optional:</label>
|
||
4 years ago
|
<input type="checkbox" name="optional" id="optional" value="true" {{opt(checked=old.optional)}} autocomplete="off">
|
||
4 years ago
|
<br>
|
||
|
|
||
|
<label for="multiple">Multiple:</label>
|
||
4 years ago
|
<input type="checkbox" name="multiple" id="multiple" value="true" {{opt(checked=old.multiple)}} autocomplete="off"><br>
|
||
4 years ago
|
|
||
|
<label for="related">Related object:</label>
|
||
4 years ago
|
<select name="related" id="related" autocomplete="off">
|
||
4 years ago
|
{% for m in models %}
|
||
4 years ago
|
<option value="{{ m.id }}" {{selected(val=old.related, opt=m.id)}}>{{ m.name }}</option>
|
||
4 years ago
|
{% endfor %}
|
||
|
</select><br>
|
||
|
|
||
|
<input type="submit" value="Save">
|
||
|
</form>
|
||
|
|
||
|
|
||
|
{%- endblock %}
|