mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-23 20:12:42 -06:00
Closes #13150: Wrap table column headers with gettext()
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import django_tables2 as tables
|
||||
from django.utils.translation import gettext as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from dcim.tables.devices import BaseInterfaceTable
|
||||
from netbox.tables import NetBoxTable, columns
|
||||
@@ -40,33 +40,43 @@ VMINTERFACE_BUTTONS = """
|
||||
|
||||
class VirtualMachineTable(TenancyColumnsMixin, ContactsColumnMixin, NetBoxTable):
|
||||
name = tables.Column(
|
||||
verbose_name=_('Name'),
|
||||
order_by=('_name',),
|
||||
linkify=True
|
||||
)
|
||||
status = columns.ChoiceFieldColumn()
|
||||
status = columns.ChoiceFieldColumn(
|
||||
verbose_name=_('Status'),
|
||||
)
|
||||
site = tables.Column(
|
||||
verbose_name=_('Site'),
|
||||
linkify=True
|
||||
)
|
||||
cluster = tables.Column(
|
||||
verbose_name=_('Cluster'),
|
||||
linkify=True
|
||||
)
|
||||
device = tables.Column(
|
||||
verbose_name=_('Device'),
|
||||
linkify=True
|
||||
)
|
||||
role = columns.ColoredLabelColumn()
|
||||
comments = columns.MarkdownColumn()
|
||||
role = columns.ColoredLabelColumn(
|
||||
verbose_name=_('Role'),
|
||||
)
|
||||
comments = columns.MarkdownColumn(
|
||||
verbose_name=_('Comments'),
|
||||
)
|
||||
primary_ip4 = tables.Column(
|
||||
linkify=True,
|
||||
verbose_name='IPv4 Address'
|
||||
verbose_name=_('IPv4 Address')
|
||||
)
|
||||
primary_ip6 = tables.Column(
|
||||
linkify=True,
|
||||
verbose_name='IPv6 Address'
|
||||
verbose_name=_('IPv6 Address')
|
||||
)
|
||||
primary_ip = tables.Column(
|
||||
linkify=True,
|
||||
order_by=('primary_ip4', 'primary_ip6'),
|
||||
verbose_name='IP Address'
|
||||
verbose_name=_('IP Address')
|
||||
)
|
||||
tags = columns.TagColumn(
|
||||
url_name='virtualization:virtualmachine_list'
|
||||
@@ -93,12 +103,15 @@ class VirtualMachineTable(TenancyColumnsMixin, ContactsColumnMixin, NetBoxTable)
|
||||
|
||||
class VMInterfaceTable(BaseInterfaceTable):
|
||||
virtual_machine = tables.Column(
|
||||
verbose_name=_('Virtual Machine'),
|
||||
linkify=True
|
||||
)
|
||||
name = tables.Column(
|
||||
verbose_name=_('Name'),
|
||||
linkify=True
|
||||
)
|
||||
vrf = tables.Column(
|
||||
verbose_name=_('VRF'),
|
||||
linkify=True
|
||||
)
|
||||
tags = columns.TagColumn(
|
||||
@@ -116,9 +129,11 @@ class VMInterfaceTable(BaseInterfaceTable):
|
||||
|
||||
class VirtualMachineVMInterfaceTable(VMInterfaceTable):
|
||||
parent = tables.Column(
|
||||
verbose_name=_('Parent'),
|
||||
linkify=True
|
||||
)
|
||||
bridge = tables.Column(
|
||||
verbose_name=_('Bridge'),
|
||||
linkify=True
|
||||
)
|
||||
actions = columns.ActionsColumn(
|
||||
|
||||
Reference in New Issue
Block a user