summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-11-23 03:00:33 +0000
committerGerrit Code Review <review@openstack.org>2014-11-23 03:00:33 +0000
commitd9f336b7fc5fcbd9d9925e953cbe539f63299bf7 (patch)
treea262090194d2825bcad793737025ab17f0067010
parentf6bc82ace9151b181e23f94506e13ccdf3bec70a (diff)
parentd546fafd9440cc561f8fef6711b64ee807806ed0 (diff)
downloadhorizon-d9f336b7fc5fcbd9d9925e953cbe539f63299bf7.tar.gz
Merge "Make status in instance details screen translatable" into stable/juno
-rw-r--r--openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html2
-rw-r--r--openstack_dashboard/dashboards/project/instances/views.py8
2 files changed, 9 insertions, 1 deletions
diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html
index ff01beffd..83205c7a0 100644
--- a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html
+++ b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html
@@ -12,7 +12,7 @@
<dt>{% trans "ID" %}</dt>
<dd>{{ instance.id }}</dd>
<dt>{% trans "Status" %}</dt>
- <dd>{{ instance.status|title }}</dd>
+ <dd>{{ instance.status_label|title }}</dd>
<dt>{% trans "Availability Zone" %}</dt>
<dd>{{ instance.availability_zone|default:"-" }}</dd>
<dt>{% trans "Created" %}</dt>
diff --git a/openstack_dashboard/dashboards/project/instances/views.py b/openstack_dashboard/dashboards/project/instances/views.py
index 954e2e1d5..7d67a5d81 100644
--- a/openstack_dashboard/dashboards/project/instances/views.py
+++ b/openstack_dashboard/dashboards/project/instances/views.py
@@ -261,6 +261,14 @@ class DetailView(tabs.TabView):
try:
instance_id = self.kwargs['instance_id']
instance = api.nova.server_get(self.request, instance_id)
+ status_label = [label for (value, label) in
+ project_tables.STATUS_DISPLAY_CHOICES
+ if value.lower() ==
+ (instance.status or '').lower()]
+ if status_label:
+ instance.status_label = status_label[0]
+ else:
+ instance.status_label = instance.status
instance.volumes = api.nova.instance_volumes_list(self.request,
instance_id)
# Sort by device name