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