Skip to content

Commit

Permalink
Add spaceless wrapper around helpfield template
Browse files Browse the repository at this point in the history
Whitespace showed up on checkboxes without this
  • Loading branch information
stveit committed Oct 3, 2024
1 parent 63d4fd3 commit 358a355
Showing 1 changed file with 29 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
{% load forms %}
{% spaceless %}
{% if field.is_hidden %}
{{ field }}
{% else %}
<div id="div_{{ field.auto_id }}" class="ctrlHolder{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.errors %} error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
{% if field.label %}
{% if field|is_checkbox %}
{{ field }}
{% endif %}

{% if field.is_hidden %}
{{ field }}
{% else %}
<div id="div_{{ field.auto_id }}" class="ctrlHolder{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.errors %} error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
{% if field.label %}
{% if field|is_checkbox %}
{{ field }}
<label for="{{ field.id_for_label }}" {% if field.field.required %}class="requiredField"{% endif %}>
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
{% if field.help_text %}
&nbsp;<i id="hint_{{ field.auto_id }}" class="fa fa-info-circle" data-tooltip title="
{{ field.help_text }}
"></i>
{% endif %}
</label>
{% endif %}

<label for="{{ field.id_for_label }}" {% if field.field.required %}class="requiredField"{% endif %}>
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
{% if field.help_text %}
&nbsp;<i id="hint_{{ field.auto_id }}" class="fa fa-info-circle" data-tooltip title="
{{ field.help_text }}
"></i>
{% endif %}
</label>
{% endif %}

{% if not field|is_checkbox %}
{{ field }}
{% endif %}
{% if not field|is_checkbox %}
{{ field }}
{% endif %}

{% for error in field.errors %}
<small id="error_{{ forloop.counter }}_{{ field.auto_id }}"
class="errorField">
{{ error }}
</small>
{% endfor %}
{% for error in field.errors %}
<small id="error_{{ forloop.counter }}_{{ field.auto_id }}"
class="errorField">
{{ error }}
</small>
{% endfor %}

</div>
{% endif %}
</div>
{% endif %}
{% endspaceless %}

0 comments on commit 358a355

Please sign in to comment.