##<!-- $Header: /cvs/sakai2/legacy/tools/src/webapp/vm/discussion/chef_threaded_discussionsII-topic_content.vm,v 1.4 2005/05/26 19:54:18 zqian.umich.edu Exp $ -->
<div class="portletBody">
	<form name="formII" action="#toolForm("$action")" method="post" class="inlineForm">
		<div class="navPanel">
		<div class="itemNav">
			#if ($!goPTButton)
				<input type="submit" name="eventSubmit_doPrev_topic_content" value="$tlang.getString("content.pretop")" accesskey="p" />
			#else
				<input type="submit" name="eventSubmit_doPrev_topic_content" value="$tlang.getString("content.pretop")" disabled="disabled" />
			#end
			<input type="submit" name="eventSubmit_doCancel_show_topic_content" value="$tlang.getString("content.rettolis")" accesskey="l" />
			#if ($!goNTButton)
				<input type="submit" name="eventSubmit_doNext_topic_content" value="$tlang.getString("content.nextop")" accesskey="n" />
			#else
				<input type="submit" name="eventSubmit_doNext_topic_content" value="$tlang.getString("content.nextop")" disabled="disabled" />
			#end
		</div>
		</div>
	<h3>
		$tlang.getString("content.topcon"):#if ($topic.DiscussionHeader.Draft) <span class="highlight">$tlang.getString("gen.dra") </span>#end " $validator.escapeHtml($topic.DiscussionHeader.Subject)"
	</h3>

	#if ($alertMessage)<div class="alertMessage">$tlang.getString("gen.alert") $validator.escapeHtml($alertMessage)</div><div class="clear"></div>#end
		<div class="hierItemBlock">
			<div class="textPanelFooter">
				#set($replyNumber = $topic.NumberOfReplies)
				#if ($replyNumber>0)
					#if ($replyNumber==1) 
						[ $tlang.getString("content.oneres") ]
					#else
						[$replyNumber $tlang.getString("content.morres")]
					#end
				#end
				- $validator.escapeHtml($topic.DiscussionHeader.From.DisplayName)
				($topic.DiscussionHeader.Date.toStringLocalFullZ())
			</div>
			<div class="textPanel">
				$validator.escapeHtmlFormattedText($topic.Body)
				#set ($size = 0)
				#set ($props = false)
				#foreach ($attachment in $topic.Header.Attachments) 
					#set ($props = $attachment.Properties) 
					#if ($!props)
						#set ($size = $size + 1)
					#end
				#end
				#if ($size != 0)
					<h4>
							$tlang.getString("control.att2")
					</h4>
						<ul class="attachList indnt1">
							#foreach ($attachment in $topic.Header.Attachments) 
								#set ($props = false)
								#set ($props = $attachment.Properties) 
								#if ($!props)
									<li>
										#if ($props.getBooleanProperty($props.NamePropIsCollection))
											<img src = "#imageLink($contentTypeImageService.getContentTypeImage("folder"))" border="0" alt="$tlang.getString("genl.folatt")" />
										#else
											<img src = "#imageLink($contentTypeImageService.getContentTypeImage($props.getProperty($props.NamePropContentType)))" border="0" alt="$tlang.getString("gen.filatt")" />
										#end
										<a href="$attachment.Url" target="_blank">$validator.escapeHtml($props.getPropertyFormatted($props.NamePropDisplayName))</a>						
										#if (!$props.getBooleanProperty($props.NamePropIsCollection))
											($props.getPropertyFormatted($props.NamePropContentLength))
										#end
									</li>
								#end
							#end
						</ul>	
				#end
			</div>
		</div>
		<br />
		#set($thread = $channel.getThread($topic))
		#foreach ($message in $thread)

				#set($depth = $message.ReplyToDepth)
				#set($marginStart = "margin-left:")
				#set($marginEnd = "em")
				#set($marginEnd = "em")
				#if ($depth >= 4)
					#set($header=6)
				#else	
					#set($header = ($depth + 3))
				#end	
				<div style="$marginStart$depth$marginEnd" class="hierItemBlock">
					<h$header class="textPanelHeader"> 	
					#if ($message.DiscussionHeader.Draft)
							<span class="highlight">$tlang.getString("gen.dra") </span>
						#end
						$validator.escapeHtml($message.DiscussionHeader.Subject)
					</h$header>
					<div class="textPanelFooter">
						#set($replyNumber = $message.NumberOfReplies)
						#if ($replyNumber>0)
							#if ($replyNumber==1) 
								[$tlang.getString("content.oneres")]
							#else
								[$replyNumber $tlang.getString("content.morres")]
							#end
						#end
						 $validator.escapeHtml($message.DiscussionHeader.From.DisplayName)
						($message.DiscussionHeader.Date.toStringLocalFullZ())
					</div>	
				<div class="textPanel">
						$validator.escapeHtmlFormattedText($message.Body)
				</div>
			
			#set ($size = 0)
			#set ($props = false)
			#foreach ($attachment in $message.Header.Attachments) 
				#set ($props = $attachment.Properties) 
				#if ($!props)
					#set ($size = $size + 1)
				#end
			#end
			#if ($size != 0)
				<h$header>
					$tlang.getString("control.att2")
				</h4>
						<ul class="attachList indnt1">
							#foreach ($attachment in $message.Header.Attachments) 
								#set ($props = false)
								#set ($props = $attachment.Properties) 
								#if ($!props)
									<li>
										#if ($props.getBooleanProperty($props.NamePropIsCollection))
											<img src = "#imageLink($contentTypeImageService.getContentTypeImage("folder"))" border="0" alt="$tlang.getString("genl.folatt")" />
										#else
											<img src = "#imageLink($contentTypeImageService.getContentTypeImage($props.getProperty($props.NamePropContentType)))" border="0" alt="$tlang.getString("gen.filatt")" />
										#end
										<a href="$attachment.Url" target="_blank">$validator.escapeHtml($props.getPropertyFormatted($props.NamePropDisplayName))</a>						
										#if (!$props.getBooleanProperty($props.NamePropIsCollection))
											($props.getPropertyFormatted($props.NamePropContentLength))
										#end
									</li>
								#end
							#end
						</ul>
			#end
			</div>
		#end
					
		<div class="navPanel">
		<div class="itemNav">
			#if ($!goPTButton)
				<input type="submit" name="eventSubmit_doPrev_topic_content" value="$tlang.getString("content.pretop")" />
			#else
				<input type="submit" name="eventSubmit_doPrev_topic_content" value="$tlang.getString("content.pretop")" disabled="disabled" />
			#end
			<input type="submit" name="eventSubmit_doCancel_show_topic_content" value="$tlang.getString("content.rettolis")" />
			#if ($!goNTButton)
				<input type="submit" name="eventSubmit_doNext_topic_content" value="$tlang.getString("content.nextop")" />
			#else
				<input type="submit" name="eventSubmit_doNext_topic_content" value="$tlang.getString("content.nextop")" disabled="disabled" />
			#end
		</div>
		</div>
	</form>
</div>

