Clean up cable termination types

This commit is contained in:
Jeremy Stretch 2018-11-14 12:17:18 -05:00
parent f8e6cfbeba
commit 63bd48003e
4 changed files with 17 additions and 1 deletions

View File

@ -1851,6 +1851,8 @@ class CableCreateForm(BootstrapMixin, ChainedFieldsMixin, forms.ModelForm):
termination_a_type = self.instance.termination_a._meta.model_name
self.fields['termination_b_type'].queryset = ContentType.objects.filter(
model__in=COMPATIBLE_TERMINATION_TYPES.get(termination_a_type)
).exclude(
model='circuittermination'
)

View File

@ -1,5 +1,6 @@
{% extends '_base.html' %}
{% load static %}
{% load helpers %}
{% load form_helpers %}
{% block content %}
@ -49,6 +50,12 @@
<p class="form-control-static">{{ termination_a.device }}</p>
</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">
<label class="col-md-3 control-label required">Name</label>
<div class="col-md-9">

View File

@ -1,3 +1,4 @@
{% load helpers %}
<table class="table table-hover panel-body attr-table">
{% if termination.device %}
{# Device component #}
@ -7,6 +8,12 @@
<a href="{{ termination.device.get_absolute_url }}">{{ termination.device }}</a>
</td>
</tr>
<tr>
<td>Type</td>
<td>
{{ termination|model_name|capfirst }}
</td>
</tr>
<tr>
<td>Component</td>
<td>{{ termination }}</td>

View File

@ -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>