added hourly and money budgets to activity, project and customer (#843)
This commit is contained in:
28
templates/macros/progressbar.html.twig
Normal file
28
templates/macros/progressbar.html.twig
Normal file
@@ -0,0 +1,28 @@
|
||||
{% macro progressbar(max, current, title, subTitle) %}
|
||||
{% set percentReached = (current / (max / 100)) %}
|
||||
{% set class = "progress-bar-info" %}
|
||||
{% set width = percentReached|number_format(1, '.', '') %}
|
||||
|
||||
{% if percentReached > 90 %}
|
||||
{% set class = "progress-bar-danger" %}
|
||||
{% elseif percentReached > 70 %}
|
||||
{% set class = "progress-bar-warning" %}
|
||||
{% elseif percentReached > 50 %}
|
||||
{% set class = "progress-bar-success" %}
|
||||
{% elseif percentReached > 30 %}
|
||||
{% set class = "progress-bar-primary" %}
|
||||
{% endif %}
|
||||
|
||||
{% if width > 100 %}
|
||||
{% set width = 100 %}
|
||||
{% endif %}
|
||||
|
||||
<div class="progress-group">
|
||||
<span class="progress-text">{{ title }} – {{ percentReached|number_format(2) }}%</span>
|
||||
<span class="progress-number">{{ subTitle }}</span>
|
||||
|
||||
<div class="progress">
|
||||
<div class="progress-bar {{ class }}" role="progressbar" aria-valuenow="{{ width }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ width }}%"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
Reference in New Issue
Block a user