From 3a83a27afd18b4539c523b3da66b203e2cef60ab Mon Sep 17 00:00:00 2001 From: Mateusz Kowalski Date: Tue, 19 Sep 2017 11:44:01 +0200 Subject: [PATCH] Fix quota bars in Create Share panel Make quota bars render in the same way as in horizon-base, so they are shown correctly and their style is consistent with the one used when creating new volume. Change-Id: I96e52f91c56e907ee15a3dbdb296f3b1f978e558 Closes-Bug: #1718160 --- .../shares/templates/shares/_limits.html | 51 ++++++++++++++----- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/manila_ui/dashboards/project/shares/templates/shares/_limits.html b/manila_ui/dashboards/project/shares/templates/shares/_limits.html index 5fdd6b4c..46029ce9 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/_limits.html +++ b/manila_ui/dashboards/project/shares/templates/shares/_limits.html @@ -1,4 +1,4 @@ -{% load i18n horizon humanize %} +{% load i18n horizon humanize bootstrap %}

{% trans "Description" %}:

@@ -13,22 +13,49 @@

{% trans "Share Limits" %}

-
- {% trans "Total Gibibytes" %} ({{ usages.totalGigabytesUsed|intcomma }} {% trans "GiB" %}) -

{{ usages.maxTotalShareGigabytes|quota:_("GiB")|intcomma }}

+
+
+ {% trans "Total Gibibytes" %} +
+ + {% blocktrans with used=usages.totalShareGigabytesUsed|intcomma quota=usages.maxTotalShareGigabytes|intcomma|quotainf %}{{ used }} of {{ quota }} GiB Used{% endblocktrans %} +
-
+{{ minifyspace }} +
+ {% widthratio usages.totalShareGigabytesUsed usages.maxTotalShareGigabytes 100 as gigabytes_percent %} + {% bs_progress_bar gigabytes_percent 0 %} +
+{{ endminifyspace }} + +
+
+ {% block type_title %}{% trans "Number of Shares" %}{% endblock %} +
+ + {% block used_of_quota %} + {% blocktrans with used=usages.totalSharesUsed|intcomma quota=usages.maxTotalShares|intcomma|quotainf %}{{ used }} of {{ quota }} Used{% endblocktrans %} + {% endblock %} +
-
- {% trans "Number of Shares" %} ({{ usages.totalSharesUsed|intcomma }}) -

{{ usages.maxTotalShares|quota|intcomma }}

+{{ minifyspace }} +
+ {% block show_progress_bar %} + {% widthratio usages.totalSharesUsed usages.maxTotalShares 100 as shares_percent %} + {% widthratio 100 usages.maxTotalShares 1 as single_step %} + {% bs_progress_bar shares_percent single_step %} + {% endblock %}
- -
-
- +{{ endminifyspace }}