mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-08 16:48:16 -06:00
Clean up labels
This commit is contained in:
parent
bbfcba4b93
commit
7a646cdc94
@ -473,7 +473,8 @@ class VLANGroupBulkEditForm(NetBoxModelBulkEditForm):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
vlan_id_ranges = NumericRangeArrayField(
|
vlan_id_ranges = NumericRangeArrayField(
|
||||||
required=False,
|
label=_('VLAN ID ranges'),
|
||||||
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
model = VLANGroup
|
model = VLANGroup
|
||||||
|
@ -634,6 +634,7 @@ class VLANGroupForm(NetBoxModelForm):
|
|||||||
)
|
)
|
||||||
slug = SlugField()
|
slug = SlugField()
|
||||||
vlan_id_ranges = NumericRangeArrayField(
|
vlan_id_ranges = NumericRangeArrayField(
|
||||||
|
label=_('VLAN IDs'),
|
||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -54,9 +54,8 @@ class VLANGroup(OrganizationalModel):
|
|||||||
)
|
)
|
||||||
vlan_id_ranges = ArrayField(
|
vlan_id_ranges = ArrayField(
|
||||||
IntegerRangeField(),
|
IntegerRangeField(),
|
||||||
verbose_name=_('min/max VLAN IDs'),
|
verbose_name=_('VLAN ID ranges'),
|
||||||
default=get_default_vlan_ids,
|
default=get_default_vlan_ids,
|
||||||
help_text=_('Ranges of Minimum, maximum VLAN IDs'),
|
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True
|
null=True
|
||||||
)
|
)
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
<td>{{ object.scope|linkify|placeholder }}</td>
|
<td>{{ object.scope|linkify|placeholder }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{% trans "Permitted VIDs" %}</th>
|
<th scope="row">{% trans "VLAN IDs" %}</th>
|
||||||
<td>{{ object.vlan_ranges }}</td>
|
<td>{{ object.vlan_ranges }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
from django import forms
|
from django import forms
|
||||||
from django.contrib.postgres.forms import SimpleArrayField
|
from django.contrib.postgres.forms import SimpleArrayField
|
||||||
|
from django.utils.safestring import mark_safe
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from utilities.data import ranges_to_string, string_to_range_array
|
from utilities.data import ranges_to_string, string_to_range_array
|
||||||
|
|
||||||
@ -37,9 +38,8 @@ class NumericRangeArrayField(forms.CharField):
|
|||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
if not self.help_text:
|
if not self.help_text:
|
||||||
self.help_text = _(
|
self.help_text = mark_safe(
|
||||||
"Specify one or more numeric ranges separated by commas "
|
_("Specify one or more numeric ranges separated by commas. Example: " + "<code>1-5,20-30</code>")
|
||||||
"Example: <code>1-5,20-30</code>"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def clean(self, value):
|
def clean(self, value):
|
||||||
|
Loading…
Reference in New Issue
Block a user