{% from 'global_macros.html' import preload_circle %} {% macro HomeCards(apps, tags) %} {% if apps %} {% for tag in tags %}
{% if tag.name != "Untagged" %}
{% if tag.icon %} {{ tag.icon }} {% endif %} {{ tag.name }} keyboard_arrow_up
{% endif %}
{% for app in tag.apps %} {% if app.type == "app" %} {{ App(app) }} {% elif app.type == "collection" %} {{ Collection(app) }} {% elif app.type == "custom" %} {{ Custom(app) }} {% endif %} {% endfor %}
{% endfor %} {% else %}
No apps yet

Click here to add an app.

{% endif %} {% endmacro %} {% macro SidenavApps(apps, tags) %}
{% for tag in tags %}
{% if tag.name != "Untagged" %} {% if tag.icon %} {{ tag.icon }} {% endif %} {{ tag.name }} keyboard_arrow_up {% endif %}
{% for app in tag.apps %} {% if app.type == 'app' %}
{{ ListViewApp(app) }}
{% endif %} {% endfor %}
{% endfor %}
{% endmacro %} {% macro AppAnchor(app, classes=None, override=None, style=None) %} {% if override == 'iframe' or app.open_in == 'iframe' and override == None %} {% elif override == 'this_tab' or app.open_in == 'this_tab' and override == None %} {% elif override == 'new_tab' or app.open_in == "new_tab" and override == None %} {% endif %} {% endmacro %} {% macro App(app) %}
{{ AppAnchor(app) }}
{% if app.data_sources.count() > 0 %}
{% for data_source in app.data_sources %}

{% endfor %}
{% else %} {% endif %}
{{ app.name }} more_vert {% if app.data_sources.count() > 0 %} refresh {% endif %}
{{ app.name }}close {% if app.description %}

{{ app.description|safe }}

{% endif %}
{% endmacro %} {% macro Collection(app) %}
{% if app.icon %} {{app.icon}} {% endif %} {{ app.name }}
{% for url in app.urls_json %} {% if url['open_in'] == 'this_tab' %} {% else %} {% endif %}
{% if url['icon'] %} {% endif %} {{ url['name'] }}
{% endfor %}
{% endmacro %} {% macro Custom(app) %}
{{ app.name }}
{% for data_source in app.data_sources %}

{% endfor %}
{% endmacro %} {% macro ListViewApp(app) %} {{ app.name }} {{ AppAnchor(app, classes="collection-item", style="min-height: 50px;") }} {{ app.name }} {# This closes AppAnchor() #} {% endmacro %}