{% macro flashed_messages(messages=None, container=True, transform={ 'critical': 'danger', 'error': 'danger', 'info': 'info', 'warning': 'warning', 'success': 'success', 'debug': 'info', 'notset': 'info', 'message': 'info', }, default_category=None, dismissible=False) -%} {% with messages = messages or get_flashed_messages(with_categories=True) -%} {% if messages -%} {# don't output anything if there are no messages #} {% if container -%}
{% endif -%} {% endif -%} {% endwith -%} {% endmacro -%} {% macro is_active(active) -%} {% if active %}active{% endif %} {%- endmacro %} {% macro link_to_scope(scope) -%} {{ scope.name }} {%- endmacro %} {% macro link_to_network(network) -%} {{ network.vlan_name }} {%- endmacro %} {% macro link_to_host(host) -%} {{ host.fqdn|default(host.name) }} {%- endmacro %} {% macro link_to_networks(networks) -%} {% for network in networks %} {{ link_to_network(network) }} {% endfor %} {%- endmacro %} {% macro link_to_hosts(hosts) -%} {% for host in hosts %} {{ link_to_host(host) }} {% endfor %} {%- endmacro %} {% macro link_to_interfaces_host(interfaces) -%} {% for interface in interfaces %} {{ link_to_host(interface.host) }} {% endfor %} {%- endmacro %} {% macro link_to_item(ics_id) -%} {% if ics_id %} {{ ics_id }} {% else %} {{ ics_id }} {% endif %} {%- endmacro %} {% macro link_to_items(ics_ids) -%} {% for ics_id in ics_ids %} {{ link_to_item(ics_id) }} {% endfor %} {%- endmacro %} {% macro link_to_stack_member(item) -%} {% if item.stack_member is not none %} {{ item.ics_id }} ({{ item.stack_member }}) {% else %} {{ item.ics_id }} {% endif %} {%- endmacro %} {% macro link_to_stack_members(items) -%} {% for item in items %} {{ link_to_stack_member(item) }} {% endfor %} {%- endmacro %} {% macro link_to_ansible_group(group) -%} {{ group.name }} {%- endmacro %} {% macro link_to_ansible_groups(groups) -%} {% for group in groups %} {{ link_to_ansible_group(group) }} {% endfor %} {%- endmacro %} {% macro link_to_task(task) -%} {{ task.id }} {%- endmacro %} {% macro link_to_tasks(tasks) -%} {% for task in tasks %} {{ link_to_task(task) }} {% endfor %} {%- endmacro %} {% macro render_field(field) -%} {% set field_class = kwargs.pop('class_', '') + ' form-control' %} {% set label_size = kwargs.pop('label_size', '2') %} {% set input_size = kwargs.pop('input_size', '10') %} {% if field.errors %} {% set field_class = field_class + ' is-invalid' %} {% endif %}