PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/admin/Settings/Rules.aspx

#
ASP.NET | 192 lines | 177 code | 15 blank | 0 comment | 2 complexity | 3dcdb24a36cb81ea12467da1beb00560 MD5 | raw file
  1<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="Rules.aspx.cs" Inherits="admin.Settings.Rules" %>
  2<%@ Import Namespace="Resources"%>
  3<%@ Register src="Menu.ascx" tagname="TabMenu" tagprefix="menu" %>
  4
  5<asp:Content ID="Content1" ContentPlaceHolderID="cphAdmin" Runat="Server">
  6    <script type="text/javascript">
  7
  8        function ResetCounters(filterName) {
  9            var dto = { "filterName": filterName };
 10            $.ajax({
 11                url: SiteVars.ApplicationRelativeWebRoot + "admin/AjaxHelper.aspx/ResetCounters",
 12                data: JSON.stringify(dto),
 13                type: "POST",
 14                contentType: "application/json; charset=utf-8",
 15                dataType: "json",
 16                beforeSend: onAjaxBeforeSend,
 17                success: function (result) {
 18                    var rt = result.d;
 19                    if (rt.Success) {
 20                        LoadCustomFilters();
 21                        ShowStatus("success", rt.Message);
 22                    }
 23                    else {
 24                        ShowStatus("warning", rt.Message);
 25                    }
 26                }
 27            });
 28            return false;
 29        }
 30    </script>
 31
 32	<div class="content-box-outer">
 33		<div class="content-box-right">
 34			<menu:TabMenu ID="TabMenu1" runat="server" />
 35		</div>
 36		<div class="content-box-left">
 37            <h1 style="border:none;"><%=labels.rules %> & <%=labels.filters %></h1>
 38            <h2><%=labels.rules%></h2>
 39            <ul class="fl leftaligned">
 40                <li>
 41                    <label class="lbl" <%=ddWhiteListCount.ClientID %>><%=labels.addToWhiteList%></label>
 42                    <asp:DropDownList runat="server" ID="ddWhiteListCount">
 43                        <asp:ListItem Text="0" />
 44                        <asp:ListItem Text="1" />
 45                        <asp:ListItem Text="2" />
 46                        <asp:ListItem Text="3" />
 47                        <asp:ListItem Text="5" />
 48                    </asp:DropDownList> 
 49                    <span><%=labels.authorApproved%></span> 
 50                    <span class="insetHelp"><%=labels.toDisableSetTo0 %></span>
 51                </li>
 52                <li>
 53                    <span class="filler"></span>
 54                    <asp:CheckBox runat="server" ID="cbAddIpToWhitelistFilterOnApproval" />
 55                    <label for="<%=cbAddIpToWhitelistFilterOnApproval.ClientID %>"><%=labels.whitelistIpOnCommentApproval%></label>
 56                </li>
 57                <li>
 58                    <label class="lbl" for="<%=ddBlackListCount.ClientID %>"><%=labels.commentsBlacklist%></label>
 59                    <asp:DropDownList runat="server" ID="ddBlackListCount">
 60                        <asp:ListItem Text="0" />
 61                        <asp:ListItem Text="1" />
 62                        <asp:ListItem Text="2" />
 63                        <asp:ListItem Text="3" />
 64                        <asp:ListItem Text="5" />
 65                    </asp:DropDownList> 
 66                    <span><%=labels.authorRejected%></span>
 67                    <span class="insetHelp"><%=labels.toDisableSetTo0 %></span>
 68                </li>
 69                <li>
 70                    <span class="filler"></span>
 71                    <asp:CheckBox runat="server" ID="cbTrustAuthenticated" />
 72                    <label for="<%=cbTrustAuthenticated.ClientID %>"><%=labels.trustAuthenticated%></label>
 73                    <span class="insetHelp"><%=labels.alwaysTrust%></span>
 74                </li>
 75                <li>
 76                    <span class="filler"></span>
 77                    <asp:CheckBox runat="server" ID="cbBlockOnDelete" />
 78                    <label for="<%=cbBlockOnDelete.ClientID %>"><%=labels.commentsBlockOnDelete%></label>
 79                    <span class="insetHelp"><%=labels.authorBlocked%></span>
 80                </li>
 81                <li>
 82                    <span class="filler"></span>
 83                    <asp:CheckBox runat="server" ID="cbAddIpToBlacklistFilterOnRejection" />
 84                    <label for="<%=cbAddIpToBlacklistFilterOnRejection.ClientID %>"><%=labels.blacklistIpOnCommentRejection%></label>
 85                </li>
 86            </ul>
 87
 88            <h2><%=labels.filters%></h2>
 89            <ul class="fl">
 90                <li>
 91                    <asp:DropDownList ID="ddAction" runat="server" CssClass="txt">
 92                        <asp:ListItem Text="<%$ Resources:labels, block %>" Value="Block" Selected=true></asp:ListItem>
 93                        <asp:ListItem Text="<%$ Resources:labels, allow %>" Value="Allow" Selected=false></asp:ListItem>
 94                        <asp:ListItem Text="<%$ Resources:labels, delete %>" Value="Delete" Selected=false></asp:ListItem>
 95                    </asp:DropDownList>
 96                    <asp:DropDownList ID="ddSubject" runat="server" CssClass="txt">
 97                        <asp:ListItem Text="<%$ Resources:labels, ip %>" Value="IP" Selected=true></asp:ListItem>
 98                        <asp:ListItem Text="<%$ Resources:labels, author %>" Value="Author" Selected=false></asp:ListItem>
 99                        <asp:ListItem Text="<%$ Resources:labels, website %>" Value="Website" Selected=false></asp:ListItem>
100                        <asp:ListItem Text="<%$ Resources:labels, email %>" Value="Email" Selected=false></asp:ListItem>
101                        <asp:ListItem Text="<%$ Resources:labels, comment %>" Value="Comment" Selected=false></asp:ListItem>
102                    </asp:DropDownList>
103                    <asp:DropDownList ID="ddOperator" runat="server" CssClass="txt">
104                        <asp:ListItem Text="<%$ Resources:labels, eqls %>" Value="Equals" Selected=true></asp:ListItem>
105                        <asp:ListItem Text="<%$ Resources:labels, contains %>" Value="Contains" Selected=false></asp:ListItem>
106                    </asp:DropDownList>
107                    <asp:TextBox ID="txtFilter" runat="server" CssClass="txt" MaxLength="250" Width="300px"></asp:TextBox>
108                    <asp:Button ID="btnAddFilter" class="btn" runat="server" Text="<%$ Resources:labels, addFilter %>" OnClick="btnAddFilter_Click"/>
109                    <span runat="Server" ID="FilterValidation" style="color:Red"></span>
110                </li>
111            </ul>
112
113            <div style="border:1px solid #f3f3f3; margin:0 0 20px;">
114                <asp:GridView ID="gridFilters" 
115                        PageSize="10" 
116                        BorderColor="#f8f8f8" 
117                        BorderStyle="solid" 
118                        BorderWidth="1px"
119                        cellpadding="2"
120                        runat="server"  
121                        width="100%"
122                        gridlines="None"
123                        AlternatingRowStyle-BackColor="#f8f8f8" 
124                        HeaderStyle-BackColor="#f3f3f3"
125                        AutoGenerateColumns="False"
126                        AllowPaging="True"
127                        datakeynames="ID"
128                        OnPageIndexChanging="gridView_PageIndexChanging"
129                        AllowSorting="True">
130                        <Columns>
131                        <asp:BoundField DataField = "ID" Visible="false" />
132                        <asp:TemplateField HeaderText="<%$ Resources:labels, action %>" HeaderStyle-HorizontalAlign="Left">
133                            <ItemTemplate>
134                                <%# Eval("Action") %> 
135                            </ItemTemplate>
136                        </asp:TemplateField>
137                
138                        <asp:TemplateField HeaderText="">
139                            <ItemTemplate>
140                                <%=labels.commentsWhere %>
141                            </ItemTemplate>
142                        </asp:TemplateField>
143                
144                        <asp:TemplateField HeaderText="">
145                            <ItemTemplate>
146                                <%# Eval("Subject") %>
147                            </ItemTemplate>
148                        </asp:TemplateField>
149                
150                        <asp:TemplateField HeaderText="">
151                            <ItemTemplate>
152                                <%# Eval("Operator") %>
153                            </ItemTemplate>
154                        </asp:TemplateField>
155                
156                        <asp:TemplateField HeaderText="<%$ Resources:labels, filter %>" HeaderStyle-HorizontalAlign="Left">
157                            <ItemTemplate>
158                                    <%# Eval("Filter") %> 
159                            </ItemTemplate>
160                        </asp:TemplateField>
161                        
162                        <asp:TemplateField ShowHeader="False" ItemStyle-VerticalAlign="middle" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="25">
163                            <ItemTemplate>
164                                <asp:ImageButton ID="btnDelete" runat="server" ImageAlign="middle" CausesValidation="false" ImageUrl="~/admin/images/action-delete.png" OnClick="btnDelete_Click" CommandName="btnDelete" AlternateText="<%$ Resources:labels, delete%>" />
165                            </ItemTemplate>
166                        </asp:TemplateField>
167                        </Columns>
168                        <pagersettings Mode="NumericFirstLast" position="Bottom" pagebuttoncount="20" />
169                        <PagerStyle HorizontalAlign="Center"/>
170                </asp:GridView>
171            </div>
172            <h2><%=labels.antiSpamServices %></h2>
173
174            <div id="Container"></div>
175        
176            <div style="margin:0 0 20px;">
177                <asp:CheckBox runat="server" ID="cbReportMistakes" />
178                <span><%=labels.reportMistakesToService %></span>
179            </div>
180
181            <div class="action_buttons">
182                <asp:Button runat="server" class="btn primary" ID="btnSave" Text="Save settings" />
183                <span class="loader">&nbsp;</span>
184            </div>
185            
186		</div>
187	</div> 
188
189    <script type="text/javascript">
190        LoadCustomFilters();
191    </script>
192</asp:Content>