15 lines
500 B
HTML
15 lines
500 B
HTML
{% macro render_field(field, label=True, wrapper_class="") %}
|
|
<div class="mb-4 {% if field.errors %}error{% endif %} {{ wrapper_class }}">
|
|
<label for="{{ field.id }}"
|
|
class="block mb-2 text-sm font-bold text-gray-700">{% if label %}{{ field.label }}{% endif %}</label>
|
|
{{ field(**kwargs)|safe }}
|
|
{% if field.errors %}
|
|
<ul class="errors">
|
|
{% for error in field.errors %}
|
|
<li>{{ error }}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
</div>
|
|
{% endmacro %}
|