add render_field macro to layout.html
This commit is contained in:
parent
8c8803874e
commit
6f218e591f
|
@ -4,6 +4,25 @@
|
|||
<li><a href='{{ url_for('get_manual') }}'>Manual</a></li>
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro render_field(field) %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">
|
||||
{{ field.label }}
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
{{ field(**kwargs)|safe }}
|
||||
{% if field.errors %}
|
||||
<ul class=errors>
|
||||
{% for error in field.errors %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
|
||||
|
|
Loading…
Reference in New Issue