Jelajahi Sumber

add bootstrap classes to VC membership form

checktheroads 4 tahun lalu
induk
melakukan
43703b6f40
1 mengubah file dengan 4 tambahan dan 0 penghapusan
  1. 4 0
      netbox/dcim/forms.py

+ 4 - 0
netbox/dcim/forms.py

@@ -4599,6 +4599,10 @@ class DeviceVCMembershipForm(forms.ModelForm):
         # Require VC position (only required when the Device is a VirtualChassis member)
         self.fields['vc_position'].required = True
 
+        # Add bootstrap classes to form elements.
+        self.fields['vc_position'].widget.attrs = {'class': 'form-control'}
+        self.fields['vc_priority'].widget.attrs = {'class': 'form-control'}
+
         # Validation of vc_position is optional. This is only required when adding a new member to an existing
         # VirtualChassis. Otherwise, vc_position validation is handled by BaseVCMemberFormSet.
         self.validate_vc_position = validate_vc_position