<%@ Page Language="c#" Inherits="Web.Wpdcc.manageTempPage" CodeBehind="manageTempPage.aspx.cs" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>网站模版管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file = "../Css/head.htm" -->
</head>
<body>
    <div class="main-content-inner">
        <!-- #section:basics/content.breadcrumbs -->
        <div class="breadcrumbs" id="breadcrumbs">
            <script type="text/javascript">
                try { ace.settings.check('breadcrumbs', 'fixed') } catch (e) { }
            </script>
            <ul class="breadcrumb">
                <li><i class="ace-icon fa  fa-desktop"></i><a href="welcome.aspx">&nbsp;主页</a></li>
                <li>模板管理</li>
                <li class="active" id="tpname"></li>
            </ul>
            <!-- /.breadcrumb -->
            <!-- /section:basics/content.searchbox -->
        </div>
        <!-- /section:basics/content.breadcrumbs -->
        <div class="page-content">
            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->                    
                        <form id="manage" method="post" runat="server">
                            <div class="bd">
                                <div class="page-header clearfix">
                                    <div class="search-box pull-right">
                                        模板名称：<asp:TextBox ID="txtKey" class="input-md" runat="server"></asp:TextBox>
                                        <asp:Button ID="btnSearch" CssClass="btn btn-sm btn-primary" runat="server" Text="搜 索" OnClick="btn_Click" />
                                    </div>
                                    <!--/search-box-->
                                    <div class="action-field">
                                        <asp:Button ID="btnAdd" CssClass="btn btn-sm btn-primary" runat="server" Text="添加模板" OnClick="btn_Click" />
                                    </div>
                                    <!--/action-field-->
                                </div>
                                <div class="function-bd">
                                    <!--[if lte IE 7]><div style="zoom:1"><![endif]-->
                                    <asp:GridView ID="GridView1" class="table table-striped table-bordered table-hover" runat="server" AutoGenerateColumns="False"
                                        OnRowCommand="GridView1_RowCommand"  OnRowDataBound="GridView1_RowDataBound">
                                        <Columns>
                                            <asp:BoundField DataField="pkId" HeaderText="ID" HeaderStyle-CssClass="title"></asp:BoundField>
                                            <asp:BoundField DataField="name" HeaderText="模板名称" HeaderStyle-CssClass="title"></asp:BoundField>
                                            <asp:TemplateField HeaderText="操作" HeaderStyle-CssClass="title">
                                                <ItemTemplate>
                                                    <div class="action-buttons">
                                                        <asp:LinkButton ID="editt" runat="server"  CommandName="edit" CommandArgument='<%# Eval("pkId")%>'  data-toggle="tooltip" data-placement="bottom" title="编辑"><i class="ace-icon fa fa-pencil bigger-120 blue"></i></asp:LinkButton>
                                                        <asp:LinkButton ID="copyy" runat="server" CommandName="copy1" CommandArgument='<%# Eval("pkId")%>'  data-toggle="tooltip" data-placement="bottom" title="复制"><i class="ace-icon fa fa-copy bigger-120 orange"></i></asp:LinkButton>
                                                        <asp:LinkButton ID="preview" runat="server" data-toggle="tooltip" data-placement="bottom" title="预览"><i class="ace-icon fa fa-eye bigger-120 green"></i></asp:LinkButton>&nbsp;
                                                        <asp:LinkButton ID="recover" runat="server" CausesValidation="False" CommandName="recover" CommandArgument='<%# Eval("pkId")%>'  data-toggle="tooltip" data-placement="bottom" title="恢复上次设置"
                                                            OnClientClick="return confirm('您确定要恢复上次设置吗？这将会覆盖当前模板数据！');"><i class="ace-icon fa fa-reply bigger-120 grey"></i></asp:LinkButton>&nbsp;
                                                        <asp:LinkButton ID="dell" runat="server" CausesValidation="False" CommandName="del1"  CommandArgument='<%# Eval("pkId")  +","+ Eval("name") %>'  data-toggle="tooltip" data-placement="bottom" title="删除" 
                                                            OnClientClick="return confirm('您确定要删除当前模板吗？');" ><i class="ace-icon fa fa-trash-o bigger-120 red"></i></asp:LinkButton>
                                                        <asp:LinkButton ID="lkbapply" runat="server" CssClass="FBox" href='<%# "menuApply.aspx?type="+Eval("layoutTemplateType")+"&Id="+ Eval("pkid") %>'  data-toggle="tooltip" data-placement="bottom" title="引用"><i class="ace-icon fa fa-share-alt bigger-120 purple" ></i></asp:LinkButton>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField Visible="false" DataField="isSystem" HeaderText="是否系统模板" HeaderStyle-CssClass="title"></asp:BoundField>
                                            <asp:BoundField Visible="false" DataField="adminId" HeaderText="管理员Id" HeaderStyle-CssClass="title"></asp:BoundField>
                                        </Columns>
                                    </asp:GridView>
                                    <!--[if lte IE 7]></div><![endif]-->
                                </div>
                                <!--/function-bd-->
                            </div>
                        </form>
                    
                    <!-- PAGE CONTENT ENDS -->
                </div>
            </div>
        </div>
        <!-- /.page-content -->
    </div>
    <!--#include file = "../Css/foot.htm" -->
    
    <script lang="javascript" type="text/javascript">
        jQuery(function ($) {

            var type=<%=layoutTemplateType.ToString() %> ;
            if (type==2) {
                $("#tpname").text('频道页模板');
            }
            if (type==1) {
                $("#tpname").text('更多页模板');
            }
            if (type==0){
                $("#tpname").text('新闻页模板');
            }
            
            //公用弹出层参数
            $(".FBox").click().fancybox({
                'width': 500,
                'height': 360,
                'hideOnOverlayClick': false,
                'type': 'iframe',
                'padding': '0'
            });
        });

        function preview(pkId) {
            window.open("../previewEffect.aspx?pkId=" + pkId, "", "left=350,top=100,width=800,height=600,status=1,resizable=1,scrollbars=1");
        }

    </script>
</body>
</html>
