From 89d9f46750a7506d6910ae792c14ad47feaf53c3 Mon Sep 17 00:00:00 2001 From: Doug Fish Date: Tue, 14 Apr 2015 15:05:41 -0500 Subject: Format numbers in a locale sensitive manner Create Volume, Create Snapshot, Extend Volume and Flavors and Quota all fail to format numbers in a locale sensitive manner. This patch changes the code to use the intcomma filter before quota, instead of after. Once quota has added text the number can no longer be formatted. (Pulled from gate, can't pass checks) Change-Id: Id9749d9b25d93185b917708b85471e6f765033e2 Closes-Bug: 1314801 (cherry picked from commit 0872b4a40334a6df863f88e5aa56b31363aff28e) --- .../project/instances/templates/instances/_flavors_and_quotas.html | 6 +++--- .../project/volumes/templates/volumes/volumes/_extend_limits.html | 2 +- .../project/volumes/templates/volumes/volumes/_limits.html | 4 ++-- .../project/volumes/templates/volumes/volumes/_snapshot_limits.html | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_flavors_and_quotas.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_flavors_and_quotas.html index 8c3416f0d..e14d15933 100644 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_flavors_and_quotas.html +++ b/openstack_dashboard/dashboards/project/instances/templates/instances/_flavors_and_quotas.html @@ -19,21 +19,21 @@

{% trans "Project Limits" %}

{% trans "Number of Instances" %} - {% blocktrans with used=usages.totalInstancesUsed|intcomma quota=usages.maxTotalInstances|quotainf|intcomma %}

{{ used }} of {{ quota }} Used

{% endblocktrans %} + {% blocktrans with used=usages.totalInstancesUsed|intcomma quota=usages.maxTotalInstances|intcomma|quotainf %}

{{ used }} of {{ quota }} Used

{% endblocktrans %}
{% trans "Number of VCPUs" %} - {% blocktrans with used=usages.totalCoresUsed|intcomma quota=usages.maxTotalCores|quotainf|intcomma %}

{{ used }} of {{ quota }} Used

{% endblocktrans %} + {% blocktrans with used=usages.totalCoresUsed|intcomma quota=usages.maxTotalCores|intcomma|quotainf %}

{{ used }} of {{ quota }} Used

{% endblocktrans %}
{% trans "Total RAM" %} - {% blocktrans with used=usages.totalRAMUsed|intcomma quota=usages.maxTotalRAMSize|quotainf|intcomma %}

{{ used }} of {{ quota }} MB Used

{% endblocktrans %} + {% blocktrans with used=usages.totalRAMUsed|intcomma quota=usages.maxTotalRAMSize|intcomma|quotainf %}

{{ used }} of {{ quota }} MB Used

{% endblocktrans %}
diff --git a/openstack_dashboard/dashboards/project/volumes/templates/volumes/volumes/_extend_limits.html b/openstack_dashboard/dashboards/project/volumes/templates/volumes/volumes/_extend_limits.html index 6ec6a03ea..815ceeba8 100644 --- a/openstack_dashboard/dashboards/project/volumes/templates/volumes/volumes/_extend_limits.html +++ b/openstack_dashboard/dashboards/project/volumes/templates/volumes/volumes/_extend_limits.html @@ -8,7 +8,7 @@
{% trans "Total Gigabytes" %} ({{ usages.gigabytesUsed|intcomma }} {% trans "GB" %}) -

{{ usages.maxTotalVolumeGigabytes|quota:_("GB")|intcomma }}

+

{{ usages.maxTotalVolumeGigabytes|intcomma|quota:_("GB") }}

diff --git a/openstack_dashboard/dashboards/project/volumes/templates/volumes/volumes/_limits.html b/openstack_dashboard/dashboards/project/volumes/templates/volumes/volumes/_limits.html index 7df18735e..27ad12306 100644 --- a/openstack_dashboard/dashboards/project/volumes/templates/volumes/volumes/_limits.html +++ b/openstack_dashboard/dashboards/project/volumes/templates/volumes/volumes/_limits.html @@ -8,7 +8,7 @@
{% trans "Total Gigabytes" %} ({% block gigabytes_used %}{{ usages.gigabytesUsed|intcomma }}{% endblock %} {% trans "GB" %}) -

{{ usages.maxTotalVolumeGigabytes|quota:_("GB")|intcomma }}

+

{{ usages.maxTotalVolumeGigabytes|intcomma|quota:_("GB") }}

@@ -16,7 +16,7 @@
{% block type_title %}{% trans "Number of Volumes" %}{% endblock %} ({% block used %}{{ usages.volumesUsed|intcomma }}{% endblock %}) -

{% block total %}{{ usages.maxTotalVolumes|quota|intcomma }}{% endblock %}

+

{% block total %}{{ usages.maxTotalVolumes|intcomma|quota }}{% endblock %}

diff --git a/openstack_dashboard/dashboards/project/volumes/templates/volumes/volumes/_snapshot_limits.html b/openstack_dashboard/dashboards/project/volumes/templates/volumes/volumes/_snapshot_limits.html index cc8e14f67..1f3c5323f 100644 --- a/openstack_dashboard/dashboards/project/volumes/templates/volumes/volumes/_snapshot_limits.html +++ b/openstack_dashboard/dashboards/project/volumes/templates/volumes/volumes/_snapshot_limits.html @@ -26,7 +26,7 @@ {% endblock %} {% block total %} - {{ usages.maxTotalSnapshots|quota|intcomma }} + {{ usages.maxTotalSnapshots|intcomma|quota }} {% endblock %} {% block type_id %} -- cgit v1.2.1