Procedural node add and edit forms

This commit is contained in:
2015-02-02 20:42:48 +01:00
parent cc534ae4ef
commit be5c33c581
9 changed files with 242 additions and 33 deletions

View File

@@ -2,28 +2,25 @@
{% block body %}
<div class="col-md-9">
<h2>Add Node type</h2>
<h2>Add {{ node_type }}</h2>
<div class="row">
<div class="col-md-6">
<form method="POST" action="{{url_for('nodes.add')}}">
{{ form.hidden_tag() }}
<div class="form-group">
{{ form.name.label }}
{{ form.name(size=20, class='form-control') }}
</div>
<div class="form-group">
{{ form.description.label }}
{{ form.description(size=20, class='form-control') }}
</div>
<div class="form-group">
{{ form.url.label }}
{{ form.url(size=20, class='form-control') }}
</div>
<div class="form-group">
{{ form.is_extended.label }}
{{ form.is_extended(class='form-control') }}
</div>
<input class="btn btn-default" type="submit" value="Add Node Type">
<form method="POST" action="{{url_for('nodes.add', node_type=node_type)}}">
{% for field in form %}
{% if field.name == 'csrf_token' %}
{{ field }}
{% else %}
{% if field.type == "HiddenField" %}
{{ field }}
{% else %}
<div class="form-group">
{{ field.label }}
{{ field(class='form-control') }}
</div>
{% endif %}
{% endif %}
{% endfor %}
<input class="btn btn-default" type="submit" value="Create {{ node_type.name }}">
</form>
</div>
</div>