1
0
mirror of https://github.com/moepman/bk-dss synced 2024-12-23 03:44:28 +01:00
bk-dss/templates/_helpers.html

21 lines
748 B
HTML
Raw Normal View History

{% macro render_field(field) %}
2024-07-23 17:24:37 +02:00
<div class="row mb-3">
{{ field.label(class_="col-form-label col-sm-3 text-right") }}
{% if field.errors %}{% set class_extras = " is-invalid" %}{% else %}{% set class_extras = "" %}{% endif %}
2024-07-23 17:24:37 +02:00
{% if field.type == "SelectField" %}{% set class_extras = class_extras + " form-select" %}{% endif %}
<div class="col-sm-5">{{ field(class_="form-control" + class_extras) }}
{% if field.errors %}
2024-07-23 17:24:37 +02:00
<div class="invalid-feedback">
{% for error in field.errors %}
{{ error }}
{% endfor %}
</div>
{% endif %}
2024-07-23 17:24:37 +02:00
</div>
</div>
2016-03-21 23:16:50 +01:00
{%- endmacro %}
{% macro render_button(button) %}
2024-07-23 17:24:37 +02:00
<div class="row"><div class="offset-sm-3 col-sm-5">{{ button(class_="btn btn-primary") }}</div></div>
{%- endmacro %}