{% set current_endpoint = url_for(request.endpoint)[1:].split("/")[-1].strip().replace('_', '-')
%}
{% set global_config = config["CONFIG"].get_config() %}
{% set plugins = config["CONFIG"].get_plugins() %}
{% for plugin in plugins %}
{{plugin['name']}} {{plugin['version']}}
{{plugin['description']}}
{% for setting, value in plugin["settings"].items() %}{% if setting != "IS_LOADING" and current_endpoint
== "global-config" and value['context'] == "global" and not value['multiple'] or current_endpoint ==
"services" and value['context'] == "multisite" and not value['multiple'] %}
{{value["label"]}}
{{value['help']}}
{% if value["type"] != "select" and value["type"] != "check" %}
{% if value['type'] == "password" %}
{%endif%}
{% endif %}
{% if value["type"] == "select" %}
{% for item in value['select'] %} {% if global_config[setting]['value'] and
global_config[setting]['value'] == item or not global_config[setting]['value']
and value['default'] == item %}
{% else %}
{% endif %} {% endfor %}
{% endif %}
{% if value["type"] == "check" %}
{% endif %}
{{value['label']}} is invalid and must match this pattern:
{{value['regex']|safe}}
{% endif %} {% endfor %}
{# get number of multiple groups for the plugin #}
{%set multList = []%}
{% for setting, value in plugin["settings"].items() %}
{% if current_endpoint
== "global-config" and value['context'] == "global" and value['multiple'] and not value['multiple'] in multList or current_endpoint ==
"services" and value['context'] == "multisite" and value['multiple'] and not value['multiple'] in multList %}
{% set multList = multList.append(value['multiple']) %}
{%endif%}
{%endfor%}
{%for multiple in multList %}
{{multiple}}
{% for setting, value in plugin["settings"].items() %}
{# render only setting that match the multiple id and context #}
{% if current_endpoint
== "global-config" and value['context'] == "global" and value['multiple'] == multiple or current_endpoint ==
"services" and value['context'] == "multisite" and value['multiple'] == multiple %}
{{value["label"]}}
{{value['help']}}
{% if value["type"] != "select" and value["type"] != "check" %}
{% if value['type'] == "password" %}
{%endif%}
{% endif %}
{% if value["type"] == "select" %}
{% for item in value['select'] %} {% if value['default'] == item %}
{% else %}
{% endif %} {% endfor %}
{% endif %}
{% if value["type"] == "check" %}
{% endif %}
{{value['label']}} is invalid and must match this pattern:
{{value['regex']|safe}}