{% load i18n horizon humanize sizeformat %}

{% spaceless %}
  <div class="quota-dynamic limit-summary">
    <h3 class="quota-heading">{% trans "Limit Summary" %}</h3>
     {% for quota in charts %}
       {% if forloop.first or forloop.counter0|divisibleby:6 %}
         <div class="row">
       {% endif %}
        <div class="d3_quota_bar col-lg-2 col-md-4 col-sm-4 col-xs-6">
          <div class="pie-chart-usage" data-used="{% quotapercent quota.used quota.max %}"></div>
          <div class="quota_title" title="{{ quota.name }}" data-toggle="tooltip"> {{ quota.name }}</div>
          <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>
                {% 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)
              {% endblocktrans %}
            {% endif %}
          </div>
        </div>
       {% if forloop.last or forloop.counter|divisibleby:6 %}
         {% if not forloop.first %}
           </div>
         {% endif %}
       {% endif %}
     {% endfor %}
  </div>
{% endspaceless %}
