mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 09:28:38 -06:00
Clean up cable termination types
This commit is contained in:
parent
f8e6cfbeba
commit
63bd48003e
@ -1851,6 +1851,8 @@ class CableCreateForm(BootstrapMixin, ChainedFieldsMixin, forms.ModelForm):
|
|||||||
termination_a_type = self.instance.termination_a._meta.model_name
|
termination_a_type = self.instance.termination_a._meta.model_name
|
||||||
self.fields['termination_b_type'].queryset = ContentType.objects.filter(
|
self.fields['termination_b_type'].queryset = ContentType.objects.filter(
|
||||||
model__in=COMPATIBLE_TERMINATION_TYPES.get(termination_a_type)
|
model__in=COMPATIBLE_TERMINATION_TYPES.get(termination_a_type)
|
||||||
|
).exclude(
|
||||||
|
model='circuittermination'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{% extends '_base.html' %}
|
{% extends '_base.html' %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
{% load helpers %}
|
||||||
{% load form_helpers %}
|
{% load form_helpers %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
@ -49,6 +50,12 @@
|
|||||||
<p class="form-control-static">{{ termination_a.device }}</p>
|
<p class="form-control-static">{{ termination_a.device }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-3 control-label required">Type</label>
|
||||||
|
<div class="col-md-9">
|
||||||
|
<p class="form-control-static">{{ termination_a|model_name|capfirst }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-3 control-label required">Name</label>
|
<label class="col-md-3 control-label required">Name</label>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{% load helpers %}
|
||||||
<table class="table table-hover panel-body attr-table">
|
<table class="table table-hover panel-body attr-table">
|
||||||
{% if termination.device %}
|
{% if termination.device %}
|
||||||
{# Device component #}
|
{# Device component #}
|
||||||
@ -7,6 +8,12 @@
|
|||||||
<a href="{{ termination.device.get_absolute_url }}">{{ termination.device }}</a>
|
<a href="{{ termination.device.get_absolute_url }}">{{ termination.device }}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Type</td>
|
||||||
|
<td>
|
||||||
|
{{ termination|model_name|capfirst }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Component</td>
|
<td>Component</td>
|
||||||
<td>{{ termination }}</td>
|
<td>{{ termination }}</td>
|
||||||
|
@ -1 +1 @@
|
|||||||
<option value="{{ widget.value }}"{% include "django/forms/widgets/attrs.html" %}{% if widget.value %} api-value="{{ widget.label|slugify }}"{% endif %}>{{ widget.label.label|default:widget.label }}</option>
|
<option value="{{ widget.value }}"{% include "django/forms/widgets/attrs.html" %}{% if widget.value %} api-value="{{ widget.label|slugify }}"{% endif %}>{{ widget.label.label|default:widget.label|capfirst }}</option>
|
||||||
|
Loading…
Reference in New Issue
Block a user