mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Tabify object add/edit views
This commit is contained in:
parent
65659fb676
commit
8653b0f3d0
@ -18,14 +18,25 @@
|
||||
{% endif %}
|
||||
{% endblock controls %}
|
||||
|
||||
{% block content %}
|
||||
{% block tabs %}
|
||||
<ul class="nav nav-tabs px-3">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="edit-form-tab" data-bs-toggle="tab" data-bs-target="#edit-form" type="button" role="tab" aria-controls="edit-form" aria-selected="true">
|
||||
{% if obj.pk %}Edit{% else %}Create{% endif %}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock tabs %}
|
||||
|
||||
{% block content-wrapper %}
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane show active" id="edit-form" role="tabpanel" aria-labelledby="object-list-tab">
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{% for field in form.hidden_fields %}{{ field }}{% endfor %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col col-md-12 col-lg-10 offset-lg-1">
|
||||
{% block tabs %}{% endblock %}
|
||||
{% block form %}
|
||||
{% if form.Meta.fieldsets %}
|
||||
|
||||
@ -88,9 +99,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if obj and settings.DOCS_ROOT %}
|
||||
{% if obj and settings.DOCS_ROOT %}
|
||||
{% include 'inc/modal.html' with name='docs' content=obj|get_docs %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% endblock content %}
|
||||
{% endblock content-wrapper %}
|
||||
|
@ -1,12 +1,12 @@
|
||||
{% load helpers %}
|
||||
|
||||
<ul class="nav nav-pills justify-content-center border-bottom-0 mb-1">
|
||||
<ul class="nav nav-tabs px-3">
|
||||
<li class="nav-item">
|
||||
<a
|
||||
class="nav-link {% if active_tab == 'add' %}active{% endif %}"
|
||||
href="{% url 'ipam:ipaddress_add' %}{% querystring request %}"
|
||||
>
|
||||
New IP
|
||||
{% if obj.pk %}Edit{% else %}Create{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
{% if 'interface' in request.GET or 'vminterface' in request.GET %}
|
||||
|
@ -5,6 +5,10 @@
|
||||
|
||||
{% block title %}Assign an IP Address{% endblock title %}
|
||||
|
||||
{% block tabs %}
|
||||
{% include 'ipam/inc/ipadress_edit_header.html' with active_tab='assign' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form action="{% querystring request %}" method="post" class="form form-horizontal">
|
||||
{% csrf_token %}
|
||||
|
@ -4,8 +4,11 @@
|
||||
|
||||
{% block title %}Bulk Add IP Addresses{% endblock %}
|
||||
|
||||
{% block tabs %}
|
||||
{% include 'ipam/inc/ipadress_edit_header.html' with active_tab='bulk_add' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block form %}
|
||||
{% include 'ipam/inc/ipadress_edit_header.html' with active_tab='bulk_add' %}
|
||||
<div class="field-group">
|
||||
<h5 class="text-center">IP Addresses</h5>
|
||||
{% render_field form.pattern %}
|
||||
|
@ -3,10 +3,11 @@
|
||||
{% load form_helpers %}
|
||||
{% load helpers %}
|
||||
|
||||
{% block form %}
|
||||
{% if not obj.pk %}
|
||||
{% block tabs %}
|
||||
{% include 'ipam/inc/ipadress_edit_header.html' with active_tab='add' %}
|
||||
{% endif %}
|
||||
{% endblock tabs %}
|
||||
|
||||
{% block form %}
|
||||
<div class="field-group">
|
||||
<h4 class="mb-3">IP Address</h4>
|
||||
{% render_field form.address %}
|
||||
|
Loading…
Reference in New Issue
Block a user