From d6217b3e6300e4d117515317beabe5462ff15bc6 Mon Sep 17 00:00:00 2001 From: manchandavishal Date: Tue, 18 Dec 2018 09:05:24 +0000 Subject: [PATCH] Instances column is shortened so it fits properly The 'Time since created' column name has been shortened to 'Age' in project instances and admin instances meaning it fits properly in table header cell and doesn't cause table header height to increase. Closes-Bug: #1614287 Change-Id: I94fc9eb260050e187445abd8236ac414b885b467 Co-Authored-By: Sam Wright --- openstack_dashboard/dashboards/admin/instances/tables.py | 2 +- openstack_dashboard/dashboards/identity/projects/tests.py | 2 +- openstack_dashboard/dashboards/project/instances/tables.py | 2 +- .../project/instances/templates/instances/_detail_overview.html | 2 +- openstack_dashboard/dashboards/project/overview/views.py | 2 +- openstack_dashboard/usage/tables.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openstack_dashboard/dashboards/admin/instances/tables.py b/openstack_dashboard/dashboards/admin/instances/tables.py index 95053f6ec6..5844e3c264 100644 --- a/openstack_dashboard/dashboards/admin/instances/tables.py +++ b/openstack_dashboard/dashboards/admin/instances/tables.py @@ -182,7 +182,7 @@ class AdminInstancesTable(tables.DataTable): verbose_name=_("Power State"), display_choices=project_tables.POWER_DISPLAY_CHOICES) created = tables.Column("created", - verbose_name=_("Time since created"), + verbose_name=_("Age"), filters=(filters.parse_isotime, filters.timesince_sortable), attrs={'data-type': 'timesince'}) diff --git a/openstack_dashboard/dashboards/identity/projects/tests.py b/openstack_dashboard/dashboards/identity/projects/tests.py index 52a37644a3..815e5adb45 100644 --- a/openstack_dashboard/dashboards/identity/projects/tests.py +++ b/openstack_dashboard/dashboards/identity/projects/tests.py @@ -1270,7 +1270,7 @@ class UsageViewTests(test.BaseAdminViewTests): self.assertIsInstance(res.context['usage'], usage.ProjectUsage) hdr = ('Instance Name,VCPUs,RAM (MB),Disk (GB),Usage (Hours),' - 'Time since created (Seconds),State') + 'Age (Seconds),State') self.assertContains(res, '%s\r\n' % hdr) self.assert_mock_multiple_calls_with_same_arguments( diff --git a/openstack_dashboard/dashboards/project/instances/tables.py b/openstack_dashboard/dashboards/project/instances/tables.py index 342b7f9ca5..0bfebd2776 100644 --- a/openstack_dashboard/dashboards/project/instances/tables.py +++ b/openstack_dashboard/dashboards/project/instances/tables.py @@ -1280,7 +1280,7 @@ class InstancesTable(tables.DataTable): verbose_name=_("Power State"), display_choices=POWER_DISPLAY_CHOICES) created = tables.Column("created", - verbose_name=_("Time since created"), + verbose_name=_("Age"), filters=(filters.parse_isotime, filters.timesince_sortable), attrs={'data-type': 'timesince'}) 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 ab336a8ba3..f607d53994 100644 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html +++ b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html @@ -18,7 +18,7 @@
{{ instance.availability_zone|default:_("-") }}
{% trans "Created" %}
{{ instance.created|parse_isotime }}
-
{% trans "Time Since Created" %}
+
{% trans "Age" %}
{{ instance.created|parse_isotime|timesince }}
{% if instance.host_server %}
{% trans "Host" %}
diff --git a/openstack_dashboard/dashboards/project/overview/views.py b/openstack_dashboard/dashboards/project/overview/views.py index 1ab45af6d1..ec2eb3a6e5 100644 --- a/openstack_dashboard/dashboards/project/overview/views.py +++ b/openstack_dashboard/dashboards/project/overview/views.py @@ -36,7 +36,7 @@ class ProjectUsageCsvRenderer(csvbase.BaseCsvResponse): columns = [_("Instance Name"), _("VCPUs"), _("RAM (MB)"), _("Disk (GB)"), _("Usage (Hours)"), - _("Time since created (Seconds)"), _("State")] + _("Age (Seconds)"), _("State")] def get_row_data(self): diff --git a/openstack_dashboard/usage/tables.py b/openstack_dashboard/usage/tables.py index e47eefb76f..04007f1b09 100644 --- a/openstack_dashboard/usage/tables.py +++ b/openstack_dashboard/usage/tables.py @@ -83,7 +83,7 @@ class ProjectUsageTable(BaseUsageTable): verbose_name=_("Instance Name"), link=get_instance_link) uptime = tables.Column('uptime_at', - verbose_name=_("Time since created"), + verbose_name=_("Age"), filters=(filters.timesince_sortable,), attrs={'data-type': 'timesince'})