PageRenderTime 28ms CodeModel.GetById 18ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/admin/Tracking/referrers.aspx

#
ASP.NET | 119 lines | 109 code | 10 blank | 0 comment | 2 complexity | fbcbd17dee7e4bb0ce8726fd3b4ecb53 MD5 | raw file
  1<%@ Page Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true"
  2    CodeFile="referrers.aspx.cs" Inherits="Admin.Tracking.Referrers" Title="Referrers" %>
  3<%@ Register src="Menu.ascx" tagname="TabMenu" tagprefix="menu" %>
  4
  5<asp:Content ID="Content1" ContentPlaceHolderID="cphAdmin" runat="Server">
  6    <script type="text/javascript" src="../jquery.colorbox.js"></script>
  7    <script type="text/javascript">
  8        $(document).ready(function () {
  9            $(".showSettings").colorbox({ width: "400px", inline: true, href: "#settings" });
 10        });
 11
 12        function closeOverlay() {
 13            $.colorbox.close();
 14        }
 15
 16        function SaveSettings() {
 17
 18            var dto = {
 19                "enable": $("[id$='_cbEnableReferrers']").attr('checked'),
 20                "days": $("[id$='_txtNumberOfDays']").val()
 21            };
 22
 23            $.ajax({
 24                url: SiteVars.ApplicationRelativeWebRoot + "admin/Tracking/referrers.aspx/Save",
 25                data: JSON.stringify(dto),
 26                type: "POST",
 27                contentType: "application/json; charset=utf-8",
 28                dataType: "json",
 29                beforeSend: onAjaxBeforeSend,
 30                success: function (result) {
 31                    var rt = result.d;
 32                    if (rt.Success) {
 33                        LoadRoles();
 34                        ShowStatus("success", rt.Message);
 35                    }
 36                    else {
 37                        ShowStatus("warning", rt.Message);
 38                    }
 39                }
 40            });
 41
 42            closeOverlay();
 43            return false;
 44        }
 45    </script>
 46
 47	<div class="content-box-outer">
 48		<div class="content-box-right">
 49			<menu:TabMenu ID="TabMenu" runat="server" />
 50		</div>
 51        <div class="content-box-left">
 52            <h1><%=Resources.labels.referrers %><a href="#" class="showSettings"><%=Resources.labels.settings %></a></h1>
 53
 54            <div style="display:none;">
 55            <div id="settings" class="overlaypanel">
 56                <h2><%=Resources.labels.settings %></h2>
 57                <ul class="fl" style="margin:0;">
 58                    <li>
 59                        <asp:CheckBox runat="Server" ID="cbEnableReferrers" />
 60                        <label for=""><%=Resources.labels.enableReferrerTracking %></label>
 61                    </li>
 62                    <li>
 63                        <label class="lbl" for="<%= txtNumberOfDays.ClientID %>"><%= Resources.labels.numberOfDaysToKeep %></label>
 64                        <asp:TextBox ID="txtNumberOfDays" runat="server"></asp:TextBox><br />
 65                    </li>
 66                    <li>
 67                        <input type="submit" class="btn primary rounded" value="<%=Resources.labels.saveSettings %>" onclick="return SaveSettings();" />
 68                         <%=Resources.labels.or %> <a href="#" onclick="closeOverlay();"><%=Resources.labels.cancel %></a>
 69                    </li>
 70                </ul>
 71            </div>
 72            </div>
 73
 74            <div ID="infoPanel" class="info" runat="server"></div>
 75
 76            <asp:Panel ID="referrersPanel" runat="server">
 77                <div style="margin-bottom: 10px">
 78                    <asp:DropDownList runat="server" ID="ddlDays" AutoPostBack="true" Style="text-transform: capitalize"
 79                        DataTextFormatString="{0:d}">
 80                    </asp:DropDownList>
 81                    <label class="lbl" style="width:200px; display:inline" for="<%=ddlDays.ClientID %>"><%=Resources.labels.selectDay %></label>
 82                </div>
 83                <h2><%=Resources.labels.referrers%></h2>
 84                <asp:GridView runat="server" ID="grid" BorderColor="#f8f8f8" BorderStyle="solid"
 85                BorderWidth="1px" RowStyle-BorderWidth="0" RowStyle-BorderStyle="None" GridLines="None"
 86                Width="100%" AlternatingRowStyle-BackColor="#f8f8f8" AlternatingRowStyle-BorderColor="#f8f8f8"
 87                HeaderStyle-BackColor="#F1F1F1" CellPadding="3" ShowFooter="true" AutoGenerateColumns="False"
 88                EnableViewState="false">
 89                <Columns>
 90                    <asp:HyperLinkField HeaderText="<%$ Resources:labels, referrer %>" FooterStyle-HorizontalAlign="left"
 91                        DataNavigateUrlFields="url" Target="_blank" DataTextField="shortUrl" HeaderStyle-HorizontalAlign="left" />
 92                    <asp:HyperLinkField HeaderText="<%$ Resources:labels, link %>" FooterStyle-HorizontalAlign="left"
 93                        DataNavigateUrlFields="target" Target="_blank" DataTextField="shortTarget" HeaderStyle-HorizontalAlign="left" />
 94                    <asp:BoundField HeaderText="Hits" DataField="hits" HeaderStyle-HorizontalAlign="center"
 95                        ItemStyle-HorizontalAlign="center" ItemStyle-Width="40" />
 96                </Columns>
 97                <FooterStyle Font-Bold="true" HorizontalAlign="center" />
 98            </asp:GridView>
 99            </asp:Panel>
100            <br />
101            <asp:Panel ID="possibleSmapPanel" runat="server">
102                <h2><%=Resources.labels.possibleSpam%></h2>
103                <asp:GridView runat="server" ID="spamGrid" BorderColor="#f8f8f8" BorderStyle="solid"
104                    BorderWidth="1px" RowStyle-BorderWidth="0" RowStyle-BorderStyle="None" GridLines="None"
105                    Width="100%" AlternatingRowStyle-BackColor="#f8f8f8" AlternatingRowStyle-BorderColor="#f8f8f8"
106                    HeaderStyle-BackColor="#F1F1F1" CellPadding="3" ShowFooter="true" AutoGenerateColumns="False"
107                    EnableViewState="false">
108                    <Columns>
109                        <asp:HyperLinkField HeaderText="<%$ Resources:labels, referrer %>" FooterStyle-HorizontalAlign="left"
110                            DataNavigateUrlFields="url" Target="_blank" DataTextField="shortUrl" HeaderStyle-HorizontalAlign="left" />
111                        <asp:BoundField HeaderText="Hits" DataField="hits" HeaderStyle-HorizontalAlign="center"
112                            ItemStyle-HorizontalAlign="center" ItemStyle-Width="40" />
113                    </Columns>
114                    <FooterStyle Font-Bold="true" HorizontalAlign="center" />
115                </asp:GridView>
116            </asp:Panel>
117        </div>
118    </div>
119</asp:Content>