{% extends inReportingMenu ? "empty.twig" : "admin.twig" %}

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

{% block content %}

    <div class="marketplace">

        <div piwik-content-intro>
            <h2 piwik-enriched-headline feature-name="{{ 'CorePluginsAdmin_Marketplace'|translate }}"
            >{{ title|e('html_attr') }}</h2>

            <p>
                {% if not isSuperUser %}
                    {% if showThemes %}
                        {{ 'Marketplace_NotAllowedToBrowseMarketplaceThemes'|translate }}
                    {% else %}
                        {{ 'Marketplace_NotAllowedToBrowseMarketplacePlugins'|translate }}
                    {% endif %}
                {% elseif showThemes %}
                    {{ 'CorePluginsAdmin_ThemesDescription'|translate }}
                    {{ 'Marketplace_InstallingNewThemesViaMarketplaceOrUpload'|translate('<a href="#" class="uploadPlugin">', '</a>')|raw }}
                {% else %}
                    {{ 'CorePluginsAdmin_PluginsExtendPiwik'|translate }}
                    {{ 'Marketplace_InstallingNewPluginsViaMarketplaceOrUpload'|translate('<a href="#" class="uploadPlugin">', '</a>')|raw }}
                {% endif %}
                {% if isSuperUser and inReportingMenu %}
                    {{ 'Marketplace_NoticeRemoveMarketplaceFromReportingMenu'|translate('<a href="#" piwik-plugin-name="WhiteLabel">', '</a>')|raw }}
                {% endif %}
            </p>
            {% include '@Marketplace/licenseform.twig' %}

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

            <div
                    vue-entry="Marketplace.Marketplace"
                    plugin-type="{{ pluginType|default(null)|json_encode|e('html_attr') }}"
                    plugin-type-options="{{ pluginTypeOptions|default(null)|json_encode|e('html_attr') }}"
                    sort="{{ sort|default(null)|json_encode|e('html_attr') }}"
                    plugin-sort-options="{{ pluginSortOptions|default(null)|json_encode|e('html_attr') }}"
                    plugins-to-show="{{ pluginsToShow|default(null)|json_encode|e('html_attr') }}"
                    query="{{ query|default(null)|json_encode|e('html_attr') }}"
                    num-available-plugins="{{ numAvailablePlugins|default(null)|json_encode|e('html_attr') }}"
            ></div>
        </div>

        {% include '@Marketplace/plugin-list.twig' %}

        <div class="footer-message center">
            {{ 'Marketplace_DevelopersLearnHowToDevelopPlugins'|translate('<a target="_blank" rel="noreferrer noopener" href="https://developer.matomo.org/develop">', '</a>')|raw }}
            <br />
            <br />
            <br />
            <a rel="noreferrer noopener" href="https://shop.matomo.org/faq/" target="_blank">FAQ</a> |
            <a rel="noreferrer noopener" href="https://shop.matomo.org/terms-conditions/" target="_blank">Terms</a> |
            <a rel="noreferrer noopener" href="https://matomo.org/privacy-policy/" target="_blank">Privacy</a> |
            <a rel="noreferrer noopener" href="https://matomo.org/contact/" target="_blank">Contact</a>
        </div>

    </div>

{% endblock %}
