{{ _('The plugin system is switched off; no plugin is loaded.') }}
{{ _('Enable in config.toml:') }} [plugins] enabled = true
{% endif %}
{% if plugins %}
{% set type_labels = {'plugin': _('Plugin'), 'detector': _('Detector'), 'notifier': _('Notifier'), 'source': _('Source')} %}
{% for p in plugins %}
●{{ p.name }}
{% if p.loaded and p.type %}{{ type_labels.get(p.type | lower, p.type) }}{% endif %}
{# Effective state of a loaded plugin. #}
{% if p.loaded and p.state == 'active' %}
{% if p.event_source %}{{ _('Running') }}
{% else %}{{ _('Loaded') }}{% endif %}
{% elif p.loaded and p.state == 'inactive' %}
{{ _('Not running') }}
{% elif p.loaded and p.state == 'unverified' %}
{{ _('Run state unknown') }}
{% endif %}
{% if not p.loaded %}
{% for reason in p.reasons %}
{% if reason == 'system_off' %}{{ _('Plugin system off') }}
{% elif reason == 'not_installed' %}{{ _('Not installed') }}
{% elif reason == 'not_listed' %}{{ _('Not in builtin') }}
{% elif reason == 'disabled' %}{{ _('Disabled in config') }}
{% elif reason == 'not_registered' %}{{ _('Not registered') }}
{% endif %}
{% endfor %}
{% endif %}
{% if p.loaded and p.events %}{{ p.events[:3]|join(' · ') }}{% if p.events|length > 3 %} +{{ p.events|length - 3 }}{% endif %}{% endif %}
{% if p.loaded %}v{{ p.version }}{% else %}{{ _('Not loaded') }}{% endif %}
{# The section this plugin reads, and - only when it is loaded - the
enabled value found there. The marker is what the tests (and grep)
assert on: this element is the only place a status claim is made. #}
{{ _('Config section:') }} plugins.{{ p.section }}
{%- if p.show_enabled %} · enabled = {{ 'true' if p.enabled else 'false' }}{% if not p.enabled_declared %} ({{ _('not set explicitly') }}){% endif %}
{%- else %} · {{ _('enabled is not reported for a plugin that is not loaded') }}{% endif %}
{% if p.configurable %}
{{ _('Settings:') }} {{ p.field_count }}
{%- if p.changed_count %} · {{ _('%(count)s differ from defaults', count=p.changed_count) }}
{%- else %} · {{ _('all at defaults') }}{% endif %}
{%- if p.shipped_count %} · {{ _('%(count)s differ from the shipped file', count=p.shipped_count) }}{% endif %}
{% endif %}
{% if not p.loaded %}
{% for reason in p.reasons %}
{% if reason == 'system_off' %}
{{ _('The [plugins] section is disabled, so nothing is loaded from builtin.') }}
{% elif reason == 'not_installed' %}
{{ _('Listed in config.toml, but this build has no implementation for it.') }}
{% elif reason == 'not_listed' %}
{{ _('This build can load it, but [plugins] builtin does not list it.') }}
{% elif reason == 'disabled' %}
{{ _('Installed but switched off in config.toml.') }}
{% elif reason == 'not_registered' %}
{{ _('Enabled and listed, but the plugin is not registered — check the startup log.') }}
{% endif %}
{% endfor %}
{% if p.snippet %}
{{ _('Add to config.toml:') }}
{{ p.snippet }}
{% endif %}
{% endif %}
{% if p.installed %}
{% if p.configurable %}
{# The row expands into the shared form target below instead of replacing
the inventory: the operator keeps the list, the filter and the other
rows in view while editing one plugin's section. #}
{% endif %}
{% if p.enabled %}
{% else %}
{% endif %}
{% if p.in_builtin %}
{% else %}
{% endif %}
{% if p.guard_reason %}
{{ _('Protected:') }} {{ p.guard_reason }}
{% endif %}
{% endif %}
{% endfor %}
{% else %}
{{ _('No plugin is available in this build.') }}
{% endif %}
{# One shared target, not one per row: the form is fetched for the plugin the
operator clicked and replaces whatever was open, so a panel with ten plugins
still renders one form's worth of markup. On a rejected save the server
renders the form back into this same target, which is why the inventory the
operator was reading stays on screen. #}