<%@ page language="C#" autoeventwireup="true" codebehind="myNews.aspx.cs" inherits="Web.User.myNews" %>
<%@ Register Src="~/Module/pageNavi.ascx" TagPrefix="uc1" TagName="pageNavi" %>
<%@ Register Src="~/User/AuditingNav.ascx" TagPrefix="uc1" TagName="AuditingNav" %>
<!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="page-content">
        <div class="row">
            <div class="col-xs-12">
                <form id="Form1" method="post" runat="server">
                    <div class="list-func-box func-box">
                        <div class="tabbable">
                            <uc1:AuditingNav runat="server" id="AuditingNav" />
                        </div>
                        <div class="bd tab-content">
                            <div class="page-header clearfix">
                                <div class="pull-left">
                                    审核状态：
                    <asp:DropDownList ID="DDLpass" runat="server" CssClass="input-md" Width="80">
                        <asp:ListItem Text="<全部>" Value=""></asp:ListItem>
                        <asp:ListItem Text="待审" Value="0"></asp:ListItem>
                        <asp:ListItem Text="通过" Value="1"></asp:ListItem>
                        <asp:ListItem Text="不通过" Value="2"></asp:ListItem>
                    </asp:DropDownList>
                                    发布时间：<asp:TextBox ID="txtbegin" runat="server" CssClass="input-md" notNull="true" msgName="发布起始时间" MaxLength="19" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"></asp:TextBox>
                                    至：<asp:TextBox ID="txtend" runat="server" CssClass="input-md" notNull="true" msgName="发布结束时间" MaxLength="19" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"></asp:TextBox>&emsp;
                    <asp:DropDownList ID="SearchTypeSelectBox" runat="server" EnableViewState="False" CssClass="input-md" Width="70">
                        <asp:ListItem Value="intacttitle" Selected="True">标题</asp:ListItem>
                        <asp:ListItem Value="content">内容</asp:ListItem>
                        <%--<asp:ListItem Value="fullname">发布人</asp:ListItem>--%>
                    </asp:DropDownList>
                                    <asp:TextBox ID="SearchStrTextBox" runat="server" CssClass="input-md" MaxLength="25"></asp:TextBox>
                                    <asp:Button ID="btnSerach" class="btn btn-sm btn-primary" runat="server" Text="查 询" OnClientClick="return checkAll();" OnClick="Btn_Click" />
                                    <asp:Button ID="btnSave" class="btn btn-sm btn-primary" runat="server" Text="保 存" OnClick="Btn_Click"></asp:Button>
                                    <asp:HiddenField ID="MoveTargetBigClassID" runat="server" />
                                    <asp:HiddenField ID="MoveTargetMenuID" runat="server" />
                                    <asp:HiddenField ID="MoveObjectId" runat="server" />
                                    <asp:Button ID="btnMoveSave" runat="server" CssClass="btn btn-sm btn-primary" Text="MoveSave" OnClick="Btn_Click" UseSubmitBehavior="False" Style="display: none"></asp:Button>
                                </div>

                                <!--/action-field-->
                            </div>
                            <div class="function-bd">
                                <!--[if lte IE 7]><div style="zoom:1"><![endif]-->
                                <asp:HiddenField ID="hfidstr" runat="server" />
                                <asp:HiddenField ID="hftitlestr" runat="server" />
                                <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" class="table table-striped table-bordered table-hover table-sorting" 
                                    OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound" EmptyDataText="暂无数据..." OnSorting="GridView1_Sorting">
                                    <Columns>
                                        <asp:TemplateField HeaderStyle-CssClass="title text-center" ItemStyle-CssClass="text-center" ItemStyle-Width="36px">
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="cbAll" Text=" " runat="server" onclick="GridSelectAll('GridView1',this.checked)" />
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="cbthis" runat="server" Text=" "></asp:CheckBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="pkId" HeaderText="ID号" HeaderStyle-CssClass="hidden" ItemStyle-CssClass="hidden" FooterStyle-CssClass="hidden"></asp:BoundField>
                                        <asp:TemplateField HeaderText="标题" SortExpression="intactTitle">
                                            <ItemTemplate>
                                                <asp:Label ID="V" Visible="false" runat="server" Text="[过期]" ForeColor="Red"></asp:Label>
                                                <asp:Label ID="D" Visible="false" runat="server" Text="[抄]" ForeColor="Red"></asp:Label>
                                                <asp:Label ID="L" Visible="false" runat="server" Text="[链]" ForeColor="Red"></asp:Label>
                                                <span  data-placement="right" data-rel="popover" data-content="<%# Eval("intactTitle") %>" data-trigger="hover">
                                                <asp:HyperLink ID="intactTitle" runat="server" Text='<%# Eval("intactTitle") %>'
                                                    Target="_blank" NavigateUrl='<%# Eval("pkId", "../newsInfo.aspx?pkId={0}") %>'>
                                                </asp:HyperLink>
                                                    </span>
                                                <asp:Panel ID="StaticDiv" runat="server"  Visible="false" data-rel="popover" data-trigger="hover" data-placement="right" data-content="可能此条信息未审核通过或者设置了浏览权限、用户等级、链接标题等功能则不会静态化。" style="display: inline-block;">
                                                   <i class="fa fa-question-circle bigger-120 blue" ></i>
                                                </asp:Panel>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="所属栏目" SortExpression="menuName">
                                            <ItemTemplate>
                                                <asp:Label ID="menuLabel" runat="server" Text='<%# Eval("menuName") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="发布人" SortExpression="fullName">
                                            <ItemTemplate>
                                                <span data-placement="right" data-rel="popover" data-content="<%# "发布IP："+Eval("updateIp") %>" data-trigger="hover"><%# Eval("fullName") %></span>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="发布时间" ItemStyle-Width="100px" SortExpression="updateTime">
                                            <ItemTemplate>
                                                <span data-placement="right" data-rel="popover" data-content="<%# Eval("updateTime") %>" data-trigger="hover"> 
                                                    <asp:Label ID="lbtime" runat="server" Text='<%# Eval("updateTime", "{0:yyyy-M-d}") %>'></asp:Label>
                                                    </span>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="今日推荐" HeaderStyle-CssClass="title" Visible="false">
                                            <ItemTemplate>
                                                <asp:DropDownList ID="isRecommand" runat="server" SelectedValue='<%# Eval("isRecommand") %>'>
                                                    <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                                                    <asp:ListItem Value="1">推荐</asp:ListItem>
                                                </asp:DropDownList>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="click" HeaderText="阅读" SortExpression="click"></asp:BoundField>
                                        <asp:TemplateField HeaderText="固顶" SortExpression="isTop">
                                            <ItemTemplate>
                                                <asp:DropDownList ID="isTop" runat="server" SelectedValue='<%# Eval("isTop") %>'>
                                                    <asp:ListItem Value="0" Selected="True">取消</asp:ListItem>
                                                    <asp:ListItem Value="1">固顶</asp:ListItem>
                                                </asp:DropDownList>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="审核" SortExpression="passed">
                                            <ItemTemplate>
                                                <asp:DropDownList ID="pass" runat="server" SelectedValue='<%# Eval("passed") %>'>
                                                    <asp:ListItem Value="0" Selected="True">待审</asp:ListItem>
                                                    <asp:ListItem Value="1">通过</asp:ListItem>
                                                    <asp:ListItem Value="2">不通过</asp:ListItem>
                                                </asp:DropDownList>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="显示等级" SortExpression="gradeId">
                                            <ItemTemplate>
                                                <asp:DropDownList ID="grade" runat="server" SelectedValue='<%# Eval("gradeId") %>' DataValueField="pkId" DataTextField="name" DataSource="<%# dt_grade %>"></asp:DropDownList>
                                                <%--<asp:DropDownList ID="gradeDrop" runat="server" DataValueField="pkId" DataTextField="name" DataSource="<%# dv %>">
                                                </asp:DropDownList>--%>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="浏览权限" SortExpression="gate">
                                            <ItemTemplate>
                                                <asp:DropDownList ID="gate" runat="server" SelectedIndex='<%# Eval("gate") %>'>
                                                    <asp:ListItem Value="0" Selected="True">无限制</asp:ListItem>
                                                    <asp:ListItem Value="1">仅内网可见</asp:ListItem>
                                                    <asp:ListItem Value="2">仅登录可见</asp:ListItem>
                                                    <asp:ListItem Value="3">内网或登录可见</asp:ListItem>
                                                </asp:DropDownList>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="管理" HeaderStyle-CssClass="title" ItemStyle-CssClass="td-a">
                                            <ItemTemplate>
                                                <div class="action-buttons">
                                                    <asp:LinkButton ID="edit" runat="server" CommandName="edit" CommandArgument='<%#Eval("pkId") +"&"+Eval("Code")+"&"+Eval("bigClassId")+"&"+Eval("sourceMenuId") %>' data-toggle="tooltip" Visible="false" data-placement="bottom" title="编辑"><i class="ace-icon fa fa-pencil bigger-120 blue" ></i></asp:LinkButton>
                                                    <asp:LinkButton ID="edit1" runat="server" data-toggle="tooltip" data-placement="bottom" title="很抱歉，您没有权限编辑" Visible="false" Enabled="false"><i class="ace-icon fa fa-pencil bigger-120 grey"></i></asp:LinkButton>
                                                    <a href='manageReview.aspx?newsId=<%# Eval("pkId")%>' target="_blank" data-toggle="tooltip" data-placement="bottom" title="评论"><i class="ace-icon fa fa-edit bigger-120 blue" ></i></a>
                                                    <asp:LinkButton ID="lbmove" runat="server" data-toggle="tooltip" data-placement="bottom" Visible="false" title="移动"><i class="ace-icon fa fa-exchange bigger-120 pink" ></i></asp:LinkButton>
                                                    <asp:LinkButton ID="lbmove1" runat="server" CssClass="FBox3" data-toggle="tooltip" data-placement="bottom" title="对不起，您没有权限移动" Visible="false" Enabled="false"><i class="ace-icon fa fa-exchange bigger-120 grey" ></i></asp:LinkButton>
                                                    <asp:LinkButton ID="del" runat="server" Visible="false" CommandName="del" CommandArgument='<%#Eval("pkId") %>' data-toggle="tooltip" data-placement="bottom" title="删除" OnClientClick="javascript:return window.confirm('注意！您确定要删除此信息吗？');"><i class="ace-icon fa fa-trash bigger-120 red" ></i></asp:LinkButton>
                                                    <asp:LinkButton ID="del1" runat="server" CssClass="FBox3" data-toggle="tooltip" data-placement="bottom" title="对不起，您没有权限删除" Visible="false" Enabled="false"><i class="ace-icon fa fa-trash-o bigger-120 grey" ></i></asp:LinkButton>
                                                </div>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--<asp:BoundField Visible="False" DataField="grade" HeaderText="等级"></asp:BoundField>
                                        <asp:BoundField Visible="False" DataField="useListTitle" HeaderText="useListTitle"></asp:BoundField>
                                        <asp:BoundField Visible="False" DataField="listTitle" HeaderText="listTitle"></asp:BoundField>
                                        <asp:BoundField Visible="False" DataField="Code" HeaderText="TemplateCode"></asp:BoundField>
                                        <asp:BoundField Visible="False" DataField="bigClassId" HeaderText="bigClassId"></asp:BoundField>
                                        <asp:BoundField Visible="False" DataField="sourceMenuId" HeaderText="menuId"></asp:BoundField>
                                        <asp:BoundField Visible="False" DataField="isDuplicated" HeaderText="isDuplicated"></asp:BoundField>
                                        <asp:BoundField Visible="False" DataField="duplicatedPkId" HeaderText="duplicatedPkId"></asp:BoundField>
                                        <asp:BoundField DataField="isStatic" Visible="false" HeaderText="是否静态化" HeaderStyle-CssClass="title"></asp:BoundField>
                                        <asp:BoundField DataField="staticUrl" Visible="false" HeaderText="静态化URL" HeaderStyle-CssClass="title"></asp:BoundField>--%>
                                    </Columns>
                                </asp:GridView>
                                <div class="grid-pager">
                                    <uc1:pageNavi runat="server" id="pageNavi" dataCtlName="GridView1" />
                                </div>
                                <!--[if lte IE 7]></div><![endif]-->
                            </div>
                        </div>
                    </div>
                </form>
                <!--/bd-->
            </div>
        </div>
    </div>
    <!--#include file = "../Css/foot.htm" -->
     <script type="text/javascript" src="../Wpedt/My97DatePicker/WdatePicker.js"></script>
    <script language="javascript" type="text/javascript">
        //防止用户恶意保存
        jQuery(function ($) {

            $("#btnSave").click(function () {
                //return confirm("您确定要保存列表吗？");
                if (GridSelectCheck('GridView1', true)) {
                    //加载load特效（防止在生成静态页阶段重复点击按钮） 不显示弹出层的关闭按钮，按ESC来关闭弹出层
                    $.fancybox({
                        'type': 'image',
                        'width': 50,
                        'height': 50,
                        'hideOnOverlayClick': false,
                        'padding': '0',
                        'scrolling': 'no',
                        'enableEscapeButton': 'true',
                        'showCloseButton': false,
                        'href': '../images/resfile/loading.gif'
                    });
                    return true;
                }
                else {
                    return false;
                }
            });

            //设置“最近发布”的样式为选中效果。
            document.getElementById("myNews").className = "active";
        });

        //单个移动
        function MoveSave(menuID, oid) {
            //改用弹出层，因为201409发布的最新ghome开始不支持showModalDialog()
            $.fancybox({
                'type': 'iframe',
                'width': 400,
                'height': 350,
                'hideOnOverlayClick': false,
                'href': 'MoveSaveForSingle.aspx?menuID=' + menuID + '&oid=' + oid
            });
            //showModalDialog("MoveSaveForSingle.aspx?menuID=" + menuID + "&oid=" + oid, window, "dialogWidth:420px; dialogHeight:350px; status:0");
        }

        function CallMoveSubmit() {
            //加载load特效（防止在生成静态页阶段重复点击按钮） 不显示弹出层的关闭按钮，按ESC来关闭弹出层
            $.fancybox({
                'type': 'image',
                'width': 50,
                'height': 50,
                'hideOnOverlayClick': false,
                'padding': '0',
                'scrolling': 'no',
                'enableEscapeButton': 'true',
                'showCloseButton': false,
                'href': '../images/resfile/loading.gif'
            });
            $("#btnMoveSave").click();
        }

        //选中背景特效
        $(function () {
            $('.text-center input').click(function () {
                $(this).parents('tr').toggleClass('active');
            })
            $('.title.text-center input').click(function () {

                if ($('.list-table tr:first').hasClass('active')) {
                    $('.list-table tr').addClass('active');
                } else {
                    $('.list-table tr').removeClass('active');
                }
            })
            $('.table select').change(function () {
                //背景选中
                if ($(this).parents('tr').hasClass('active')) {

                } else {
                    $(this).parents('tr').toggleClass('active');
                }

                //复选框选中
                var checkbox = $(this).parents("tr").find("input");
                for (var i = 0; i < checkbox.length; i++) {
                    if (checkbox[i].type == 'checkbox') {
                        checkbox[i].checked = true;
                    }
                }
            })
        })

        function checkAll() {
            //验证
            return checkAllValidate();
        }
    </script>
</body>
</html>
