{# The widget grid of a dashboard. vars: dashboard, items, editing, span_class, spans, render_item, is_lazy, polling, item_label, url, plugin #} {% import "tungsten/components/ui.html" as ui %} {% if items %}
{% for item in items %} {% set builtin = item.widget.startswith('dashboards.') %}
{% if editing %}
{{ item_label(ctx, plugin, item) }} {% if builtin %} {{ ui.icon_button('settings', 'Change', bordered=false, attrs_='@click="open = !open"'|safe) }} {% endif %}
{% if builtin %}
{% with values = item.settings or {}, title = item.title, key = item.widget, prefix = 'item-' ~ item.id %} {% include "tungsten_dashboards/fields.html" %} {% endwith %}
{{ ui.button('Save', 'primary', 'check', type='submit', size='sm') }}
{% endif %} {% endif %}
{% set every = polling(ctx, plugin, item) %} {% if is_lazy(ctx, plugin, item) %}
{% elif every %}
{{ render_item(ctx, plugin, item) }}
{% else %}{{ render_item(ctx, plugin, item) }}{% endif %}
{% endfor %}
{% endif %}