<%@ Page Title="" Language="C#" MasterPageFile="~/Management/SiteManage.Master" AutoEventWireup="true" CodeBehind="TitleOriginalRule.aspx.cs" Inherits="Amr.SuperSiteGroup.Web.Management.TitleOriginalRule" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="right" style="text-align: center; margin-top: 10px;">
        <table width="100%" border="0" cellspacing="1" cellpadding="1" class="edit">
            <tr>
                <td class="title_edit">
                    <h1 style="float: left">
                        标题原创规则设置</h1>
                </td>
            </tr>
            <tr>
                <td class="edit_main">
                            <table width="100%" border="0" cellspacing="1" cellpadding="1" class="table_list">
                                <tr class="tr1">
                                    <td colspan="2">
                                        <asp:Label ID="laTitle" runat="server" Text="添加标题原创规则"></asp:Label><br />
                                        <asp:Label ID="laErrorInfo" runat="server" ForeColor="Red"></asp:Label>
                                        <asp:Label ID="laSuccessInfo" runat="server" ForeColor="Green"></asp:Label>
                                    </td>
                                        </tr>
                                <tr>
                                    <td>
                                        <div align="right">
                                            规则名称<font color="red">*</font>：</div></td>
                                    <td align="left">
                                                    <asp:TextBox ID="tbName" runat="server" Width="80" Wrap="False" />
                                                    <validation targetid="<%=tbName.ClientID%>" targetname="节点规则名称" type="text" />
                                                </td>
                                        </tr>
                                                                        <tr>
                                    <td>
                                        <div align="right">
                                            操作类型：</div>
                                    </td>
                                    <td align="left">
                                                    <asp:DropDownList ID="ddlOperationType" runat="server">
                                                        <asp:ListItem Value="0">在标题分隔符前加原创词汇</asp:ListItem>
                                                        <asp:ListItem Value="1">在标题分隔符后加原创词汇</asp:ListItem>
                                                        <asp:ListItem Value="2">替换整个标题为原创词汇（慎用）</asp:ListItem>
                                                    </asp:DropDownList>
                                                </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div align="right">
                                            分隔符：</div>
                                    </td>
                                    <td align="left">
                                                    <asp:TextBox ID="tbDelimiter" runat="server" Width="80" 
                                                Wrap="False" />
                                            <br />
                                                    指定分隔符是用于提取标题正文，比如标题为： 新闻标题-站点标题后缀，此处分隔符为&quot;-&quot;，我们可以选择类型为在分隔符后面加关键字，结果则为：新闻标题-自定义关键字</td>
                                </tr>
                                <tr>
                                    <td>
                                        <div align="right">
                                            词汇数量<font color="red">*</font>：
                                            </div>
                                    </td>
                                    <td align="left">
                                                    <asp:TextBox ID="tbCount" runat="server" Width="80" Wrap="False" >3</asp:TextBox> <a href="TitleOriginalVocabulary.aspx">原创词汇管理</a>
                                                    <validation targetid="<%=tbCount.ClientID%>" targetname="操作索引" type="number" />
                                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div align="right">
                                            词汇类别：
                                            </div>
                                    </td>
                                    <td align="left">
                                        <asp:DropDownList ID="ddlCategory" runat="server">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div align="right">
                                            优先级<font color="red">*</font>：</div>
                                    </td>
                                    <td align="left">
                                                    <asp:TextBox ID="tbPriority" runat="server" Width="80" Wrap="False" >10</asp:TextBox>
                                                    <validation targetid="<%=tbPriority.ClientID%>" targetname="优先级" type="number" />
                                                    <br />
                                                    请指定优先级，优先级高的规则先生效，数字越小代表优先级越高。</td>
                                </tr>
                                <tr>
                                    <td>
                                        <div align="right">
                                            选项：</div>
                                    </td>
                                    <td align="left">
                                        <asp:CheckBox ID="cbIsEnable" CssClass="checkbox" runat="server" 
                                            Text="是否激活" Checked="True" />
                                        &nbsp;<asp:CheckBox ID="cbIsDefault" CssClass="checkbox" runat="server" 
                                            Text="是否共享（将在站群显示）" />
                                        </td>
                                </tr>
                                <tr>
                            <td>
                                <div align="right">
                                    页面匹配：</div>
                            </td>
                            <td align="left">
                                <fieldset>
                                    <legend>指定页面匹配</legend>
                                    <asp:CheckBox ID="cbMatchUrl" CssClass="checkbox" runat="server" onclick="$('#matchUrlParameter').toggle()"
                                        Text="规则用于指定页面（当前规则只对指定的页面生效）" />
                                    <br />
                                    <div id="matchUrlParameter" style="display: <%=cbMatchUrl.Checked?string.Empty:"none"%>">
                                        <asp:CheckBox ID="cbExactMatch" CssClass="checkbox" runat="server" Text="是否精确匹配指定网址（对指定页面地址采取精确匹配或者模糊匹配，模糊匹配只要页面网址包含指定网址【这里是指原网页地址】，则规则生效）" />
                                        <br />
                                        指定地址：
                                        <asp:TextBox ID="tbUrl" runat="server" Width="80%" Wrap="False" />
                                    </div>
                                </fieldset>
                            </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <asp:LinkButton ID="lbSubmit" runat="server" 
                                            Text="【提交】" onclick="lbSubmit_Click"  OnClientClick="return validateForm()" />
                                        &nbsp;<asp:LinkButton ID="lbCancel" runat="server" Text="【取消】" onclick="lbCancel_Click"/>
                                    </td>
                                </tr>
                            </table>
                </td>
            </tr>
        </table>
    </div>
    <div class="clear">
    </div>
        <div class="right" style="text-align: center; margin-top: 10px;">
        <div class="clear">
        </div>
        <table width="100%" border="0" cellspacing="1" cellpadding="1" class="edit">
            <tr>
                <td class="title_edit">
                    <h1 style="float: left">
                        标题原创规则列表</h1>
                </td>
            </tr>
            <tr>
                <td class="edit_main">
                    <asp:GridView ID="gvTitleOriginalRules" runat="server" AutoGenerateColumns="False" 
                        GridLines="None" CssClass="table_list" Width="100%" 
                        EnableModelValidation="True">
                        <Columns>
                            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbEdit" runat="server" CausesValidation="False"
                                        Text="【编辑】" CommandArgument='<%# Bind("RuleId") %>' onclick="lbEdit_Click"></asp:LinkButton>
                                    &nbsp;<asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandArgument='<%# Bind("RuleId") %>'
                                        Text="【删除】" onclick="lbDelete_Click" OnClientClick="if(confirm('确认删除记录?')){eval(this.attributes['href'].value)}else{return false}"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="RuleId" HeaderText="编号" 
                                SortExpression="RuleId" />
                        <asp:BoundField DataField="Name" HeaderText="规则名称" SortExpression="Name" />
                        <asp:CheckBoxField DataField="IsEnable" HeaderText="是否激活" SortExpression="IsEnable" />
                        <asp:CheckBoxField DataField="IsDefault" HeaderText="是否共享" SortExpression="IsDefault" />
                        <asp:BoundField DataField="Priority" HeaderText="优先级" SortExpression="Priority" />
                        <asp:BoundField DataField="Delimiter" HeaderText="分隔符" SortExpression="Delimiter" />
                        <asp:BoundField DataField="Count" HeaderText="词汇数量" SortExpression="Count" />
                        </Columns>
                        <HeaderStyle CssClass="tr1" />
                        <RowStyle CssClass="tr_a" />
                        <AlternatingRowStyle CssClass="tr_b" />
                        <EmptyDataTemplate>
                            没有数据，请先添加！
                        </EmptyDataTemplate>
                        <FooterStyle CssClass="dg_header" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
    <div class="clear" style="margin-top: 10px;">
    </div>
</asp:Content>
