<style type="text/css">
    .item-addon{margin-left:15px;margin-bottom:15px;}
    .item-addon img.img-responsive,.item-addon .noimage{width: 300px;height:200px;}
    .noimage {line-height: 200px;text-align: center;background:#18bc9c;color:#fff;}
    .addon {position: relative;}
    .addon > span {position:absolute;left:15px;top:15px;}
    .layui-layer-pay .layui-layer-content {padding:0;height:600px!important;}
    .layui-layer-pay {border:none;}
    .payimg{position:relative;width:800px;height:600px;}
    .payimg .alipaycode {position:absolute;left:265px;top:442px;}
    .payimg .wechatcode {position:absolute;left:660px;top:442px;}
</style>
<div id="warmtips" class="alert alert-dismissable alert-danger hide">
    <button type="button" class="close" data-dismiss="alert">×</button>
    <strong>{:__('Warning')}</strong> {:__('Https tips')}
</div>
<div class="panel panel-default panel-intro">
    {:build_heading()}

    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <div id="toolbar" class="toolbar">
                        {:build_toolbar('refresh')}
                        <!--
                        <button type="button" id="plupload-addon" class="btn btn-danger plupload" data-url="addon/local" data-mimetype="application/zip" data-multiple="false"><i class="fa fa-upload"></i> {:__('Offline install')}</button>
                        <a class="btn btn-success btn-ajax" href="addon/refresh"><i class="fa fa-refresh"></i> {:__('Refresh addon cache')}</a>
                        <a class="btn btn-info btn-switch btn-store" href="javascript:;" data-url="{$config.fastadmin.api_url}/addon/index"><i class="fa fa-cloud"></i> {:__('Online store')}</a>
                        -->
                        <a class="btn btn-info btn-switch" href="javascript:;" data-url="addon/downloaded"><i class="fa fa-laptop"></i> {:__('Local addon')}</a>
                        <!--
                        <a class="btn btn-primary btn-userinfo" href="javascript:;"><i class="fa fa-user"></i> {:__('Userinfo')}</a>
                        -->
                    </div>
                    <table id="table" class="table table-striped table-hover" width="100%">

                    </table>

                </div>
            </div>

        </div>
    </div>
</div>
<script id="logintpl" type="text/html">
    <div>
        <form class="form-horizontal">
            <fieldset>
                <div class="alert alert-dismissable alert-danger">
                    <button type="button" class="close" data-dismiss="alert">×</button>
                    <strong>{:__('Warning')}</strong><br />{:__('Login tips')}
                </div>
                <div class="form-group">
                    <label for="inputAccount" class="col-lg-3 control-label">{:__('Username')}</label>
                    <div class="col-lg-9">
                        <input type="text" class="form-control" id="inputAccount" value="" placeholder="{:__('Your username or email')}">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputPassword" class="col-lg-3 control-label">{:__('Password')}</label>
                    <div class="col-lg-9">
                        <input type="password" class="form-control" id="inputPassword" value="" placeholder="{:__('Your password')}">
                    </div>
                </div>
            </fieldset>
        </form>
    </div>
</script>
<script id="userinfotpl" type="text/html">
    <div>
        <form class="form-horizontal">
            <fieldset>
                <div class="alert alert-dismissable alert-success">
                    <button type="button" class="close" data-dismiss="alert">×</button>
                    <strong>{:__('Warning')}</strong><br />{:__('Logined tips', '<%=username%>')}
                </div>
            </fieldset>
        </form>
    </div>
</script>
<script id="paytpl" type="text/html">
    <div class="payimg" style="background:url('<%=payimg%>') 0 0 no-repeat;background-size:cover;">
        <%if(paycode){%>
        <div class="alipaycode">
            <%=paycode%>
        </div>
        <div class="wechatcode">
            <%=paycode%>
        </div>
        <%}%>
    </div>
</script>
<script id="conflicttpl" type="text/html">
    <div class="alert alert-dismissable alert-danger">
        <button type="button" class="close" data-dismiss="alert">×</button>
        <strong>{:__('Warning')}</strong> {:__('Conflict tips')}
    </div>
    <table class="table table-striped">
        <thead>
            <tr>
                <th>#</th>
                <th>{:__('File')}</th>
            </tr>
        </thead>
        <tbody>
            <%for(var i=0;i < conflictlist.length;i++){%>
            <tr>
                <th scope="row"><%=i+1%></th>
                <td><%=conflictlist[i]%></td>
            </tr>
            <%}%>
        </tbody>
    </table>
</script>
<script id="itemtpl" type="text/html">
    <div class="item-addon">
        <% var labelarr = ['primary', 'success', 'info', 'danger', 'warning']; %>
        <% var label = labelarr[item.id % 5]; %>
        <% var addon = (typeof addons[item.name]!= 'undefined') ? (item.installed == 0 ? null : addons[item.name]) : null; %>
        <div class="thumbnail addon">
            <!--<span class="btn btn-<%=label%>">ID:<%=item.id%></span>-->
            <a href="<%=addon?addon.url:'javascript:;'%>" target="_blank">
                <%if(item.image){%>
                <img src="<%=item.image%>" class="img-responsive" alt="<%=item.title%>">
                <%}else{%>
                <div class="noimage">{:__('No image')}</div>
                <%}%>
            </a>
            <div class="caption">
                <h4><%=item.title?item.title:'{:__('None')}'%>
                    <% if(item.flag.indexOf("recommend")>-1){%>
                    <span class="label label-success">{:__('Recommend')}</span>
                    <% } %>
                    <% if(item.flag.indexOf("hot")>-1){%>
                    <span class="label label-danger">{:__('Hot')}</span>
                    <% } %>
                    <% if(item.flag.indexOf("free")>-1){%>
                    <span class="label label-info">{:__('Free')}</span>
                    <% } %>
                    <% if(item.flag.indexOf("sale")>-1){%>
                    <span class="label label-warning">{:__('Sale')}</span>
                    <% } %>
                </h4>
                <p class="text-<%=item.price>0?'danger':'success'%>"><b>￥<%=item.price%></b></p>
                <p class="text-muted">{:__('Author')}: <a href="<%=item.url?item.url:'javascript:;'%>" target="_blank"><%=item.author%></a></p>
                <p class="text-muted">{:__('Intro')}: <%=item.intro%></p>
                <p class="text-muted">{:__('Version')}: <%=# addon && item && addon.version!=item.version?'<span class="label label-danger">'+addon.version+'</span> -> <span class="label label-success">'+item.version+'</span>':item.version%></p>
                <p class="text-muted">{:__('Createtime')}: <%=Moment(item.createtime*1000).format("YYYY-MM-DD HH:mm:ss")%></p>
                <p class="operate" data-id="<%=item.id%>" data-name="<%=item.name%>">
                    <% if(!addon){ %>
                    <a href="javascript:;" class="btn btn-primary btn-success btn-install" data-type="<%=item.price<=0?'free':'price';%>" data-donateimage="<%=item.donateimage%>"><i class="fa fa-cloud-download"></i> {:__('Install')}</a>
                    <% if(item.demourl){ %>
                    <a href="<%=item.demourl%>" class="btn btn-primary btn-info btn-demo" target="_blank"><i class="fa fa-flash"></i> {:__('Demo')}</a>
                    <% } %>
                    <% } %>

                    <% if(addon){ %>
                    <% if(addon.config){ %>
                    <a href="javascript:;" class="btn btn-primary btn-config"><i class="fa fa-pencil"></i> {:__('Setting')}</a>
                    <% } %>
                    <% if(addon.state == "1"){ %>
                    <a href="javascript:;" class="btn btn-warning btn-disable" data-action="disable"><i class="fa fa-times"></i> {:__('Disable')}</a>
                    <% }else{ %>
                    <a href="javascript:;" class="btn btn-success btn-enable" data-action="enable"><i class="fa fa-check"></i> {:__('Enable')}</a>
                    <a href="javascript:;" class="btn btn-danger btn-uninstall"><i class="fa fa-times"></i> {:__('Uninstall')}</a>
                    <% } %>
                    <% } %>
                    <!--
                    <span class="pull-right" style="margin-top:10px;">
                        <input name="checkbox" data-id="<%=item.id%>" type="checkbox" />
                    </span>
                    -->
                </p>
            </div>
        </div>
    </div>
</script>