<%@ Control Language="C#" EnableTheming="false"  AutoEventWireup="True" Codebehind="EntryEditor.ascx.cs" Inherits="Subtext.Web.Admin.UserControls.EntryEditor"%>
<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Register TagPrefix="ANW" Namespace="Subtext.Web.Admin.WebUI" Assembly="Subtext.Web" %>
<%@ Register TagPrefix="st" Namespace="Subtext.Web.Controls" Assembly="Subtext.Web.Controls" %>
<%@ Import Namespace = "Subtext.Web.Admin" %>

<ANW:MessagePanel id="Messages" runat="server"></ANW:MessagePanel>

<ANW:AdvancedPanel id="Results" runat="server" LinkStyle="Image" LinkBeforeHeader="True" DisplayHeader="True" HeaderCssClass="CollapsibleHeader" LinkText="[toggle]" Collapsible="True">
	<asp:Repeater id="rprSelectionList" runat="server">
		<HeaderTemplate>
			<table id="Listing" class="Listing highlightTable" cellspacing="0" cellpadding="0" border="0" style="<%= CheckHiddenStyle() %>">
				<tr>
					<th>标题</th>
					<th width="50">状态</th>
					<th width="75">浏览数</th>
					<th width="75">订阅阅读数</th>
					<th width="50">&nbsp;</th>
					<th width="50">&nbsp;</th>
					<th width="50">&nbsp;</th>
				</tr>
		</HeaderTemplate>
		<ItemTemplate>
			<tr>
				<td>
				    <asp:HyperLink runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "FullyQualifiedUrl") %>' ToolTip="查看阅读" Target="_blank" >
				    <%# DataBinder.Eval(Container.DataItem, "Title") %></asp:HyperLink>
				</td>
				<td>
					<%# DataBinder.Eval(Container.DataItem, "IsActive") %>
				</td>												
				<td>
					<%# DataBinder.Eval(Container.DataItem, "WebCount") %>
				</td>
				<td>
					<%# DataBinder.Eval(Container.DataItem, "AggCount") %>
				</td>				
				<td>
					<a href="Referrers.aspx?EntryID=<%# DataBinder.Eval(Container.DataItem, "Id") %>" title="查看访问记录">查看</a>
				</td>				
				<td>
					<asp:LinkButton id="lnkEdit" CausesValidation="False" CommandName="Edit" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id") %>' Text="编辑" runat="server" />
				</td>
				<td>
					<asp:LinkButton id="lnkDelete" CausesValidation="False" CommandName="Delete" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id") %>' Text="删除" runat="server" />
				</td>
			</tr>
		</ItemTemplate>
		<AlternatingItemTemplate>
			<tr class="Alt">
				<td>
					<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "FullyQualifiedUrl") %>' ToolTip="查看阅读" >
				    <%# DataBinder.Eval(Container.DataItem, "Title") %></asp:HyperLink>
				</td>
				<td>
					<%# DataBinder.Eval(Container.DataItem, "IsActive") %>
				</td>
				<td>
					<%# DataBinder.Eval(Container.DataItem, "WebCount") %>
				</td>
				<td>
					<%# DataBinder.Eval(Container.DataItem, "AggCount") %>
				</td>					
				<td>
					<a href="Referrers.aspx?EntryID=<%# DataBinder.Eval(Container.DataItem, "Id") %>" title="查看访问记录">查看</a>
				</td>				
				<td>
					<asp:LinkButton id="lnkEditAlt" CausesValidation="False" CommandName="Edit" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id") %>' Text="编辑" runat="server" />
				</td>
				<td>
					<asp:LinkButton id="lnkDeleteAlt" CausesValidation="False" CommandName="Delete" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id") %>' Text="删除" runat="server" />
				</td>
			</tr>
		</AlternatingItemTemplate>
		<FooterTemplate>
			</table>
		</FooterTemplate>
	</asp:Repeater>
	
	<p id="NoMessagesLabel" runat="server" visible="false">未发现任何有效数据.</p>
		
	<st:PagingControl id="resultsPager" runat="server" 
			PrefixText="<div>分页</div>" 
			LinkFormatActive='<a href="{0}" class="Current">{1}</a>' 
			UrlFormat="EditPosts.aspx?pg={0}" 
			CssClass="Pager" />
	<br class="clear" />
</ANW:AdvancedPanel>

<ANW:AdvancedPanel id="Edit" runat="server" LinkStyle="Image" DisplayHeader="True" HeaderCssClass="CollapsibleTitle" Collapsible="False" HeaderText="编辑日志">
	<div class="Edit">
		<!-- DEBUG -->
		<p class="Label"><asp:HyperLink id="hlEntryLink" Runat="server"></asp:HyperLink></p>
		<p>
			<label for="Editor_Edit_txbTitle" accesskey="t">标题</label>&nbsp;<asp:RequiredFieldValidator id="valTitleRequired" runat="server" ControlToValidate="txbTitle" ForeColor="#990066" ErrorMessage="请输入标题"></asp:RequiredFieldValidator>
		</p>
		<p>
			<asp:TextBox id="txbTitle" runat="server" CssClass="textinput" MaxLength="250"></asp:TextBox>
		</p>
		<p>
			<label for="Editor_Edit_richTextEditor" accesskey="b">内容</label>&nbsp;<asp:RequiredFieldValidator id="valtbBodyRequired" runat="server" ControlToValidate="richTextEditor" ForeColor="#990066" ErrorMessage="请输入内容"></asp:RequiredFieldValidator></p>
		<p>
			<st:RichTextEditor id="richTextEditor" runat="server" onerror="richTextEditor_Error"></st:RichTextEditor>
		</p>
		<p><label>上传</label></p>
		<p><iframe src="UserControls/attachment.aspx" width="100%" height="25" frameborder="0" scrolling="no"></iframe></p>
		<p><label>分类</label></p>
		<p><asp:CheckBoxList id="cklCategories" runat="server" RepeatColumns="5" RepeatDirection="Horizontal"></asp:CheckBoxList></p>
		<div>
			<asp:Button id="lkbPost" runat="server" CssClass="buttonSubmit" Text="保存"  />
			<asp:Button id="lkUpdateCategories" runat="server" CssClass="buttonSubmit" CausesValidation="false" Text="分类" />
			<asp:Button id="lkbCancel" runat="server" CssClass="buttonSubmit" CausesValidation="false" Text="取消" />
		</div>
	</div>
	
	<ANW:AdvancedPanel id="Advanced" runat="server" LinkStyle="Image" LinkBeforeHeader="True" DisplayHeader="True" HeaderCssClass="CollapsibleHeader" LinkText="[toggle]" Collapsible="True" Collapsed="False" HeaderText="高级选项" BodyCssClass="Edit">
		<!-- todo, make this more css based than table driven -->
		<table cellpadding="4">
			<tr>
				<td width="200"><asp:CheckBox id="ckbPublished" runat="server" Text="发布" textalign="Right" /></td>
				<td width="200"><asp:CheckBox id="chkComments" runat="server" Text="显示评论" textalign="Right" /></td>	
				<td width="200"><asp:CheckBox id="chkCommentsClosed" runat="server" Text="关闭评论" textalign="Right" /></td>
				<td width="200"><asp:CheckBox id="chkDisplayHomePage" runat="server" Text="首页显示" textalign="Right" /></td>
			</tr>
			<tr>
				<td><asp:CheckBox id="chkMainSyndication" runat="server" Text = "首页Feed" textalign="Right" /></td>
				<td><asp:CheckBox id="chkSyndicateDescriptionOnly" runat="server" Text = "订阅只显示内容摘要" textalign="Right" /></td>
				<td><asp:CheckBox id="chkIsAggregated" runat="server" Text = "加入订阅链接" textalign="Right" /></td>
				<td><asp:CheckBox id="chkCommend" runat="server" Text = "推荐" textalign="Right" Visible="false" /></td>
			</tr>
		</table>
		<p style="margin-top: 10px;">
			<label for="Editor_Edit_txbEntryName" accesskey="n">文件名</label> <asp:RegularExpressionValidator ID="vRegexEntryName" ControlToValidate="txbEntryName" ValidationExpression="^([a-zA-Z0-9-]*([a-zA-Z0-9-_]+\.)*[a-zA-Z0-9-_]+)$" Text = "文件名格式错误." runat="server"/>
		</p>
		<p>
			<asp:TextBox id="txbEntryName" runat="server" CssClass="textinput" MaxLength="150"></asp:TextBox>
		</p>
		<p>
			<label for="Editor_Edit_txbExcerpt" accesskey="e">内容摘要</label></p>
		<p>
		    <FTB:FreeTextBox id="txbExcerpt" runat="server" Height="150" Width="700" ButtonSet="Office2000"></FTB:FreeTextBox>
		</p>
	</ANW:AdvancedPanel>
	
</ANW:AdvancedPanel>