Created
August 4, 2017 17:38
-
-
Save nicktimko/bb99ffffae1295f1707ac617fcebb658 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit e951eec402172028c7dfa4354f5664af2eb73203 | |
Author: Nick Timkovich <[email protected]> | |
Date: Fri Aug 4 12:33:29 2017 -0500 | |
Use specified phrases in lieu of 'Used' for limit summary | |
diff --git a/horizon/templates/horizon/common/_limit_summary.html b/horizon/templates/horizon/common/_limit_summary.html | |
index b58ba8b4c..251d98b6b 100644 | |
--- a/horizon/templates/horizon/common/_limit_summary.html | |
+++ b/horizon/templates/horizon/common/_limit_summary.html | |
@@ -13,21 +13,21 @@ | |
<div class="quota_subtitle"> | |
{% if quota.max|quotainf != '-1' %} | |
{% if quota.type == "totalRAMUsed" %} | |
- {% blocktrans trimmed with used=quota.used|mb_float_format available=quota.max|quotainf|mb_float_format %} | |
- Used <span> {{ used }} </span>of<span> {{ available }} </span> | |
+ {% blocktrans trimmed with usedphrase=quota.usedphrase|default:"Used" used=quota.used|mb_float_format available=quota.max|quotainf|mb_float_format %} | |
+ {{ usedphrase }} <span> {{ used }} </span>of<span> {{ available }} </span> | |
{% endblocktrans %} | |
{% elif quota.type == "totalGigabytesUsed" %} | |
- {% blocktrans trimmed with used=quota.used|diskgbformat available=quota.max|quotainf|diskgbformat %} | |
- Used <span> {{ used }} </span>of<span> {{ available }} </span> | |
+ {% blocktrans trimmed with usedphrase=quota.usedphrase|default:"Used" used=quota.used|diskgbformat available=quota.max|quotainf|diskgbformat %} | |
+ {{ usedphrase }} <span> {{ used }} </span>of<span> {{ available }} </span> | |
{% endblocktrans %} | |
{% else %} | |
- {% blocktrans trimmed with used=quota.used|intcomma available=quota.max|quotainf|intcomma %} | |
- Used <span> {{ used }} </span>of<span> {{ available }} </span> | |
+ {% blocktrans trimmed with usedphrase=quota.usedphrase|default:"Used" used=quota.used|intcomma available=quota.max|quotainf|intcomma %} | |
+ {{ usedphrase }} <span> {{ used }} </span>of<span> {{ available }} </span> | |
{% endblocktrans %} | |
{% endif %} | |
{% else %} | |
- {% blocktrans trimmed with used=quota.used|intcomma %} | |
- Used <span> {{ used }} </span>(No Limit) | |
+ {% blocktrans trimmed with usedphrase=quota.usedphrase|default:"Used" used=quota.used|intcomma %} | |
+ {{ usedphrase }} <span> {{ used }} </span>(No Limit) | |
{% endblocktrans %} | |
{% endif %} | |
</div> | |
diff --git a/openstack_dashboard/usage/views.py b/openstack_dashboard/usage/views.py | |
index 745aebf91..df43fb6f2 100644 | |
--- a/openstack_dashboard/usage/views.py | |
+++ b/openstack_dashboard/usage/views.py | |
@@ -80,15 +80,15 @@ class UsageView(tables.DataTableView): | |
_("Volume Storage"))) | |
for t in types: | |
if t[0] in self.usage.limits and t[1] in self.usage.limits: | |
- text = False | |
+ usedphrase = False | |
if len(t) > 3: | |
- text = t[3] | |
+ usedphrase = t[3] | |
context['charts'].append({ | |
'type': t[0], | |
'name': t[2], | |
'used': self.usage.limits[t[0]], | |
'max': self.usage.limits[t[1]], | |
- 'text': text | |
+ 'usedphrase': usedphrase | |
}) | |
try: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment