
{% extends 'admin.twig' %}

{% import '@CorePluginsAdmin/macros.twig' as plugins %}

{% set title %}{{ 'CorePluginsAdmin_PluginsManagement'|translate }}{% endset %}

{% block content %}

    {% include '@Marketplace/uploadPluginDialog.twig' %}

    <div piwik-content-intro>
        <h2 piwik-enriched-headline>
            {{ title|e('html_attr') }}
        </h2>

        <p>{{ 'CorePluginsAdmin_PluginsExtendPiwik'|translate }}
            {{ 'CorePluginsAdmin_OncePluginIsInstalledYouMayActivateHere'|translate }}

            {% if isMarketplaceEnabled %}
                {{ 'CorePluginsAdmin_TeaserExtendPiwikByPlugin'|translate(
                    '<a href="' ~ linkTo({'action':'browsePlugins', 'sort': ''}) ~ '">',
                    '</a>',
                    '<a href="#" class="uploadPlugin">',
                    '</a>'
                )|raw }}
            {% endif %}

            {% if not isPluginsAdminEnabled %}
                <br/>{{ 'CorePluginsAdmin_DoMoreContactPiwikAdmins'|translate }}
            {% endif %}

            {{ 'CorePluginsAdmin_ChangeLookByManageThemes'|translate('<a href="' ~ linkTo({'action': 'themes'}) ~'">', '</a>')|raw }}
        </p>
    </div>

    {% if pluginsHavingUpdate|length %}
        <div piwik-content-block content-title="{{ pluginsHavingUpdate|length }} Update(s) available">

            <p>{{ 'CorePluginsAdmin_InfoPluginUpdateIsRecommended'|translate }}</p>

            {{ plugins.tablePluginUpdates(pluginsHavingUpdate, updateNonce, isMultiServerEnvironment) }}
        </div>
    {% endif %}

    <div piwik-content-block content-title="{{ 'CorePluginsAdmin_InstalledPlugins'|translate|e('html_attr') }}"
         class="pluginsManagement"
         piwik-plugin-management>

        {{ plugins.pluginsFilter() }}

        {{ plugins.tablePlugins(pluginsInfo, pluginNamesHavingSettings, activateNonce, deactivateNonce, uninstallNonce, false, marketplacePluginNames, isPluginsAdminEnabled) }}

    </div>

{% endblock %}