forked from netbox-community/netbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
15541 Add component selector to InventoryItemTemplate (netbox-communi…
…ty#15759) * 15541 make inventoryitemtemplateform match inventoryitemform * 15541 set tab active
- Loading branch information
Showing
3 changed files
with
203 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{% extends 'generic/object_edit.html' %} | ||
{% load static %} | ||
{% load form_helpers %} | ||
{% load helpers %} | ||
{% load i18n %} | ||
|
||
{% block form %} | ||
<div class="field-group my-5"> | ||
<div class="row mb-2"> | ||
<h5 class="offset-sm-3">{% trans "Inventory Item" %}</h5> | ||
</div> | ||
{% render_field form.device_type %} | ||
{% render_field form.parent %} | ||
{% render_field form.name %} | ||
{% render_field form.label %} | ||
{% render_field form.role %} | ||
{% render_field form.description %} | ||
</div> | ||
|
||
<div class="field-group my-5"> | ||
<div class="row mb-2"> | ||
<h5 class="offset-sm-3">{% trans "Hardware" %}</h5> | ||
</div> | ||
{% render_field form.manufacturer %} | ||
{% render_field form.part_id %} | ||
</div> | ||
|
||
<div class="field-group my-5"> | ||
<div class="row mb-2"> | ||
<h5 class="offset-sm-3">{% trans "Component Assignment" %}</h5> | ||
</div> | ||
<div class="row mb-2 offset-sm-3"> | ||
<ul class="nav nav-pills" role="tablist"> | ||
<li role="presentation" class="nav-item"> | ||
<button role="tab" type="button" id="consoleport_tab" data-bs-toggle="tab" aria-controls="consoleport" data-bs-target="#consoleport" class="nav-link {% if form.initial.consoleporttemplate or form.no_component %}active{% endif %}"> | ||
{% trans "Console Port" %} | ||
</button> | ||
</li> | ||
<li role="presentation" class="nav-item"> | ||
<button role="tab" type="button" id="consoleserverport_tab" data-bs-toggle="tab" aria-controls="consoleserverport" data-bs-target="#consoleserverport" class="nav-link {% if form.initial.consoleserverporttemplate %}active{% endif %}"> | ||
{% trans "Console Server Port" %} | ||
</button> | ||
</li> | ||
<li role="presentation" class="nav-item"> | ||
<button role="tab" type="button" id="frontport_tab" data-bs-toggle="tab" aria-controls="frontport" data-bs-target="#frontport" class="nav-link {% if form.initial.frontporttemplate %}active{% endif %}"> | ||
{% trans "Front Port" %} | ||
</button> | ||
</li> | ||
<li role="presentation" class="nav-item"> | ||
<button role="tab" type="button" id="interface_tab" data-bs-toggle="tab" aria-controls="interface" data-bs-target="#interface" class="nav-link {% if form.initial.interfacetemplate %}active{% endif %}"> | ||
{% trans "Interface" %} | ||
</button> | ||
</li> | ||
<li role="presentation" class="nav-item"> | ||
<button role="tab" type="button" id="poweroutlet_tab" data-bs-toggle="tab" aria-controls="poweroutlet" data-bs-target="#poweroutlet" class="nav-link {% if form.initial.poweroutlettemplate %}active{% endif %}"> | ||
{% trans "Power Outlet" %} | ||
</button> | ||
</li> | ||
<li role="presentation" class="nav-item"> | ||
<button role="tab" type="button" id="powerport_tab" data-bs-toggle="tab" aria-controls="powerport" data-bs-target="#powerport" class="nav-link {% if form.initial.powerporttemplate %}active{% endif %}"> | ||
{% trans "Power Port" %} | ||
</button> | ||
</li> | ||
<li role="presentation" class="nav-item"> | ||
<button role="tab" type="button" id="rearport_tab" data-bs-toggle="tab" aria-controls="rearport" data-bs-target="#rearport" class="nav-link {% if form.initial.rearporttemplate %}active{% endif %}"> | ||
{% trans "Rear Port" %} | ||
</button> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="tab-content p-0 border-0"> | ||
<div class="tab-pane {% if form.initial.consoleporttemplate or form.no_component %}active{% endif %}" id="consoleport" role="tabpanel" aria-labeled-by="consoleport_tab"> | ||
{% render_field form.consoleporttemplate %} | ||
</div> | ||
<div class="tab-pane {% if form.initial.consoleserverporttemplate %}active{% endif %}" id="consoleserverport" role="tabpanel" aria-labeled-by="consoleserverport_tab"> | ||
{% render_field form.consoleserverporttemplate %} | ||
</div> | ||
<div class="tab-pane {% if form.initial.frontporttemplate %}active{% endif %}" id="frontport" role="tabpanel" aria-labeled-by="frontport_tab"> | ||
{% render_field form.frontporttemplate %} | ||
</div> | ||
<div class="tab-pane {% if form.initial.interfacetemplate %}active{% endif %}" id="interface" role="tabpanel" aria-labeled-by="interface_tab"> | ||
{% render_field form.interfacetemplate %} | ||
</div> | ||
<div class="tab-pane {% if form.initial.poweroutlettemplate %}active{% endif %}" id="poweroutlet" role="tabpanel" aria-labeled-by="poweroutlet_tab"> | ||
{% render_field form.poweroutlettemplate %} | ||
</div> | ||
<div class="tab-pane {% if form.initial.powerporttemplate %}active{% endif %}" id="powerport" role="tabpanel" aria-labeled-by="powerport_tab"> | ||
{% render_field form.powerporttemplate %} | ||
</div> | ||
<div class="tab-pane {% if form.initial.rearporttemplate %}active{% endif %}" id="rearport" role="tabpanel" aria-labeled-by="rearport_tab"> | ||
{% render_field form.rearporttemplate %} | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{% if form.custom_fields %} | ||
<div class="field-group my-5"> | ||
<div class="row mb-2"> | ||
<h5 class="offset-sm-3">{% trans "Custom Fields" %}</h5> | ||
</div> | ||
{% render_custom_fields form %} | ||
</div> | ||
{% endif %} | ||
{% endblock %} |