fix(template): correct HTML structure in prefix_list

Adjusted the HTML structure in prefix_list template to fix the conditional rendering of the 'No prefixes' message. This change ensures that closing list tag renders correctly and prevents layout issues. The 'Create new prefix' button for superusers was also repositioned for better code readability.

Fixes layout glitch when no prefixes are present.
This commit is contained in:
Kumi 2024-06-23 17:00:04 +02:00
parent 8abb12bb06
commit 26d46853c4
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -8,18 +8,16 @@
{% if object_list|length == 0 %}
<li class="list-group-item">
No prefixes.
{% if not user.is_superuser %}You can request prefixes by contacting the administrator.
{% endif %}
{% endif %}
</li>
{% if not user.is_superuser %}You can request prefixes by contacting the administrator.{% endif %}
</li>
{% endif %}
{% for prefix in object_list %}
<li class="list-group-item">
<a href="{% url 'prefix_detail' prefix.pk %}">{{ prefix.prefix }} &dash; {{ prefix.name }}</a>
</li>
{% endfor %}
</ul>
{% if user.is_superuser %}
<a class="btn btn-primary mt-3" href="{% url 'prefix_create' %}">Create new prefix</a>
{% endif %}
{% for prefix in object_list %}
<li class="list-group-item">
<a href="{% url 'prefix_detail' prefix.pk %}">{{ prefix.prefix }} &dash; {{ prefix.name }}</a>
</li>
{% endfor %}
</ul>
{% if user.is_superuser %}
<a class="btn btn-primary mt-3" href="{% url 'prefix_create' %}">Create new prefix</a>
{% endif %}
{% endblock content %}