{# Common macros for oil trading reports #} {# Navigation table macro #} {% macro nav_table(links) %} {% for text, url in links %} {% endfor %}
{{ text }}
{% endmacro %} {# Bootstrap nav pills macro #} {% macro nav_pills(links, current_page=None) %}
{% endmacro %} {# Chart grid macro for responsive layouts #} {% macro chart_grid(charts, cols=3) %}
{% for chart in charts %}

{{ chart|safe }}

{% if loop.index % cols == 0 and not loop.last %}
{% endif %} {% endfor %}
{% endmacro %} {# Data table with formatting #} {% macro data_table(df, title=None, css_class="table table-striped") %} {% if title %}

{{ title }}

{% endif %}
{{ df.to_html(classes=css_class, index=True)|safe }}
{% endmacro %} {# Alert/warning box #} {% macro alert_box(message, type="info") %} {% endmacro %} {# Collapsible section #} {% macro collapsible(title, content, id, expanded=False) %}

{{ content|safe }}
{% endmacro %} {# Report metadata display #} {% macro report_metadata(data) %}
{% if data.author %}Author: {{ data.author }} | {% endif %} {% if data.version %}Version: {{ data.version }} | {% endif %} {% if data.environment %}Environment: {{ data.environment }} | {% endif %} {% if data.run_time %}Run time: {{ data.run_time }}s{% endif %}
{% endmacro %}