Skip to content

Instantly share code, notes, and snippets.

View swdevbali's full-sized avatar
:octocat:
Bringing back my golden era of programming! Wohoo!

Eko Suprapto Wibowo swdevbali

:octocat:
Bringing back my golden era of programming! Wohoo!
View GitHub Profile
{% macro render_field(field) -%}
{% set with_label = kwargs.pop('with_label', False) %}
{% set placeholder = '' %}
{% if not with_label %}
{% set placeholder = field.label.text %}
{% endif %}
<div class="form-group {% if field.errors %}error{% endif %}">
{% if with_label %}
<label for="{{ field.id }}" class="control-label">
{{ field.label.text }}{% if field.flags.required %} *{% endif %}: