[FIX] putting the labels of the forms above the fields

This commit is contained in:
altf4arnold 2024-05-07 16:24:33 +02:00
parent b4486b4d30
commit 957df53b52
No known key found for this signature in database
GPG Key ID: AE66543374E41C89

View File

@ -11,7 +11,7 @@
{# NetBox logo #} {# NetBox logo #}
<div class="text-center mb-4"> <div class="text-center mb-4">
<img src="{% static 'netbox_logo.svg' %}" height="80" alt="{% trans "NetBox logo" %}" /> <img src="{% static 'netbox_logo.svg' %}" height="80" alt="{% trans "NetBox logo" %}"/>
</div> </div>
{# Login banner #} {# Login banner #}
@ -41,12 +41,24 @@
{# Set post-login URL #} {# Set post-login URL #}
{% if 'next' in request.GET %} {% if 'next' in request.GET %}
<input type="hidden" name="next" value="{{ request.GET.next }}" /> <input type="hidden" name="next" value="{{ request.GET.next }}"/>
{% elif 'next' in request.POST %} {% elif 'next' in request.POST %}
<input type="hidden" name="next" value="{{ request.POST.next }}" /> <input type="hidden" name="next" value="{{ request.POST.next }}"/>
{% endif %} {% endif %}
{% render_form form %} {% for field in form %}
<div class="form-group">
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
{{ field }}
{% if field.errors %}
<ul class="errorlist">
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endfor %}
<div class="form-footer"> <div class="form-footer">
<button type="submit" class="btn btn-primary w-100"> <button type="submit" class="btn btn-primary w-100">
@ -55,6 +67,8 @@
</div> </div>
</form> </form>
</div> </div>
</div>
{# SSO login #} {# SSO login #}
{% if auth_backends %} {% if auth_backends %}