Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fieldset error #588

Open
hamed-jamali-software opened this issue Jul 23, 2024 · 0 comments
Open

fieldset error #588

hamed-jamali-software opened this issue Jul 23, 2024 · 0 comments

Comments

@hamed-jamali-software
Copy link

I found an error in version 5 of Django that was fixed by changing this code
`{% load jazzmin %}
{% if card %}

{% if card_header and fieldset.name %}
{{ fieldset.name }}{% if fieldset.description %} - {{ fieldset.description }}{% endif %}
{%elif fieldset.description %}
{{ fieldset.description }}
{%endif%}
<div class="p-5{% if fieldset.name %} card-body{% endif %}">

{% endif %}

{% for line in fieldset %}
<div class="form-group{% if line.fields|length == 1 and line.errors %} errors{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
    <div class="row">
        {% for field in line %}
            <label class="{% if not line.fields|length == 1 and forloop.counter != 1 %}col-auto {% else %}col-sm-3 {% endif %}text-left" for="id_{{ field.field.name }}">
                {{ field.field.label|capfirst }}
                {% if field.field.field.required %}
                <span class="text-red">* </span>
                {% endif %}
            </label>
            <div class="{% if not line.fields|length == 1 %} col-auto  fieldBox {% else %} col-sm-7 {% endif %}
                         {% if field.field.name %} field-{{ field.field.name }}{% endif %}
                         {% if not field.is_readonly and field.errors %} errors{% endif %}
                         {% if field.field.is_hidden %} hidden {% endif %}
                         {% if field.is_checkcard %} checkcard-row{% endif %}">
                {% if field.is_readonly %}
                    <div class="readonly">{{ field.contents }}</div>
                {% else %}
                    {{ field.field }}
                {% endif %}
                <div class="help-block red">
                    {% if not line.fields|length == 1 and not field.is_readonly %}{{ field.errors }}{% endif %}
                </div>
                {% if field.field.help_text %}
                    <div class="help-block">{{ field.field.help_text|safe }}</div>
                {% endif %}
                <div class="help-block text-red">
                    {% if line.fields|length == 1 %}{{ line.errors }}{% endif %}
                </div>
            </div>
        {% endfor %}
    </div>
</div>
{% endfor %}

{% if card %}

{% endif %} `
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant