{% load crispy_forms_bulma_field %}

{# use a negated variable, so it get's rendered by default and we don't need to modify the FormHelper #}
{% if not exclude_field_wrapper %}
<div class="field{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if form_horizontal %} is-horizontal{% endif %}">
{% if form_horizontal %}
<div class="field-label">
  <!-- Left empty for spacing -->
</div>
<div class="field-body">
  <div class="field">
{% endif %}
{% endif %}

<div class="control{% if control_class %} {{ control_class }}{% endif %}">
  <input type="{{ input.input_type }}"
    name="{% if input.name|wordcount > 1 %}{{ input.name|slugify }}{% else %}{{ input.name }}{% endif %}"
    value="{{ input.value }}"
    {% if input.input_type != "hidden" %}
        class="{{ input.field_classes }}"
        id="{{ input.id }}"
    {% endif %}
    {{ input.flat_attrs }}
    />
</div>

{% if not exclude_field_wrapper %}
{% if form_horizontal %}
  </div>
</div>
{% endif %}
</div>
{% endif %}
