added tmeplate macros and base template for forms

This commit is contained in:
Kyle Roux
2017-05-16 10:51:21 -07:00
parent ce763d6493
commit 8faabf9775
6 changed files with 79 additions and 87 deletions

View File

@ -1,20 +1,3 @@
{% extends 'layouts/master.html' %}
{% extends 'web/contact_form.html' %}
{% block title %}New contact{% endblock %}
{% block body %}
<h1>New contact</h1>
<form action="{{ url_for('new_contact') }}" method="post">
{{ form.csrf_token }}
{% for field in form %}
{% if field.label.text != 'CSRF Token' %}
<div class="form-group{%if field.errors %} has-error{% endif %}">
{{ field.label }}
{{ field(class='form-control', value='') }}
{% for error in field.errors %}
<span class="help-block">{{ error }}</span>
{% endfor %}
</div>
{% endif %}
{% endfor %}
<input type="submit" class="btn btn-success" value="Add">
</form>
{% endblock %}
{% block form_action %}{{ url_for('new_contact') }}{% endblock %}