Skip to content

Commit

Permalink
Merge pull request #3008 from Uninett/custom-crispy-templates
Browse files Browse the repository at this point in the history
Uncrispyfy NAV's custom crispy templates
  • Loading branch information
podliashanyk authored Sep 25, 2024
2 parents 5d58d78 + 385d112 commit b0c52bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{% load crispy_forms_field %}
{% load forms %}

{% if field.is_hidden %}
{{ field }}
{% else %}
<div id="div_{{ field.auto_id }}" class="ctrlHolder{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.errors and form_show_errors %} error{% endif %}{% if field|is_checkbox %} checkbox{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
<div id="div_{{ field.auto_id }}" class="ctrlHolder{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.errors and form_show_errors %} error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
{% if field.label %}
{% if field|is_checkbox %}
{% crispy_field field %}
{{ field }}
{% endif %}

<label for="{{ field.id_for_label }}" {% if field.field.required %}class="requiredField"{% endif %}>
Expand All @@ -20,7 +20,7 @@
{% endif %}

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

{% if form_show_errors %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{% load crispy_forms_field %}

<div id="div_{{ field.auto_id }}" class="ctrlHolder{% if field.errors and form_show_errors %} error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
<label for="{{ field.id_for_label }}">
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
{% crispy_field field %}
{{ field }}
</label>
{% if form_show_errors %}
{% for error in field.errors %}
Expand Down

0 comments on commit b0c52bd

Please sign in to comment.