mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-09 00:58:16 -06:00
Select2 widgets for type, status, and length unit of cable
This commit is contained in:
parent
d0ec51eff0
commit
7c4c908758
@ -2725,6 +2725,11 @@ class ConnectCableToDeviceForm(BootstrapMixin, ChainedFieldsMixin, forms.ModelFo
|
||||
'termination_b_site', 'termination_b_rack', 'termination_b_device', 'termination_b_id', 'type', 'status',
|
||||
'label', 'color', 'length', 'length_unit',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect2(),
|
||||
'status': StaticSelect2(),
|
||||
'length_unit': StaticSelect2(),
|
||||
}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
@ -2929,6 +2934,11 @@ class CableForm(BootstrapMixin, forms.ModelForm):
|
||||
fields = [
|
||||
'type', 'status', 'label', 'color', 'length', 'length_unit',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect2(),
|
||||
'status': StaticSelect2(),
|
||||
'length_unit': StaticSelect2(),
|
||||
}
|
||||
|
||||
|
||||
class CableCSVForm(forms.ModelForm):
|
||||
|
@ -154,10 +154,10 @@
|
||||
{% render_field form.color %}
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label" for="id_length">{{ form.length.label }}</label>
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-5">
|
||||
{{ form.length }}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-4">
|
||||
{{ form.length_unit }}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -11,10 +11,10 @@
|
||||
{% render_field form.color %}
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label" for="id_length">{{ form.length.label }}</label>
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-5">
|
||||
{{ form.length }}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-4">
|
||||
{{ form.length_unit }}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user