{extend name="base" /}
{block name="js"}
<script src="__ADMIN__/addons/addons.js?v={$v}" type="text/javascript"></script>
{/block}
{block name="main"}

<div class="layui-tab layui-tab-brief" lay-filter="msgTab">
      <ul class="layui-tab-title">
            <li class="layui-this">已安装</li>
            <li>未安装</li>
      </ul>
      <div class="layui-tab-content addons" style="padding: 10px 0;">
            <div class="layui-tab-item layui-show">
                <div class="qy">已启用<span style="color:red;font-weight:bold;">&nbsp;&nbsp;(安装插件后，进入“设置”，填写配置信息，然后点击保存！)</span></div>
                <ul><div id='addonsBox1'>


                </div></ul>
                <div class="qy">未启用</div>
                <ul><div id='addonsBox2'></div></ul>
            </div>
            <div class="layui-tab-item">
                <ul><div id='addonsBox0'></div></ul>
                <div style='text-align:center' id='pager'></div>
            </div>
      </div>
</div>
<script id="addonsTpl" type="text/html">
      {{# for(var i = 0; i < d['Rows'].length; i++){ }}
      <li {{# if(d['addonStatus']==2){}}class="no_use"{{#}}}>
            <div class="cimg"><img src="__ROOT__/addons/{{d['Rows'][i].name.toLowerCase()}}/logo.png"></div>
            <div class="ctxt">
                  <h3>{{d['Rows'][i].title}}</h3>
                  <p title='{{d['Rows'][i].description}}'>{{d['Rows'][i].description}}</p>
            </div>
            <div class="cbtn">
                  {{# if(WST.GRANT.CJGL_01 && d['Rows'][i]['status']>0 && d['Rows'][i]['isConfig']==1){}}
                  <a href="{{WST.U('admin/Addons/toEdit','id='+d['Rows'][i]['addonId'])}}">设置</a>
                  {{#}}}
                  {{# if(WST.GRANT.CJGL_02 && d['Rows'][i]['status']==0){}}
                  <a href="javascript:install({{d['Rows'][i]['addonId']}})">安装</a>
                  {{#}}}
                  {{# if(WST.GRANT.CJGL_04 &&  d['Rows'][i]['status']==2){}}
                  <a href="javascript:enable({{d['Rows'][i]['addonId']}})">启用</a>
                  {{#}}}
                  {{# if(WST.GRANT.CJGL_05 && d['Rows'][i]['status']==1){}}
                  <a href="javascript:disable({{d['Rows'][i]['addonId']}})" class="xiez">禁用</a>
                  {{#}}}
                  {{# if(WST.GRANT.CJGL_03 && d['Rows'][i]['status']>0){}}
                  <a href="javascript:uninstall({{d['Rows'][i]['addonId']}})" class="xiez">卸载</a>
                  {{#}}}
            </div>
      </li>
      {{# } }}
</script>

{/block}
