{% extends "layouts/base.html" %} {% block title %}{{ title }}{% endblock %} {################################ HTML CONTENT ################################} {% macro make_table(data, attrs, headers, title='') -%}

{{ title }}

{% if headers %} {% for h in headers %} {% endfor %} {% for h in headers %} {% endfor %} {% endif %} {% for fields in data %} {% set field = loop %} {%- for f in fields -%} {% if attrs and (field.index-1, loop.index-1) in attrs.get('green', []) -%} {%- endfor %} {% endfor %}
{{ h }}
{{ h }}
{% elif attrs and (field.index-1, loop.index-1) in attrs.get('red', []) %} {% elif attrs and (field.index-1, loop.index-1) in attrs.get('orange', []) %} {% elif attrs and (field.index-1, loop.index-1) in attrs.get('blue', []) %} {% else %} {%- endif -%} {%- if attrs and (field.index-1, loop.index-1) in attrs.get('bold', []) -%} {{ f }} {%- elif attrs and (field.index-1, loop.index-1) in attrs.get('datetime', []) -%} {{ f | datetime }} {%- else -%} {{ f }} {%- endif -%}
{%- endmacro %} {% block content %} {{ make_table(data, attrs, headers, title) }} {% if data2 %} {{ make_table(data2, attrs2, headers2, title2) }} {% endif %} {% endblock %} {################################# JAVASCRIPT #################################} {% block scripts %} {% endblock %}