{layout:default} {class:Shop.Admin.theme.filelist}
<lbhead>
    <title><%=Tag("系统块") %>-<%=Tag("主题管理")%>-<%=site.title%></title>
</lbhead>
<lbpath>
    <h3 class="text-themecolor m-b-0 m-t-0"><%=Tag("编辑模板")%></h3>
    <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="<%=site.AdminPath %>/Ajax/ajax_admin.aspx?__Action=MenuJump&pid=0"><%=Tag("管理首页")%></a></li>
        <li class="breadcrumb-item"><a href="<%=site.AdminPath %>/theme/default.aspx"><%=Tag("模板管理")%></a></li>
        <li class="breadcrumb-item"><a href="<%=site.AdminPath %>/theme/skin.aspx?id=<%=theme.id %>"><%=theme.Name %></a></li>
        <li class="breadcrumb-item active"><%=Tag("编辑模板")%></li>
    </ol>
</lbpath>
<lbbody>
    <div class="col-12">
        <div class="card">
            <div class="col-md-12">
                <ul class="nav nav-tabs customtab m-t-15" role="tablist">
                    <li class="nav-item"><a class="nav-link" href="skin.aspx?id=<%=theme.id %>" role="tab"><%=Tag("页面")%></a></li>
                    <li class="nav-item"><a class="nav-link <%if (t=="block"){Response.Write("active");} %>" href="filelist.aspx?id=<%=theme.id %>&t=block" role="tab"><%=Tag("块")%></a></li>
                    <li class="nav-item"><a class="nav-link <%if (t=="layout"){Response.Write("active");} %>" href="filelist.aspx?id=<%=theme.id %>&t=layout" role="tab"><%=Tag("布局")%></a></li>
                    <%if (theme.Path_JS != ""){ %>
                    <li class="nav-item"><a class="nav-link <%if (t=="js"){Response.Write("active");} %>" href="filelist.aspx?id=<%=theme.id %>&t=js" role="tab">JS</a></li>
                    <%} %>
                    <%if (theme.Path_CSS != ""){ %>
                    <li class="nav-item"><a class="nav-link <%if (t=="css"){Response.Write("active");} %>" href="filelist.aspx?id=<%=theme.id %>&t=css" role="tab">CSS</a></li>
                    <%} %>
                </ul>
            </div>
            <div class="card-body">
                <div class="row">
                    <div class="col-md-12 m-b-10">
                        <%if (PageReturnMsg == ""){%>
                        <button class="btn btn-success" onclick="CreateTheme();"><i class="ti-files"></i> <%=Tag("生成主题")%></button>
                        <%}%>
                    </div>
                </div>
                <div class="table-responsive">
                    <table class="table table-hover no-wrap">
                        <thead>
                            <tr>
                                <th>
                                    <%=Tag("名称")%>
                                </th>
                                <th>
                                    <%=Tag("说明")%>
                                </th>
                                <th>
                                    <%=Tag("限制")%>
                                </th>
                                <th>
                                    <%=Tag("更新时间")%>
                                </th>
                                <th>
                                    <%=Tag("操作")%>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <%if (t == "css")
                            Response.Write(GetList(theme.Path_CSS));
                            else if (t == "js")
                            Response.Write(GetList(theme.Path_JS));
                            else if (t == "layout")
                            Response.Write(GetList(theme.Path_Files.TrimEnd('/') + "/layout"));
                            else
                            {
                            Response.Write(GetList(theme.Path_Files.TrimEnd('/') + "/inc"));
                            Response.Write(GetList(theme.Path_Files.TrimEnd('/')+"/block"));
                            }
                            %>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</lbbody>
<lbscripts>
    <script>
        function Edit(name) {
            window.location = "file_edit.aspx?id=<%=theme.id %>&file=" + name;
        }
        function Load(name) {
            window.location = "filelist.aspx?file=" + name;
        }
        function CreateTheme() {
            var postData = { "Theme_id": <%=theme.id %> };
            var url="<%=site.AdminPath %>/ajax/ajax_aspx.aspx?__Action=CreateTheme";
            RequestAjax(url,postData,function(res){MsgBox(1, "<%=Tag("操作成功")%>", "")});
        }
    </script>
</lbscripts>