Use specified phrases in lieu of 'Used' for limit summary
Some resources, namely floating IPs, are limited based on those allocated, rather than in actual use. The "Allocated" string is present in the code but not used in the template. This effectively changes "Used X of Y" to "Allocated X of Y" for floating IPs. Change-Id: I7919b883a47d66b1e870862363d07e0f90bdbe7b Closes-Bug: #1708733
This commit is contained in:
parent
d5900c33c2
commit
edbf88fa79
@ -13,21 +13,21 @@
|
|||||||
<div class="quota_subtitle">
|
<div class="quota_subtitle">
|
||||||
{% if quota.max|quotainf != '-1' %}
|
{% if quota.max|quotainf != '-1' %}
|
||||||
{% if quota.type == "totalRAMUsed" %}
|
{% if quota.type == "totalRAMUsed" %}
|
||||||
{% blocktrans trimmed with used=quota.used|mb_float_format available=quota.max|quotainf|mb_float_format %}
|
{% blocktrans trimmed with usedphrase=quota.text used=quota.used|mb_float_format available=quota.max|quotainf|mb_float_format %}
|
||||||
Used <span> {{ used }} </span>of<span> {{ available }} </span>
|
{{ usedphrase }} <span> {{ used }} </span>of<span> {{ available }} </span>
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
{% elif quota.type == "totalGigabytesUsed" %}
|
{% elif quota.type == "totalGigabytesUsed" %}
|
||||||
{% blocktrans trimmed with used=quota.used|diskgbformat available=quota.max|quotainf|diskgbformat %}
|
{% blocktrans trimmed with usedphrase=quota.text used=quota.used|diskgbformat available=quota.max|quotainf|diskgbformat %}
|
||||||
Used <span> {{ used }} </span>of<span> {{ available }} </span>
|
{{ usedphrase }} <span> {{ used }} </span>of<span> {{ available }} </span>
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% blocktrans trimmed with used=quota.used|intcomma available=quota.max|quotainf|intcomma %}
|
{% blocktrans trimmed with usedphrase=quota.text used=quota.used|intcomma available=quota.max|quotainf|intcomma %}
|
||||||
Used <span> {{ used }} </span>of<span> {{ available }} </span>
|
{{ usedphrase }} <span> {{ used }} </span>of<span> {{ available }} </span>
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% blocktrans trimmed with used=quota.used|intcomma %}
|
{% blocktrans trimmed with usedphrase=quota.text used=quota.used|intcomma %}
|
||||||
Used <span> {{ used }} </span>(No Limit)
|
{{ usedphrase }} <span> {{ used }} </span>(No Limit)
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from django.utils.translation import pgettext_lazy
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
@ -68,7 +69,8 @@ class UsageView(tables.DataTableView):
|
|||||||
("totalCoresUsed", "maxTotalCores", _("VCPUs")),
|
("totalCoresUsed", "maxTotalCores", _("VCPUs")),
|
||||||
("totalRAMUsed", "maxTotalRAMSize", _("RAM")),
|
("totalRAMUsed", "maxTotalRAMSize", _("RAM")),
|
||||||
("totalFloatingIpsUsed", "maxTotalFloatingIps",
|
("totalFloatingIpsUsed", "maxTotalFloatingIps",
|
||||||
_("Floating IPs"), _("Allocated")),
|
_("Floating IPs"),
|
||||||
|
pgettext_lazy('Label in the limit summary', "Allocated")),
|
||||||
("totalSecurityGroupsUsed", "maxSecurityGroups",
|
("totalSecurityGroupsUsed", "maxSecurityGroups",
|
||||||
_("Security Groups"))]
|
_("Security Groups"))]
|
||||||
# Check for volume usage
|
# Check for volume usage
|
||||||
@ -80,7 +82,7 @@ class UsageView(tables.DataTableView):
|
|||||||
_("Volume Storage")))
|
_("Volume Storage")))
|
||||||
for t in types:
|
for t in types:
|
||||||
if t[0] in self.usage.limits and t[1] in self.usage.limits:
|
if t[0] in self.usage.limits and t[1] in self.usage.limits:
|
||||||
text = False
|
text = pgettext_lazy('Label in the limit summary', 'Used')
|
||||||
if len(t) > 3:
|
if len(t) > 3:
|
||||||
text = t[3]
|
text = t[3]
|
||||||
context['charts'].append({
|
context['charts'].append({
|
||||||
|
Loading…
Reference in New Issue
Block a user