Add units in overview project page (limit summary)

Since liberty, there is no unit in the overview project page. Trying to
fix it.

Closes-bug: #1589523

Change-Id: I82710d7157b0b8b3cc8128283cd0bfa2f075db71
This commit is contained in:
Pierre-Alexandre Bardina 2016-06-07 16:47:33 +02:00 committed by Yves-Gwenael Bourhis
parent 5424cf2932
commit 4570413773
2 changed files with 14 additions and 3 deletions

View File

@ -12,9 +12,19 @@
<div class="quota_title" title="{{ quota.name }}" data-toggle="tooltip"> {{ quota.name }}</div>
<div class="quota_subtitle">
{% if quota.max|quotainf != '-1' %}
{% blocktrans trimmed with used=quota.used|intcomma available=quota.max|quotainf|intcomma %}
Used <span> {{ used }} </span>of<span> {{ available }} </span>
{% endblocktrans %}
{% 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>
{% 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>
{% endblocktrans %}
{% else %}
{% blocktrans trimmed with used=quota.used|intcomma available=quota.max|quotainf|intcomma %}
Used <span> {{ used }} </span>of<span> {{ available }} </span>
{% endblocktrans %}
{% endif %}
{% else %}
{% blocktrans trimmed with used=quota.used|intcomma %}
Used <span> {{ used }} </span>(No Limit)

View File

@ -84,6 +84,7 @@ class UsageView(tables.DataTableView):
if len(t) > 3:
text = t[3]
context['charts'].append({
'type': t[0],
'name': t[2],
'used': self.usage.limits[t[0]],
'max': self.usage.limits[t[1]],