{% macro mapping_table(caption='', field_headings=[], field_headings_visible=True, caption_visible=True) -%} {% for field_heading in field_headings %} {% endfor %} {{ caller() }}
{{ caption }}
{% if field_headings_visible %} {{ field_heading }} {% else %} {{ field_heading }} {% endif %}
{%- endmacro %} {% macro list_table(items, caption='', empty_message='', field_headings=[], field_headings_visible=True, caption_visible=True) -%} {% set parent_caller = caller %} {% call mapping_table(caption, field_headings, field_headings_visible, caption_visible) %} {% for item in items %} {% call row() %} {{ parent_caller(item) }} {% endcall %} {% endfor %} {% if not items %} {% call row() %} {{ empty_message }} {% endcall %} {% endif %} {%- endcall %} {%- endmacro %} {% macro row() -%} {{ caller() }} {%- endmacro %} {% macro field(align='left', status='') -%} {{ caller() }} {%- endmacro %} {% macro text_field(text) -%} {% call field() %} {{ text }} {% endcall %} {%- endmacro %} {% macro boolean_field(yes) -%} {% call field(status='yes' if yes else 'no') %} {{ "Yes" if yes else "No" }} {% endcall %} {%- endmacro %} {% macro right_aligned_field_heading(text) %} {{ text }} {%- endmacro %} {% macro hidden_field_heading(text) %} {{ text }} {%- endmacro %}