{% extends base %}

{% block body_left %}

{% init plugin_categories = [] %}

<div class="card">
    <div class="card-title">
        <span>插件中心</span>

        {% if _is_admin %}
            <div class="float-right">
                <a class="btn btn-default" href="{{_server_home}}/plugins_new">新增</a>
                <a class="btn btn-default" href="{{_server_home}}/fs_link/scripts/plugins">管理</a>
                <a class="btn btn-default" href="{{_server_home}}/fs_api/download/plugins">下载</a>
                {% include common/button/back_button.html %}
            </div>
        {% end %}

    </div>
</div>

{% if _is_admin %}

    <div class="transparent-card card hide">
        <h3 class="card-title">操作</h3>

        <a class="btn" href="{{_server_home}}/plugins_new">新增</a>
        <a class="btn" href="{{_server_home}}/fs_link/scripts/plugins">管理</a>
        <a class="btn" href="{{_server_home}}/fs_api/download/plugins">下载</a>
        
        <div class="float-right">
            <a class="btn" href="{{_server_home}}/plugin_list_old">返回旧版</a>
        </div>
    </div>
{% end %}

<div class="plugin-list col-md-12">
    {% for temp_category, plugins in plugin_categories %}
        {% if len(plugins) == 0 %}
            {% continue %}
        {% end %}
        <div class="card">
            <h3 class="card-title">{{temp_category}}</h3>
            {% for item in plugins %}
                <div class="plugin-item v2">
                    <a class="link" href="{{item.abs_url}}">{{item.title}}</a>
                </div>
            {% end %}
        </div>
    {% end %}
</div>
{% end %}

{% block body_right %}
    {% include common/sidebar/default.html %}
{% end %}
