{# fabledscryer/templates/settings/plugins.html #} {% extends "base.html" %} {% block title %}Settings — Plugins — Fabled Scryer{% endblock %} {% block content %} {% set active_tab = "plugins" %} {% include "settings/_tabs.html" %} {# ── Restart banner (replaced by _restart_pending.html after action) #}
{# ── Installed Plugins ─────────────────────────────────────────────────────── #}
Installed Plugins
{% if not discovered_plugins %}
No plugins found in the plugin directory.
{% else %}
{# Plugin index URL #}
Plugin Index URL
URL to the remote index.yaml used by the plugin catalog below.
{% for plugin in discovered_plugins %}
{# Plugin header: enable toggle + name/description #}
{# Failure notice — shown when this plugin failed to load #} {% set fail_reason = plugin_failures.get(plugin._dir) %} {% if fail_reason %}
Failed to load — {{ fail_reason }}
{% endif %} {# Config fields — only shown when there are config keys #} {% if plugin.get('config') %}
{% for cfg_key, cfg_default in plugin.config.items() %} {% if cfg_default is iterable and cfg_default is not string and cfg_default is not mapping %} {# List — cannot be edited via a flat form; must be set in plugin.yaml #}
📋 {{ cfg_key }} — list config, edit in plugin.yaml ({{ cfg_default | length }} item{{ 's' if cfg_default | length != 1 }}).
{% elif cfg_default is mapping %} {# Nested dict group #}
{{ cfg_key }}
{% set sub_cfg = plugin._config.get(cfg_key, cfg_default) if plugin._config.get(cfg_key, cfg_default) is mapping else cfg_default %}
{% for sub_key, sub_default in cfg_default.items() %} {% if sub_default is sameas false or sub_default is sameas true %}
{% else %}
{% endif %} {% endfor %}
{% elif cfg_default is sameas false or cfg_default is sameas true %}
{% else %}
{% endif %} {% endfor %}
{% endif %}
{% endfor %}
Enable/disable changes take effect after a restart.
{% endif %} {# ── Plugin Catalog ────────────────────────────────────────────────────────── #}
Plugin Catalog
{% set index_url = settings.get('plugins.index_url', '') %} {% if index_url %}
Loading catalog…
{% else %}
Configure a Plugin Index URL above to browse available plugins.
{% endif %}
{% endblock %}