<%@ Control Language="C#" %>
<%@ Import Namespace="CommunityServer.Controls" %>
<%@ Import Namespace="CommunityServer.Components" %>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>
<script runat="server">
	int i = 1;

	SiteStatistics stats;
	void Page_Load()
	{
		stats = CSContext.Current.Statistics;
	}
</script>

<h4 class="CommonSubTitle">
	<CS:ResourceLabel runat="server" ResourceName="Moderator_Statistics_Title" />
</h4>

<div>
	<%= string.Format(ResourceManager.GetString("Moderator_Statistics_Format"), stats.TotalModerators.ToString("n0"), stats.TotalModeratedPosts.ToString("n0"), stats.AverageModeratedPostsPerModerator.ToString("n0")) %>
</div>

<div>
	<asp:Repeater id="TopModerators" runat="server" Visible="False">
		<HeaderTemplate>
			<p /><CS:ResourceLabel runat="server" ResourceName="Moderator_Statistics_TopModerators" /><br>
		</HeaderTemplate>
		<ItemTemplate>
			<%# (i++).ToString() %>.
			<a href='<%# Globals.GetSiteUrls().UserProfile( (string) DataBinder.Eval(Container.DataItem, "Username") ) %>'><%# DataBinder.Eval(Container.DataItem, "DisplayName")%></a>
			(<%# ((Int32)DataBinder.Eval(Container.DataItem, "PostsModerated")).ToString("n0") %>)<br>
		</ItemTemplate>
	</asp:Repeater>
</div>

<div>
	<asp:Repeater id="ModerationAction" runat="server" Visible="True">
		<HeaderTemplate>
			<p /><CS:ResourceLabel runat="server" ResourceName="Moderator_Statistics_Actions" /><br>
		</HeaderTemplate>
		<ItemTemplate>
			&nbsp;<%# DataBinder.Eval(Container.DataItem, "Action") %>
			(<%# ((Int32)DataBinder.Eval(Container.DataItem, "Total")).ToString("n0") %>)<br>
		</ItemTemplate>
	</asp:Repeater>
</div>
