<style type="text/css">
    .noimage {width:100%;text-align: center;background:#18bc9c;color:#fff;padding-bottom:66.66%;position:relative;}
    .noimage > div {position: absolute;top:48%;width:100%;text-align:center;}
    .addon {position: relative;}
    .addon > span {position:absolute;left:15px;top:15px;z-index:9;}
    .addon > span a{opacity: 0.5;border:none;color:#fff;}
    .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;}
    .thumbnail img{width:100%;}
</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>
                        <div class="btn-group">
                            <a href="#" class="btn btn-info btn-switch active" data-url="{$config.fastadmin.api_url}/addon/index"><i class="fa fa-cloud"></i> {:__('Online store')}</a>
                            <a href="#" class="btn btn-info btn-switch" data-url="addon/downloaded"><i class="fa fa-laptop"></i> {:__('Local addon')}</a>
                        </div>
                        <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="addoninfotpl" type="text/html">
    <div style="font-size:13px;">
        <table class="table table-striped">
            <thead>
                <tr>
                    <th colspan="2"><h4><%=item.title%></h4></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <th scope="row">{:__('Price')}</th>
                    <td><div class="text-<%=item.price>0?'danger':'success'%>"><b>￥<%=item.price%></b></div></td>
                </tr>
                <tr>
                    <th scope="row">{:__('Author')}</th>
                    <td><a href="<%=item.url?item.url:'javascript:;'%>" target="_blank"><%=item.author%></a></td>
                </tr>
                <tr>
                    <th scope="row">{:__('Identify')}</th>
                    <td><%=item.name%></td>
                </tr>
                <tr>
                    <th scope="row">{:__('Homepage')}</th>
                    <td><a href="http://www.fastadmin.net/store/<%=item.name%>.html" target="_blank">http://www.fastadmin.net/store/<%=item.name%>.html</a></td>
                </tr>
                <tr>
                    <th scope="row">{:__('Intro')}</th>
                    <td><%=item.intro%></td>
                </tr>
                <tr>
                    <th scope="row">{:__('Version')}</th>
                    <td><%=# addon && item && addon.version!=item.version?'<span class="label label-danger">'+addon.version+'</span> -> <span class="label label-success">'+item.version+'</span>':item.version%></td>
                </tr>
                <tr>
                    <th scope="row">{:__('Createtime')}</th>
                    <td><%=Moment(item.createtime*1000).format("YYYY-MM-DD HH:mm:ss")%></td>
                </tr>
                <tr>
                    <th scope="row">{:__('Releasetime')}</th>
                    <td><%=Moment(item.releasetime*1000).format("YYYY-MM-DD HH:mm:ss")%></td>
                </tr>
            </tbody>
        </table>
    </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="col-xs-12 col-sm-6 col-md-4 col-lg-3 mt-4">
        <% var labelarr = ['primary', 'success', 'info', 'danger', 'warning']; %>
        <% var label = labelarr[item.id % 5]; %>
        <% var addon = typeof addons[item.name]!= 'undefined' ? addons[item.name] : null; %>
        <div class="thumbnail addon">
            <%if(addon){%>
            <span>
                <a href="<%=addon.url%>" target="_blank" class="btn btn-xs">
                    <i class="fa fa-home"></i>
                </a>
            </span>
            <%}%>
            <a href="<%=item.url%>" class="btn-addonindex" target="_blank">
                <%if(item.image){%>
                <img src="<%=item.image%>" class="img-responsive" alt="<%=item.title%>">
                <%}else{%>
                <div class="noimage"><div>{:__('No image')}</div></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>
                <div class="operate" data-id="<%=item.id%>" data-name="<%=item.name%>">
                    <% if(!addon){ %>
                    <% if(typeof item.releaselist !="undefined" && item.releaselist.length>1){%>
                    <span class="btn-group">
                        <a href="javascript:;" class="btn btn-primary btn-success btn-install" data-type="<%=item.price<=0?'free':'price';%>" data-donateimage="<%=item.donateimage%>" data-version="<%=item.version%>"><i class="fa fa-cloud-download"></i> {:__('Install')}</a> 
                        <a class="btn btn-success dropdown-toggle" data-toggle="dropdown" href="javascript:;">
                            <span class="fa fa-caret-down"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <% for(var i=0;i< item.releaselist.length;i++){ %>
                            <li><a href="javascript:;" class="btn-install" data-type="<%=item.price<=0?'free':'price';%>" data-donateimage="<%=item.donateimage%>" data-version="<%=item.releaselist[i].version%>"><%=item.releaselist[i].version%></a></li>
                            <% } %>
                        </ul>
                    </span>
                    <% }else{%>
                    <a href="javascript:;" class="btn btn-primary btn-success btn-install" data-type="<%=item.price<=0?'free':'price';%>" data-donateimage="<%=item.donateimage%>" data-version="<%=item.version%>"><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>
                    <% } %>
                    <% } %>
                    <% if(addon && item && addon.version!=item.version){%>
                    <% if(typeof item.releaselist !="undefined" && item.releaselist.length>1){%>
                    <span class="btn-group">
                        <a href="javascript:;" class="btn btn-info btn-success btn-upgrade" data-version="<%=item.version%>"><i class="fa fa-cloud"></i> {:__('Upgrade')}</a> 
                        <a class="btn btn-info dropdown-toggle" data-toggle="dropdown" href="javascript:;">
                            <span class="fa fa-caret-down"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <% for(var i=0;i< item.releaselist.length;i++){ %>
                            <li><a href="javascript:;" class="btn-upgrade" data-version="<%=item.releaselist[i].version%>"><%=item.releaselist[i].version%></a></li>
                            <% } %>
                        </ul>
                    </span>
                    <% }else{%>
                    <a href="javascript:;" class="btn btn-info btn-upgrade" data-version="<%=item.version%>"><i class="fa fa-cloud"></i> {:__('Upgrade')}</a>
                    <% }%>
                    <% }%>

                    <span class="pull-right" style="margin-top:10px;">
                        <a href="javascript:;" class="btn-addoninfo text-gray" data-index="<%=i%>" title="<%=item.title?item.title:'{:__('None')}'%>"><i class="fa fa-bars"></i></a>
                    </span>

                </div>
            </div>
        </div>
    </div>
</script>