{# Progress bar widget template #}
{% macro render_progress(widget) %}

    <div id="{{ widget.widget_id }}">
        {% if widget.title %}
            <div class="mb-2">
                <label class="form-label fw-bold">{{ widget.title }}</label>
            </div>
        {% endif %}

        <div class="progress" {% if widget.height %}style="height: {{ widget.height }};"{% endif %}>
            <div class="{{ widget.css_classes }}"
                 role="progressbar"
                 style="width: {{ widget.percentage }}%;"
                 aria-valuenow="{{ widget.value }}"
                 aria-valuemin="{{ widget.min_value }}"
                 aria-valuemax="{{ widget.max_value }}">
                {% if widget.display_text %}
                    {{ widget.display_text }}
                {% endif %}
            </div>
        </div>

        {% if widget.label %}
            <div class="mt-2">
                <small class="text-muted">{{ widget.label }}</small>
            </div>
        {% endif %}
    </div>
{% endmacro %}
