1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Clean up form display

This commit is contained in:
jeremystretch
2021-12-28 08:54:03 -05:00
parent ba85101d30
commit 8ca09ec07f
6 changed files with 24 additions and 31 deletions

View File

@@ -2,6 +2,6 @@
{% load form_helpers %}
{% block form %}
{% render_form form %}
{% render_form model_form %}
{% render_form replication_form %}
{{ block.super }}
{% endblock form %}

View File

@@ -1,16 +0,0 @@
{% extends 'generic/object_edit.html' %}
{% block buttons %}
<a class="btn btn-outline-danger" href="{{ return_url }}">Cancel</a>
{% if component_type == 'interface' and perms.ipam.add_ipaddress %}
<button type="submit" name="_assignip" class="btn btn-outline-success">
Create & Assign IP Address
</button>
{% endif %}
<button type="submit" name="_addanother" class="btn btn-outline-primary">
Create & Add Another
</button>
<button type="submit" name="_create" class="btn btn-primary">
Create
</button>
{% endblock %}

View File

@@ -40,7 +40,7 @@
{# Render grouped fields according to Form #}
{% for group, fields in form.Meta.fieldsets %}
<div class="field-group my-5">
<div class="field-group mb-5">
<div class="row mb-2">
<h5 class="offset-sm-3">{{ group }}</h5>
</div>
@@ -51,7 +51,7 @@
{% endfor %}
{% if form.custom_fields %}
<div class="field-group my-5">
<div class="field-group mb-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
</div>
@@ -60,7 +60,7 @@
{% endif %}
{% if form.comments %}
<div class="field-group my-5">
<div class="field-group mb-5">
<h5 class="text-center">Comments</h5>
{% render_field form.comments %}
</div>
@@ -68,7 +68,7 @@
{% else %}
{# Render all fields in a single group #}
<div class="field-group my-5">
<div class="field-group mb-5">
{% block form_fields %}{% render_form form %}{% endblock %}
</div>
{% endif %}