Skip to content

Commit

Permalink
Merge pull request #116 from RaymondXu/2percentbug
Browse files Browse the repository at this point in the history
Make progress bar empty for <= 2%. (Fixes relative widths bug)
  • Loading branch information
raymondxu committed Feb 28, 2015
2 parents 74d498e + 615f656 commit 9dc70cb
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions density/templates/capacity.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,21 @@
{% for location in locations %}
<li class="list-group-item"><h4>{{ location['name'] }}</h4>
<div class="progress">
<div class="progress-bar progress-bar-info progress-bar-striped active"
role="progressbar" aria-valuenow="{{location['fullness']}}"
aria-valuemin="0" aria-valuemax="100"
style="width: {{location['fullness']}}%;">
{{ location['fullness'] }}%
</div>
{% if location['fullness'] <= 2 %}
<div class="progress-bar progress-bar-info progress-bar-striped active"
role="progressbar" aria-valuenow="0"
aria-valuemin="0" aria-valuemax="100"
style="width: 0;">
{{ location['fullness'] }}%
</div>
{% else %}
<div class="progress-bar progress-bar-info progress-bar-striped active"
role="progressbar" aria-valuenow="{{location['fullness']}}"
aria-valuemin="0" aria-valuemax="100"
style="width: {{location['fullness']}}%;">
{{ location['fullness'] }}%
</div>
{% endif %}
</div>
</li>
{% endfor %}
Expand Down

0 comments on commit 9dc70cb

Please sign in to comment.