From 564d912e697da0679d1ad96d344f59389616d6c2 Mon Sep 17 00:00:00 2001 From: jingliuqing Date: Sat, 27 Jun 2015 13:09:44 +0800 Subject: [PATCH] Refactor the admin tabs code Partial-Bug: #1475119 Change-Id: I3329a09fee2b472ac50bd409e3c5613926d1e39f --- .../dashboards/admin/info/tabs.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openstack_dashboard/dashboards/admin/info/tabs.py b/openstack_dashboard/dashboards/admin/info/tabs.py index d5058d6f96..c7af41f6b5 100644 --- a/openstack_dashboard/dashboards/admin/info/tabs.py +++ b/openstack_dashboard/dashboards/admin/info/tabs.py @@ -28,8 +28,8 @@ from openstack_dashboard.dashboards.admin.info import tables class ServicesTab(tabs.TableTab): table_classes = (tables.ServicesTable,) - name = _("Services") - slug = "services" + name = tables.ServicesTable.Meta.verbose_name + slug = tables.ServicesTable.Meta.name template_name = constants.INFO_DETAIL_TEMPLATE_NAME def get_services_data(self): @@ -44,8 +44,8 @@ class ServicesTab(tabs.TableTab): class NovaServicesTab(tabs.TableTab): table_classes = (tables.NovaServicesTable,) - name = _("Compute Services") - slug = "nova_services" + name = tables.NovaServicesTable.Meta.verbose_name + slug = tables.NovaServicesTable.Meta.name template_name = constants.INFO_DETAIL_TEMPLATE_NAME permissions = ('openstack.services.compute',) @@ -62,8 +62,8 @@ class NovaServicesTab(tabs.TableTab): class CinderServicesTab(tabs.TableTab): table_classes = (tables.CinderServicesTable,) - name = _("Block Storage Services") - slug = "cinder_services" + name = tables.CinderServicesTable.Meta.verbose_name + slug = tables.CinderServicesTable.Meta.name template_name = constants.INFO_DETAIL_TEMPLATE_NAME permissions = ('openstack.services.volume',) @@ -80,8 +80,8 @@ class CinderServicesTab(tabs.TableTab): class NetworkAgentsTab(tabs.TableTab): table_classes = (tables.NetworkAgentsTable,) - name = _("Network Agents") - slug = "network_agents" + name = tables.NetworkAgentsTable.Meta.verbose_name + slug = tables.NetworkAgentsTable.Meta.name template_name = constants.INFO_DETAIL_TEMPLATE_NAME def allowed(self, request):