{% macro render_field(field, label_class="", input_class="", help_text="") %}
{% if field.label %} {{ field.label(class=label_class + " form-label") }} {% endif %} {% if field.type == 'FileField' or field.type == 'MultipleFileField' %} {{ field(class=input_class + " form-control") }} {% elif field.type == 'SelectField' %} {{ field(class=input_class + " form-select") }} {% elif field.type == 'TextAreaField' %} {{ field(class=input_class + " form-control", rows=field.render_kw.get('rows', 3)) }} {% elif field.type == 'BooleanField' %}
{{ field(class="form-check-input") }} {{ field.label(class="form-check-label") }}
{% elif field.type == 'HiddenField' %} {{ field() }} {% else %} {{ field(class=input_class + " form-control") }} {% endif %} {% if help_text %}
{{ help_text }}
{% endif %} {% if field.render_kw and field.render_kw.get('help') %}
{{ field.render_kw.help }}
{% endif %} {% for error in field.errors %}
{{ error }}
{% endfor %}
{% endmacro %} {% macro render_pagination(pagination, endpoint) %} {% if pagination.pages > 1 %} {% endif %} {% endmacro %} {% macro render_job_status_badge(status) %} {% if status == 'done' %} Completed {% elif status == 'running' %} Running {% elif status == 'error' %} Failed {% elif status == 'queued' %} Queued {% else %} {{ status|title }} {% endif %} {% endmacro %} {% macro render_file_size(size_bytes) %} {% if size_bytes %} {% set size = size_bytes %} {% if size < 1024 %} {{ "%.0f"|format(size) }} B {% elif size < 1024 * 1024 %} {{ "%.1f"|format(size / 1024) }} KB {% elif size < 1024 * 1024 * 1024 %} {{ "%.1f"|format(size / (1024 * 1024)) }} MB {% else %} {{ "%.1f"|format(size / (1024 * 1024 * 1024)) }} GB {% endif %} {% else %} Unknown {% endif %} {% endmacro %} {% macro render_job_type_icon(job_type) %} {% if job_type == 'docgen' %} {% elif job_type == 'merge' %} {% elif job_type == 'compress' %} {% else %} {% endif %} {% endmacro %} {% macro render_empty_state(title, description, icon="bi-inbox", action_text="", action_url="") %}

{{ title }}

{{ description }}

{% if action_text and action_url %} {{ action_text }} {% endif %}
{% endmacro %} {% macro render_card_header(title, subtitle="", actions="") %}
{{ title }}
{% if subtitle %} {{ subtitle }} {% endif %}
{% if actions %}
{{ actions }}
{% endif %}
{% endmacro %} {% macro render_progress_bar(percentage, label="", variant="primary") %}
{% if label %} {{ label }} {% endif %} {% endmacro %} {% macro render_stat_card(title, value, icon, color="primary", subtitle="") %}

{{ value }}

{{ title }}

{% if subtitle %} {{ subtitle }} {% endif %}
{% endmacro %} {% macro render_breadcrumb(items) %} {% endmacro %} {% macro render_loading_spinner(text="Loading...") %}
Loading...
{{ text }}
{% endmacro %} {% macro render_confirmation_modal(id, title, body, confirm_text="Confirm", cancel_text="Cancel", confirm_class="btn-danger") %} {% endmacro %}