<%@ Page Language="C#" EnableTheming="false" Title="Subtext 管理 - 分类" MasterPageFile="~/Admin/WebUI/AdminPageTemplate.Master" Codebehind="EditCategories.aspx.cs" AutoEventWireup="True" Inherits="Subtext.Web.Admin.Pages.EditCategories" %>
<%@ Register TagPrefix="st" TagName="CategoryLinks" Src="~/Admin/UserControls/CategoryLinkList.ascx" %>

<asp:Content ID="actions" ContentPlaceHolderID="actionsHeading" runat="server"></asp:Content>

<asp:Content ID="categoryListTitle" ContentPlaceHolderID="categoryListHeading" runat="server">分类</asp:Content>

<asp:Content ID="categoriesLinkListing" ContentPlaceHolderID="categoryListLinks" runat="server">
    <st:CategoryLinks ID="categoryLinks" runat="server" CategoryType="PostCollection" />
</asp:Content>

<asp:Content ID="entryEditor" ContentPlaceHolderID="pageContent" runat="server">
	<st:MessagePanel id="Messages" runat="server"></st:MessagePanel>
	<st:AdvancedPanel id="Edit" runat="server" Collapsible="False" HeaderText="编辑分类" HeaderCssClass="CollapsibleHeader" DisplayHeader="true">
		<asp:DataGrid id="dgrItems" AutoGenerateColumns="False" GridLines="None" CssClass="Listing" runat="server">
			<AlternatingItemStyle CssClass="Alt"></AlternatingItemStyle>
			<HeaderStyle CssClass="Header"></HeaderStyle>

			<Columns>
				<asp:TemplateColumn HeaderText="名称">
					<ItemTemplate>
						<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Title") %>' ID="Label1"></asp:Label>
						<br />
						<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Description") %>' ID="Label2"></asp:Label>
					</ItemTemplate>

					<EditItemTemplate>
						名称<br />
						<asp:TextBox CssClass="textinput" id="txbTitle" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Title") %>'></asp:TextBox>
						<br /><br />描述<br />
						<asp:TextBox CssClass="textarea" rows="5" textmode="MultiLine" id="txbDescription" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Description") %>'></asp:TextBox>
					</EditItemTemplate>
				</asp:TemplateColumn>
				
	

				<asp:TemplateColumn HeaderText="显示">
					<ItemTemplate>
						<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.IsActive") %>'></asp:Label>
					</ItemTemplate>

					<EditItemTemplate>
						<asp:CheckBox id="ckbIsActive" runat="server" Checked='<%# DataBinder.Eval(Container, "DataItem.IsActive") %>'/>
					</EditItemTemplate>
				</asp:TemplateColumn>
				
				<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="更新" CancelText="取消" EditText="编辑"></asp:EditCommandColumn>
				
				<asp:ButtonColumn Text="删除" CommandName="Delete"></asp:ButtonColumn>
			</Columns>
		</asp:DataGrid>
	</st:AdvancedPanel>

	<st:AdvancedPanel id="Add" runat="server" Collapsible="False" HeaderText="添加分类" HeaderCssClass="CollapsibleTitle" DisplayHeader="true" BodyCssClass="Edit">
		<label class="Block">名称&nbsp;<asp:RequiredFieldValidator id="valtxbNewTitleRequired" runat="server" ControlToValidate="txbNewTitle" ForeColor="#990066" ErrorMessage="请输入分类的名称" /></label>
		<asp:TextBox id="txbNewTitle" runat="server" CssClass="textinput"></asp:TextBox>
		&nbsp; 
		显示 <asp:CheckBox id="ckbNewIsActive" runat="server" Checked="true"></asp:CheckBox>
		<br /><br />
		<label class="Block">描述 (1000个字符串,包含HTML)</label>
		<asp:TextBox id="txbNewDescription" max="1000"  runat="server" rows="5" CssClass="textarea" textmode="MultiLine"></asp:TextBox>
		<div style="margin-top: 8px">
			<asp:Button id="lkbPost" runat="server" CssClass="buttonSubmit" Text="添加" onclick="lkbPost_Click" />
			<br /> 
		</div>
	</st:AdvancedPanel>
</asp:Content>