Procedural node add and edit forms
This commit is contained in:
28
attract/application/templates/nodes/edit.html
Normal file
28
attract/application/templates/nodes/edit.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{% extends 'layout.html' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="col-md-9">
|
||||
<h2>Edit {{ node.node_type.name }}</h2>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<form method="POST" action="{{url_for('nodes.edit', node_id=node.id)}}">
|
||||
{% 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="Edit {{ node.node_type.name }}">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user