Skip to content

Commit

Permalink
Merge pull request Uninett#3073 from Uninett/uncrispify/add-spaceless…
Browse files Browse the repository at this point in the history
…-around-help-field-template

Add spaceless wrapper around helpfield template
  • Loading branch information
stveit authored Oct 3, 2024
2 parents 8332150 + 358a355 commit c78c57d
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 c78c57d

Please sign in to comment.