{% extends "orga/base.html" %}
{% load i18n %}

{% block title %}{% translate "Plugins" %}{% endblock %}
{% block content %}
    <h2>{% translate "Plugins" %}</h2>

    <form method="post" class="form-horizontal form-plugins">
        {% csrf_token %}
        {% for plugin in plugins %}
            <div class="card plugin-card">
                <div class="card-header">
                    {{ plugin.name }}
                    {% if plugin.module in plugins_active %}
                        <button class="btn btn-outline-danger btn-block" name="plugin:{{ plugin.module }}" value="disable">{% translate "Disable" %}</button>
                    {% else %}
                        <button class="btn btn-success btn-block" name="plugin:{{ plugin.module }}" value="enable">{% translate "Enable" %}</button>
                    {% endif %}
                </div>
                <ul class="list-group list-group-flush">
                    <li class="list-group-item">
                        {% if plugin.author %}
                            <p class="meta">{% blocktranslate trimmed with v=plugin.version a=plugin.author %}
                                Version {{ v }} by <em>{{ a }}</em>
                            {% endblocktranslate %}</p>
                        {% else %}
                            <p class="meta">{% blocktranslate trimmed with v=plugin.version a=plugin.author %}
                                Version {{ v }}
                            {% endblocktranslate %}</p>
                        {% endif %}
                        {{ plugin.description }}
                    </li>
                </ul>
            </div>
        {% endfor %}
    </form>
    {% if not plugins %}
        <div class="alert alert-info">
            {% translate "This instance does currently not have any plugins installed." %}
        </div>
    {% endif %}
{% endblock %}
