<%@ Register TagPrefix="Portal" TagName="Divider" Src="~/ModuleDivider.ascx"%>
<%@ Register TagPrefix="Portal" TagName="Title" Src="~/DesktopModuleTitle.ascx"%>
<%@ Control language="c#" Inherits="Xpdt.Portal.Discussion" CodeBehind="Discussion.ascx.cs" AutoEventWireup="false" %>
<TABLE width="100%">
	<TR>
		<TD class="ModuleFrame">
			<portal:title id="Title1" runat="server" EditTarget="_new" EditUrl="~/DesktopModules/DiscussDetails.aspx" EditText="Add New Thread"></portal:title>
			<%-- discussion list --%>
			<asp:datalist id="TopLevelList" runat="server" DataKeyField="Parent" ItemStyle-Cssclass="<%# GetNormalStyle() %>" width="98%">
				<ItemTemplate>
					<asp:ImageButton CausesValidation=False id="btnSelect" ImageUrl='<%# NodeImage((int)DataBinder.Eval(Container.DataItem, "ChildCount")) %>' CommandName="select" runat="server" />
					<asp:hyperlink Text='<%# DataBinder.Eval(Container.DataItem, "Title") %>' NavigateUrl='<%# FormatUrl((int)DataBinder.Eval(Container.DataItem, "ItemID")) %>' Target="_new" runat="server" ID="Hyperlink1" />, 
					from
					<%# DataBinder.Eval(Container.DataItem,"CreatedByUser") %>
					, posted
					<%# DataBinder.Eval(Container.DataItem,"CreatedDate", "{0:g}") %>
				</ItemTemplate>
				<SelectedItemTemplate>
					<asp:ImageButton CausesValidation=False id="btnCollapse" ImageUrl="~/images/minus.gif" runat="server" CommandName="collapse" />
					<asp:hyperlink Text='<%# DataBinder.Eval(Container.DataItem, "Title") %>' NavigateUrl='<%# FormatUrl((int)DataBinder.Eval(Container.DataItem, "ItemID")) %>' Target="_new" runat="server" ID="Hyperlink2" />, 
					from
					<%# DataBinder.Eval(Container.DataItem,"CreatedByUser") %>
					, posted
					<%# DataBinder.Eval(Container.DataItem,"CreatedDate", "{0:g}") %>
					<asp:DataList id="DetailList" ItemStyle-Cssclass="<%# GetNormalStyle( ) %>" datasource="<%# GetThreadMessages() %>" runat="server">
						<ItemTemplate>
							<%# DataBinder.Eval(Container.DataItem, "Indent") %>
							<img src="http://<%= Request.Url.Host %><%=Request.ApplicationPath%>/images/1x1.gif" height="15">
							<asp:hyperlink Text='<%# DataBinder.Eval(Container.DataItem, "Title") %>' NavigateUrl='<%# FormatUrl((int)DataBinder.Eval(Container.DataItem, "ItemID")) %>' Target="_new" runat="server" ID="Hyperlink3" />, 
							from
							<%# DataBinder.Eval(Container.DataItem,"CreatedByUser") %>
							, posted
							<%# DataBinder.Eval(Container.DataItem,"CreatedDate", "{0:g}") %>
						</ItemTemplate>
					</asp:DataList>
				</SelectedItemTemplate>
			</asp:datalist>
			<Portal:Divider runat="server" id="Divider1" />
		</TD>
	</TR>
</TABLE>
