<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="templatesgrid.aspx.cs"
    Inherits="Focus.Admin.templatesgrid" %>

<%@ Register TagPrefix="cc1" Namespace="Focus.Control" Assembly="Focus.Control" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>站点模板列表</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="styles/fntmanager.css" type="text/css" rel="stylesheet">
    <link href="styles/datagrid.css" type="text/css" rel="stylesheet">

    <script type="text/javascript" src="js/commonshow.js"></script>

    <script type="text/javascript" src="js/menu.js"></script>

    <script type="text/javascript">
	    function CreateTemplate(pathname)
	    {
	        if(confirm("您确定要编译" + pathname + "模板吗？\r\n\r\n当前操作可能要运行一段时间，在此期间不要进行其它操作。")) 
	        {
	            document.getElementById('success').style.display = 'block';
	            document.getElementById('Layer5').innerHTML='<BR /><table><tr><td valign=top><img border=0 src=images/ajax_loading.gif  /></td><td valign=middle style=font-size:14px;>正在编译'+pathname+'文件夹下的模板, <BR />请稍等...<BR /></td></tr></table><BR />';
	            window.location="?createtemplate=" + pathname;
	        }
	    }
	    
	    function DownloadTemplate(pathname)
	    {
	        if(confirm("您确定要下载" + pathname + "模板吗？\r\n\r\n当前操作可能要运行一段时间，在此期间不要进行其它操作。")) 
	        {
                window.location="?downloadtemplate=" + pathname;
            }
	    }
    </script>

</head>
<body leftmargin="5" topmargin="5" rightmargin="5" bottommargin="5">
    <form id="form1" runat="server">
    <div class="Navbutton" style="width: 98%;">
        <table cellspacing="1" cellpadding="4" align="left">
            <tr>
                <td>
                    <input title="选中/取消选中 本页所有Case" onclick="CheckAll(this.form)" type="checkbox" name="chkall"
                        id="chkall" />全选/取消全选
                    <cc1:Button ID="DelTemplates" runat="server" Text="删除选中模板" ButtonImgUrl="images/dell.gif"
                        OnClick="DelTemplates_Click" ScriptContent="document.getElementById('Layer5').innerHTML='<BR /><table><tr><td valign=top><img border=0 src=../images/ajax_loading.gif  /></td><td valign=middle style=font-size:14px;>正在删除选中模板, 请稍等...<BR /></td></tr></table><BR />';">
                    </cc1:Button>&nbsp;
                    <button class="ManagerButton" type="button" onclick="javascript:window.location.href='templatesnew.aspx';">
                        <img src="images/add.gif" />新建站点模板</button>
                </td>
            </tr>
        </table>
    </div>
    <cc1:DataGrid ID="DataGrid1" runat="server">
        <Columns>
            <asp:TemplateColumn HeaderText="选择">
                <ItemTemplate>
                    <input id="templateid" onclick="javascript:SH_SelectOne(this)" type="checkbox" value="<%# DataBinder.Eval(Container, "DataItem.templateid").ToString() %>"
                        name="templateid" />
                    <input type="hidden" name="temp<%# DataBinder.Eval(Container, "DataItem.templateid").ToString() %>"
                        value="<%# DataBinder.Eval(Container, "DataItem.directory").ToString() %>" />
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="templateid" HeaderText="ID [递增]" Visible="false"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="模板名称">
                <ItemStyle HorizontalAlign="Left" />
                <ItemTemplate>
                    &nbsp;<span id="<%# DataBinder.Eval(Container, "DataItem.directory").ToString() %>"
                        onmouseover="showMenu(this.id, 0, 0, 1, 0);" style="font-weight: bold">
                        <%# DataBinder.Eval(Container, "DataItem.name").ToString() %>&nbsp;
                        <img src="images/eye.gif" style="vertical-align: middle" />
                    </span>
                    <div id="<%# DataBinder.Eval(Container, "DataItem.directory").ToString() %>_menu"
                        style="display: none">
                        <img src="../templates/<%# DataBinder.Eval(Container, "DataItem.directory").ToString() %>/about.png"
                            onerror="this.src='images/none.gif'" />
                    </div>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="directory" HeaderText="存放路径"></asp:BoundColumn>
            <asp:BoundColumn DataField="copyright" HeaderText="版权"></asp:BoundColumn>
            <asp:BoundColumn DataField="author" HeaderText="作者"></asp:BoundColumn>
            <asp:BoundColumn DataField="createdate" HeaderText="创建日期" ReadOnly="true"></asp:BoundColumn>
            <asp:BoundColumn DataField="forver" HeaderText="适用系统版本" ReadOnly="true"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="">
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# CreateStr(DataBinder.Eval(Container, "DataItem.directory").ToString(),DataBinder.Eval(Container, "DataItem.name").ToString())%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateColumn>
        </Columns>
    </cc1:DataGrid>
    </form>
</body>
</html>
