"""
Flask-Pilot Macros
Place your macros in here
"""
# ---- include_css_file() ------------------------------------------------------
{%- macro include_css_file(file) -%}
{%- if file.startswith('http') or file.startswith('//') -%}
{%- set src = file -%}
{%- else -%}
{% set src = url_for('static', filename=file) %}
{%- endif -%}
{%- endmacro -%}
# ---- include_js_file() ------------------------------------------------------
{%- macro include_js_file(file) -%}
{%- if file.startswith('http') or file.startswith('//') -%}
{%- set src = file -%}
{%- else -%}
{%- set src = url_for('static', filename=file) -%}
{%- endif -%}
{%- endmacro -%}
# ---- img_src() ------------------------------------------------------
{% macro img_src(file, attributes={}) %}
{%- if file.startswith('http') or file.startswith('//') %}
{% set src = file %}
{% else %}
{% set src = url_for('static', filename=file) %}
{% endif -%}
{% endmacro %}
# ---- static_url() ------------------------------------------------------
{% macro static_url(url) %}
{%- if not file.startswith('http') and not file.startswith('//') %}
{% set url = url_for('static', filename=file) %}
{% endif -%}
{{ url | safe }}
{% endmacro %}
# ---- google_analytics() ------------------------------------------------------
{% macro google_analytics(code) %}
{% endmacro %}
#---- show_flashed_messages() -------------------------------------------------------
# Render the flashed messages set
{% macro show_flashed_messages(dismissible=True) %}
{% for category, message in get_flashed_messages(with_categories=True) %}