Merge "Make values for IPSec&VPN status be translatable"
This commit is contained in:
commit
6a11ec386c
@ -14,11 +14,11 @@
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.template.defaultfilters import title # noqa
|
||||
from django.utils.translation import pgettext_lazy
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
||||
from horizon import tables
|
||||
from horizon.utils import filters
|
||||
|
||||
|
||||
forbid_updates = set(["PENDING_CREATE", "PENDING_UPDATE", "PENDING_DELETE"])
|
||||
@ -226,6 +226,14 @@ class IPSecSiteConnectionsTable(tables.DataTable):
|
||||
("Down", True),
|
||||
("Error", False),
|
||||
)
|
||||
STATUS_DISPLAY_CHOICES = (
|
||||
("Active", pgettext_lazy("Current status of an IPSec Site Connection",
|
||||
u"Active")),
|
||||
("Down", pgettext_lazy("Current status of an IPSec Site Connection",
|
||||
u"Down")),
|
||||
("Error", pgettext_lazy("Current status of an IPSec Site Connection",
|
||||
u"Error")),
|
||||
)
|
||||
id = tables.Column('id', hidden=True)
|
||||
name = tables.Column('name_or_id', verbose_name=_('Name'),
|
||||
link="horizon:project:vpn:ipsecsiteconnectiondetails")
|
||||
@ -236,10 +244,10 @@ class IPSecSiteConnectionsTable(tables.DataTable):
|
||||
ipsecpolicy_name = tables.Column('ipsecpolicy_name',
|
||||
verbose_name=_('IPSec Policy'))
|
||||
status = tables.Column("status",
|
||||
filters=(title, filters.replace_underscores),
|
||||
verbose_name=_("Status"),
|
||||
status=True,
|
||||
status_choices=STATUS_CHOICES)
|
||||
status_choices=STATUS_CHOICES,
|
||||
display_choices=STATUS_DISPLAY_CHOICES)
|
||||
|
||||
class Meta(object):
|
||||
name = "ipsecsiteconnectionstable"
|
||||
@ -256,6 +264,24 @@ class VPNServicesTable(tables.DataTable):
|
||||
("Down", True),
|
||||
("Error", False),
|
||||
)
|
||||
STATUS_DISPLAY_CHOICES = (
|
||||
("Active", pgettext_lazy("Current status of a VPN Service",
|
||||
u"Active")),
|
||||
("Down", pgettext_lazy("Current status of a VPN Service",
|
||||
u"Down")),
|
||||
("Error", pgettext_lazy("Current status of a VPN Service",
|
||||
u"Error")),
|
||||
("Created", pgettext_lazy("Current status of a VPN Service",
|
||||
u"Created")),
|
||||
("Pending_Create", pgettext_lazy("Current status of a VPN Service",
|
||||
u"Pending Create")),
|
||||
("Pending_Update", pgettext_lazy("Current status of a VPN Service",
|
||||
u"Pending Update")),
|
||||
("Pending_Delete", pgettext_lazy("Current status of a VPN Service",
|
||||
u"Pending Delete")),
|
||||
("Inactive", pgettext_lazy("Current status of a VPN Service",
|
||||
u"Inactive")),
|
||||
)
|
||||
id = tables.Column('id', hidden=True)
|
||||
name = tables.Column("name_or_id", verbose_name=_('Name'),
|
||||
link="horizon:project:vpn:vpnservicedetails")
|
||||
@ -263,10 +289,10 @@ class VPNServicesTable(tables.DataTable):
|
||||
subnet_name = tables.Column('subnet_name', verbose_name=_('Subnet'))
|
||||
router_name = tables.Column('router_name', verbose_name=_('Router'))
|
||||
status = tables.Column("status",
|
||||
filters=(title, filters.replace_underscores),
|
||||
verbose_name=_("Status"),
|
||||
status=True,
|
||||
status_choices=STATUS_CHOICES)
|
||||
status_choices=STATUS_CHOICES,
|
||||
display_choices=STATUS_DISPLAY_CHOICES)
|
||||
|
||||
class Meta(object):
|
||||
name = "vpnservicestable"
|
||||
|
Loading…
x
Reference in New Issue
Block a user