Skip to content

Instantly share code, notes, and snippets.

@ziboumima
ziboumima / formhelper.html
Created June 18, 2014 21:52
Jinja2 template for bootstrap form
{% macro form_field(field) -%}
{% set with_label = kwargs.pop('with_label', False) %}
{% set placeholder = '' %}
{% if not with_label %}
{% set placeholder = field.label.text %}
{% endif %}
{% if field.type=='BooleanField' %}
<div class="checkbox">
<label>
<input type="checkbox"> {{ field.label.text }}