{% macro progress_bars(items, options) %} {% set _progressSize = options.progressSize ?? '' %} {% set _backgroundColor = options.backgroundColor ?? '' %} {% set _style = options.style ?? '' %} {% set _items = items ?? [] %}
{% for item in _items %} {% set _value = item.current ?? 0 %} {% set _max = item.max ?? 0 %} {% set _min = item.min ?? 0 %} {% set _indeterminate = item.indeterminate ?? (_value == _max and _min == _max) %} {% set percent = _indeterminate or (_max - _min) == 0 ? 0 : ((_value - _min) * 100) / (_max - _min) %} {% set _striped = item.striped ?? false %} {% set _animated = item.animated ?? false %} {% set _autoLabel = item.autoLabel ?? false %} {% set _label = item.label ?? (_autoLabel and not _indeterminate ? percent ~ '%' : '') %} {% set _labelVisible = _label != '' and (item.labelVisible ?? true) %} {% set _color = item.color ?? '' %} {% set _style = item.style ?? '' %}
{{ _label }}
{% endfor %}
{% endmacro %} {% macro progress_bar(item, options) %} {{ _self.progress_bars([item], options ?? {}) }} {% endmacro %}