	## this is showing the list view of all announcement, and the home view of this tool

##(gsilver - remaining issues: trimming body, <p> in body when produced with WYS, the fact that how thing look in the synopsys is still undefined - and finally - the permissions nightmare as well as the ling to Remove...

<div class="portletBody">
	#if ($isOnWorkspaceTab.equals("false"))
		#if($menu && $EnabledMenuItemExists)
			#if ($toolId == "sakai.synoptic.announcement")
				<div class="navIntraTool">
					<a href="#" title="$tlang.getString("gen.recopt")" onclick="location = '#toolLink("$action" "doOptions")';return false;">
						$tlang.getString("custom.options")
					</a>
				</div>
			#else
				#toolbar($menu)
			#end
		#end
	#end
	
	#set ($SiteColumnFlag = 0)
	#foreach ($item in $showMessagesList2)
	#set ($ref = $entityManager.newReference($item.Reference))
	#set ($origChannelRef = $service.channelReference($ref.Context,$ref.Container))
	#if (!$origChannelRef.equals($channel.Reference))
		#set ($SiteColumnFlag = $SiteColumnFlag + 1)
	#end
	#end
	
	#if ($isOnWorkspaceTab.equals("true")) ##in workspace
		<h3>$tlang.getString("gen.announcements")</h3>
		#if ($alertMessage)<div class="alertMessage">$tlang.getString("gen.alert") $validator.escapeHtml($alertMessage)</div><div class="clear"></div>#end
##		#if ($messageListVector.iterator().hasNext())
		<div class="navPanel">
			<div class="viewNav">
				<form name="viewForm" class="inlineForm" method="post" action="#toolForm("AssignmentAction")">
					<input type="hidden" name="eventSubmit_doView" value="view" />
					<label for="view">
						$tlang.getString("view.label")
					</label>
					<span class="skip">$tlang.getString("gen.listnavselect")</span>
					<select id="view" name="view" size="1" onchange="blur();document.viewForm.submit();">
						<option value="view.all" #if ($!view == "view.all")selected="selected"#end >$!tlang.getString('view.all')</option>
						<option value="view.public"  #if ($!view == "view.public")selected="selected"#end >$!tlang.getString('view.public')</option>
						#if ($!groups)
							<option value="view.bygroup" #if ($!view == "view.bygroup")selected="selected"#end >$!tlang.getString('view.bygroup')</option>
						#end 
					</select>
				</form>
			</div>
	##		#end
				#if ($messageListVector.iterator().hasNext())
					<div class="listNav">
						<div class="instruction">
							$tlang.getString("gen.viewing") $topMsgPos - $btmMsgPos $tlang.getString("gen.separator") $allMsgNumber $tlang.getString("gen.items")
						</div>
						#if ($pagesize != 0)
							#if ($goFPButton == "true")
								<form name="firstpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
									<input type="submit" name="eventSubmit_doList_first" value="|&lt;" title="$tlang.getString("gen.first")" />
								</form>
							#else
								<form name="firstpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
									<input type="submit" name="eventSubmit_doList_first" value="|&lt;" disabled="disabled" />
								</form>
							#end
							#if ($goPPButton == "true")
								<form name="prevpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
									<input type="submit" name="eventSubmit_doList_prev" value="&lt;" title="$tlang.getString('gen.previous') $pagesize"  accesskey="p" />
								</form>
							#else
								<form name="prevpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
									<input type="submit" name="eventSubmit_doList_prev" value="&lt;" disabled="disabled" />
								</form>
							#end
						#end
						<form name="pagesizeForm" class="inlineForm" method="post" action="#toolForm("$action")">
							<input type="hidden" name="eventSubmit_doChange_pagesize" value="changepagesize" />
							<span class="skip">$tlang.getString("gen.listnavselect")</span>
							<select name="selectPageSize" onchange="blur();document.pagesizeForm.submit();">
								<option value="5" #if($pagesize == 5) selected="selected" #end>$tlang.getString("gen.show5")</option>
								<option value="10" #if($pagesize == 10) selected="selected" #end>$tlang.getString("gen.show10")</option>
								<option value="20" #if($pagesize == 20) selected="selected" #end>$tlang.getString("gen.show20")</option>
								<option value="50" #if($pagesize == 50) selected="selected" #end>$tlang.getString("gen.show50")</option>
								<option value="100" #if($pagesize == 100) selected="selected" #end>$tlang.getString("gen.show100")</option>
								<option value="200" #if($pagesize == 200) selected="selected" #end>$tlang.getString("gen.show200")</option>
							</select>
						</form>
						#if ($pagesize != 0)
							#if ($goNPButton == "true")
								<form name="nextpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
									<input type="submit" name="eventSubmit_doList_next" value="&gt;" title="$tlang.getString('gen.next') $pagesize"  accesskey="n" />
								</form>
							#else
								<form name="nextpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
									<input type="submit" name="eventSubmit_doList_next" value="&gt;" disabled="disabled" />
								</form>
							#end
							#if ($goLPButton == "true")
								<form name="lastpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
									<input type="submit" name="eventSubmit_doList_last" value="&gt;|" title="$tlang.getString('gen.last')" />
								</form>
							#else
								<form name="lastpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
									<input type="submit" name="eventSubmit_doList_last" value="&gt;|" disabled="disabled" />
								</form>
							#end
						#end
					</div>
				</div> ##end navPanel
				<form name="announcementListForm" action="#toolForm("AnnouncementAction")" method="post">
				<table class="listHier lines nolines" border="0" cellspacing="0" summary="$tlang.getString('gen.tablecaptionworksp')">
					<tr>
						<th id="attach" class="attach"></th>
						<th id ="subject">
							#if (!$currentSortedBy.equals("subject"))
								<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbysubject")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbysubject")';return false;" title ="$tlang.getString('gen.sortby')">$tlang.getString('gen.subject')</a>
							#else
								#if ($currentSortAsc.equals("true"))
									<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbysubject")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbysubject")';return false;" title ="$tlang.getString('gen.sortbyasc')">$tlang.getString('gen.subject') <img src = "#imageLink("sakai/sortascending.gif")" border="0" alt="$tlang.getString('gen.sortbyasc')" /></a>
								#else
									<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbysubject")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbysubject")';return false;" title ="$tlang.getString('gen.sortbydesc')">$tlang.getString('gen.subject') <img src = "#imageLink("sakai/sortdescending.gif")" border="0" alt="$tlang.getString('gen.sortbydesc')"/></a>
								#end
							#end
						</th>
						<th id="author">
							#if (!$currentSortedBy.equals("from"))
								<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbyfrom")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbyfrom")';return false;" title ="$tlang.getString('gen.sortbyauth')">$tlang.getString('gen.from')</a>
							#else
								#if ($currentSortAsc.equals("true"))
									<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbyfrom")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbyfrom")';return false;" title ="$tlang.getString('gen.sortbyauthasc')">$tlang.getString('gen.from') <img src = "#imageLink("sakai/sortascending.gif")" border="0" alt="$tlang.getString('gen.sortbyauthasc')" /></a>
								#else
									<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbyfrom")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbyfrom")';return false;" title ="$tlang.getString('gen.sortbyauthdesc')">$tlang.getString('gen.from') <img src = "#imageLink("sakai/sortdescending.gif")" border="0" alt="$tlang.getString('gen.sortbyauthdesc')"/></a>
								#end
							#end
						</th>
						#if ($SiteColumnFlag > 0) ## (there are anns from other sites so show what site they are from)
							<th id ="Site">
								#if (!$currentSortedBy.equals("channel"))
									<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbychannel")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbychannel")';return false;" title ="$tlang.getString('gen.sortchannel')">$tlang.getString('gen.site')</a>
								#else
									#if ($currentSortAsc.equals("true"))
										<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbychannel")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbychannel")';return false;" title ="$tlang.getString('gen.sortchanasc')">$tlang.getString('gen.site') <img src = "#imageLink("sakai/sortascending.gif")" border="0" alt="$tlang.getString('gen.sortchanasc')" /></a>
									#else
										<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbychannel")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbychannel")';return false;" title ="$tlang.getString('gen.sortchandesc')">$tlang.getString('gen.site') <img src = "#imageLink("sakai/sortdescending.gif")" border="0" alt="$tlang.getString('gen.sortchandesc')" /></a>
									#end
								#end
							</th>
						#end
						<th id ="date">
							#if (!$currentSortedBy.equals("date"))
								<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbydate")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbydate")';return false;" title="$tlang.getString('gen.sortbydate')">$tlang.getString('gen.date')</a>
							#else
								#if ($currentSortAsc.equals("true"))
									 <a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbydate")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbydate")';return false;"  title="$tlang.getString('gen.sortbydateasc')">$tlang.getString('gen.date')<img src = "#imageLink("sakai/sortascending.gif")" border="0" alt="$tlang.getString('gen.sortbydateasc')" /></a>
								#else
									<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbydate")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbydate")';return false;" title="$tlang.getString('gen.sortbydatedesc')">$tlang.getString('gen.date') <img src = "#imageLink("sakai/sortdescending.gif")" border="0" alt ="$tlang.getString('gen.sortbydatedesc')" /></a>
								#end
							#end
						</th>
					</tr>
					#if ($!view == "view.all")
					#set ($rowCount=0)
					#foreach ($ann_item in $showMessagesList)
						#set ($rowCount =$rowCount + 1)
						<tr>
							<td headers="attach" class="attach">	
								## show the paperclip if existing
									#set ($size = 0)
									#if (!$ann_item.Header.Attachments.isEmpty())
										#set ($props = false)
										#set ($size = $ann_item.Header.Attachments.size())
										#foreach ($attachment in $ann_item.Header.Attachments)
											#set ($props = $attachment.Properties)
											#if (!$props)
													#if ($size > 0) #set ($size = $size - 1) #end
											#end
										#end
									#end
									#if ($size == 0)
									#else
										<img src = "#imageLink("sakai/attachments.gif")" border="0" alt="$tlang.getString('gen.attach')" />
									#end

							</td>
							<td headers="subject">
								<h4>
									#if ($ann_item.Header.draft)
									<a href="#toolLinkParam("AnnouncementAction" "doReviseannouncement" "itemReference=$validator.escapeUrl($ann_item.reference)")" title="$tlang.getString('gen.editdraft')"><span class="highlight">$tlang.getString("gen.draft") - </span>
										$validator.escapeHtml($ann_item.Header.subject)</a>
									#else
										<a href="#toolLinkParam("AnnouncementAction" "doShowmetadata" "itemReference=$validator.escapeUrl($ann_item.reference)")" title="$tlang.getString('gen.viewann') $validator.escapeHtml($ann_item.Header.subject)">
										$validator.escapeHtml($ann_item.Header.subject)</a>
									#end
								</h4>	
							</td>
							<td headers="author">
								$validator.escapeHtml($ann_item.Header.From.DisplayName)
							</td>
							#if ($SiteColumnFlag > 0)
								<td headers="channel">
									$validator.escapeHtml($ann_item.channelDisplayName)
								</td>
							#end
							<td headers="date">
								$ann_item.Header.Date.toStringLocalFull()
							</td>
						</tr>
						#if ($displayOptions.isShowAnnouncementBody()) 
							<tr>	
									#if ($EnableItemCheckBoxes)
										#if ($SiteColumnFlag > 0)
											#set ($colspan="6")
										#else	
											#set ($colspan="5")
										#end	
									#else
										#if ($SiteColumnFlag > 0)
											#set ($colspan="4")
											#else	
												#set ($colspan="3")
											#end	
										#end	
									<td colspan="$colspan">
										<div class="textPanel">$ann_item.TrimmedBody</div>
									</td>
								</tr>	
							#end
						#end
					</table>
				</form>
			#end
		#else
			</div> ##end navPanel						
			<div class="instruction clear">
				#if ($!view == "view.public")
					$tlang.getString("gen.therearepublic")
				#else
					$tlang.getString("gen.thereare")
					#end
			</div>
		#end
	#else ## not in workspace
		#if ($toolId == "sakai.synoptic.announcement") 
		##in home portlet  - so reduce display to title, attach marker, body (if selected), author and date


			#if ($alertMessage)<div class="alertMessage">$tlang.getString("gen.alert") $validator.escapeHtml($alertMessage)</div><div class="clear"></div>#end

			<form name="announcementListForm" action="#toolForm("AnnouncementAction")" method="post">
				#if (!$messageListVector.iterator().hasNext())
					<div class="instruction clear">
      					$tlang.getString("gen.thereare")
					</div>
				#else
					#set ($rowCount=0)
					#foreach ($ann_item in $showMessagesList)
						#set ($rowCount =$rowCount + 1)
							#if ($ann_item.Header.draft)
							#else
							<h3 class="textPanelHeader">
								<a href="#toolLinkParam("AnnouncementAction" "doShowmetadata" "itemReference=$validator.escapeUrl($ann_item.reference)")" title="$tlang.getString('gen.viewann') $validator.escapeHtml($ann_item.Header.subject)">
								$validator.escapeHtml($ann_item.Header.subject)</a>
								#set ($size = 0)
								#if (!$ann_item.Header.Attachments.isEmpty())
									#set ($props = false)
									#set ($size = $ann_item.Header.Attachments.size())
									#foreach ($attachment in $ann_item.Header.Attachments)
										#set ($props = $attachment.Properties)
										#if (!$props)
												#if ($size > 0) #set ($size = $size - 1) #end
										#end
									#end
								#end
								#if ($size == 0)
								#else
									<img src = "#imageLink("sakai/attachments.gif")" border="0" alt="$tlang.getString('gen.attach')" />
								#end
							</h3>	
							<p class="textPanelFooter">
								($validator.escapeHtml($ann_item.Header.From.DisplayName) - $ann_item.Header.Date.toStringLocalFull())
							</p>	
							#if ($displayOptions.isShowAnnouncementBody())
								<div class="textPanel">
									$ann_item.TrimmedBody
								</div>
							#end
						#end	
					#end
				#end
			</form>

		#else ## not in workspace, not in home
			#if ($toolId == "sakai.announcements") ##In tool or admin MOTD...			

				#if ($displayOptions.isShowAllColumns())
					<h3>$tlang.getString("gen.announcements")</h3>
					#if ($alertMessage)<div class="alertMessage">$tlang.getString("gen.alert") $validator.escapeHtml($alertMessage)</div><div class="clear"></div>#end
					<div class="navPanel">
						<div class="viewNav">
							<form name="viewForm" class="inlineForm" method="post" action="#toolForm("$action")">
								<input type="hidden" name="eventSubmit_doView" value="view" />
								<label for="view">
									$tlang.getString("view.label")
								</label>
								<span class="skip">$tlang.getString("gen.listnavselect")</span>
								<select id="view" name="view" size="1" onchange="blur();document.viewForm.submit();">
									<option value="view.all" #if ($!view == "'view.all")selected="selected"#end >$!tlang.getString('view.all')</option>
									<option value="view.public"  #if ($!view == "view.public")selected="selected"#end >$!tlang.getString('view.public')</option>
									#if ($!groups)
										<option value="view.bygroup" #if ($!view == "view.bygroup")selected="selected"#end >$!tlang.getString('view.bygroup')</option>
									#end 
								</select>
							</form>
						</div>
						#if ($messageListVector.iterator().hasNext())
							<div class="listNav">
								<div class="instruction">
									$tlang.getString("gen.viewing") $topMsgPos - $btmMsgPos $tlang.getString("gen.separator") $allMsgNumber $tlang.getString("gen.items")
								</div>
								#if ($pagesize != 0)
									#if ($goFPButton == "true")
										<form name="firstpageForm" class="inlineForm"  method="post" action="#toolForm("$action")">
											<input type="submit" name="eventSubmit_doList_first" value="|&lt;" title="$tlang.getString("gen.first")" />
										</form>
									#else
										<form name="firstpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
											<input type="submit" name="eventSubmit_doList_first" value="|&lt;" disabled="disabled" />
										</form>
									#end
									#if ($goPPButton == "true")
										<form name="prevpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
											<input type="submit" name="eventSubmit_doList_prev" value="&lt;" title="$tlang.getString('gen.previous') $pagesize"  accesskey="p" />
										</form>
									#else
										<form name="prevpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
											<input type="submit" name="eventSubmit_doList_prev" value="&lt;" disabled="disabled" />
										</form>
									#end
								#end
							
								<form name="pagesizeForm" class="inlineForm" method="post" action="#toolForm("$action")">
									<input type="hidden" name="eventSubmit_doChange_pagesize" value="changepagesize" />
									<span class="skip">$tlang.getString("gen.listnavselect")</span>
									<select name="selectPageSize" onchange="blur();document.pagesizeForm.submit();">
										<option value="5" #if($pagesize == 5) selected="selected" #end>$tlang.getString("gen.show5")</option>
										<option value="10" #if($pagesize == 10) selected="selected" #end>$tlang.getString("gen.show10")</option>
										<option value="20" #if($pagesize == 20) selected="selected" #end>$tlang.getString("gen.show20")</option>
										<option value="50" #if($pagesize == 50) selected="selected" #end>$tlang.getString("gen.show50")</option>
										<option value="100" #if($pagesize == 100) selected="selected" #end>$tlang.getString("gen.show100")</option>
										<option value="200" #if($pagesize == 200) selected="selected" #end>$tlang.getString("gen.show200")</option>
									</select>
								</form>
								#if ($pagesize != 0)
									#if ($goNPButton == "true")
										<form name="nextpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
											<input type="submit" name="eventSubmit_doList_next" value="&gt;" title="$tlang.getString('gen.next') $pagesize"  accesskey="n" />
										</form>
									#else
										<form name="nextpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
											<input type="submit" name="eventSubmit_doList_next" value="&gt;" disabled="disabled" />
										</form>
									#end
									#if ($goLPButton == "true")
										<form name="lastpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
											<input type="submit" name="eventSubmit_doList_last" value="&gt;|" title="$tlang.getString("gen.last")" />
										</form>
									#else
										<form name="lastpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
											<input type="submit" name="eventSubmit_doList_last" value="&gt;|" disabled="disabled" />
										</form>
									#end
								#end
							</div>
						</div> ##end navPanel
						<form name="announcementListForm" action="#toolForm("AnnouncementAction")" method="post">
							<table class="listHier" border="0" cellspacing="0" summary="$tlang.getString('gen.tablecaptionsite')">
								<tr>
								 <th id ="attach" class="attach"></th>
								 <th id ="subject">
										#if (!$currentSortedBy.equals("subject"))
											<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbysubject")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbysubject")';return false;" title ="$tlang.getString('gen.sortby')">$tlang.getString('gen.subject')</a>
										#else
											#if ($currentSortAsc.equals("true"))
												<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbysubject")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbysubject")';return false;" title ="$tlang.getString('gen.sortbyasc')">$tlang.getString('gen.subject') <img src = "#imageLink("sakai/sortascending.gif")" border="0" alt="$tlang.getString('gen.sortbyasc')" /></a>
											#else
												<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbysubject")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbysubject")';return false;"title ="$tlang.getString('gen.sortbydesc')">$tlang.getString('gen.subject') <img src = "#imageLink("sakai/sortdescending.gif")" border="0" alt="$tlang.getString('gen.sortbydesc')"/></a>
											#end
										#end
									</th>
									<th id="author">
										#if (!$currentSortedBy.equals("from"))
											<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbyfrom")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbyfrom")';return false;" title ="$tlang.getString('gen.sortbyauth')">$tlang.getString('gen.from')</a>
										#else
											#if ($currentSortAsc.equals("true"))
												<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbyfrom")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbyfrom")';return false;" title ="$tlang.getString('gen.sortbyauthasc')">$tlang.getString('gen.from') <img src = "#imageLink("sakai/sortascending.gif")" border="0" alt="$tlang.getString('gen.sortbyauthasc')" /></a>
											#else
												<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbyfrom")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbyfrom")';return false;" title ="$tlang.getString('gen.sortbyauthdesc')">$tlang.getString('gen.from') <img src = "#imageLink("sakai/sortdescending.gif")" border="0" alt="$tlang.getString('gen.sortbyauthdesc')"/></a>
											#end
										#end
									</th>
									#if ($EnableItemCheckBoxes)
										#if ($SiteColumnFlag > 0) ## (there are anns from other sites so show what site they are from)
											<th id ="Site">
												#if (!$currentSortedBy.equals("channel"))
													<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbychannel")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbychannel")';return false;" title ="$tlang.getString("gen.sortchannel")">$tlang.getString("gen.site")</a>
												#else
													#if ($currentSortAsc.equals("true"))
														<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbychannel")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbychannel")';return false;" title ="$tlang.getString("gen.sortchanasc")">$tlang.getString("gen.site") <img src = "#imageLink("sakai/sortascending.gif")" border="0" alt=$tlang.getString("gen.sortchanasc") /></a>
													#else
														<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbychannel")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbychannel")';return false;" title ="$tlang.getString("gen.sortchandesc")">$tlang.getString("gen.site") <img src = "#imageLink("sakai/sortdescending.gif")" border="0" alt=$tlang.getString("gen.sortchandesc")/></a>
													#end
												#end
											</th>
										#end
									#end
									<th id="channel">
										#if (!$currentSortedBy.equalsIgnoreCase("$tlang.getString('gen.visible')"))
											<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbyfor")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbyfor")';return false;" title="$tlang.getString('gen.sortbyfor')">$tlang.getString("gen.visible")</a>
										#else
											#if ($currentSortAsc.equals("true"))
												 <a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbyfor")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbyfor")';return false;" title="$tlang.getString('gen.sortbyforasc')">$tlang.getString("gen.visible") <img src = "#imageLink('sakai/sortascending.gif')" border="0" alt="$tlang.getString('gen.sortbyforasc')" /></a>
											#else
												<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbyfor")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbyfor")';return false;" title="$tlang.getString('gen.sortbyfordesc')">$tlang.getString("gen.visible") <img src = "#imageLink('sakai/sortdescending.gif')" border="0" alt ="$tlang.getString('gen.sortbyfordesc')" /></a>
											#end
										#end
									</th>
									<th id ="date">
										#if (!$currentSortedBy.equals("date"))
											<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbydate")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbydate")';return false;" title="$tlang.getString('gen.sortbydateasc')">$tlang.getString("gen.date")</a>
										#else
											#if ($currentSortAsc.equals("true"))
												 <a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbydate")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbydate")';return false;" title="$tlang.getString('gen.sortbydateasc')">$tlang.getString("gen.date") <img src = "#imageLink('sakai/sortascending.gif')" border="0" alt="$tlang.getString('gen.sortbydateasc')" /></a>
											#else
												<a href="#" onclick="location='#toolLink("AnnouncementAction" "doSortbydate")';return false;" onkeypress="location='#toolLink("AnnouncementAction" "doSortbydate")';return false;" title="$tlang.getString('gen.sortbydatedesc')">$tlang.getString("gen.date") <img src = "#imageLink('sakai/sortdescending.gif')" border="0" alt ="$tlang.getString('gen.sortbydatedesc')" /></a>
											#end
										#end
									</th>
									#if ($!view != "view.bygroup")
										#if ($allow_delete)
											<th class="screenOnly" id="checkbox">
												 $tlang.getString("gen.remove_question")
											</th>
										#end
									#end
								</tr>
							 #set ($rowCount=0)
							 #foreach ($ann_item in $showMessagesList)
								#set ($rowCount =$rowCount + 1)
								<tr#if ($displayOptions.isShowAnnouncementBody()) class="lightHighLightRow" #end>
									<td headers="attach" class="attach">
										## show the paperclip if existing
										#set ($size = 0)
										#if (!$ann_item.Header.Attachments.isEmpty())
											#set ($props = false)
											#set ($size = $ann_item.Header.Attachments.size())
											#foreach ($attachment in $ann_item.Header.Attachments)
												#set ($props = $attachment.Properties)
												#if (!$props)
														#if ($size > 0) #set ($size = $size - 1) #end
												#end
											#end
										#end
										#if ($size == 0)
										#else
											<img src = "#imageLink("sakai/attachments.gif")" border="0" alt="$tlang.getString('gen.attach')" />
										#end
									</td>
									<td headers="subject">
										<h4>
											#if ($ann_item.Header.draft)
												<a href="#toolLinkParam("AnnouncementAction" "doReviseannouncement" "itemReference=$validator.escapeUrl($ann_item.reference)")" title="$tlang.getString('gen.editdraft')"><span class="highlight">$tlang.getString("gen.draft") - </span>
												$validator.escapeHtml($ann_item.Header.subject)</a>
											#else
												<a href="#toolLinkParam("AnnouncementAction" "doShowmetadata" "itemReference=$validator.escapeUrl($ann_item.reference)")" title="$tlang.getString('gen.viewann') $validator.escapeHtml($ann_item.Header.subject)">
												$validator.escapeHtml($ann_item.Header.subject)</a>
											#end
										</h4>	
										#if ($channel.allowEditMessage($ann_item.Id))
											<div class="itemAction"><a href="#toolLinkParam("AnnouncementAction" "doReviseannouncement" "itemReference=$validator.escapeUrl($ann_item.reference)")" title="$tlang.getString('gen.editann') $validator.escapeHtml($ann_item.Header.subject)">$tlang.getString("gen.revise")</a></div>
										#end
                                                                                                                                                                                                     
									</td>
									<td headers="author">
										$validator.escapeHtml($ann_item.Header.From.DisplayName)
									</td>
									#if ($EnableItemCheckBoxes)
										#if ($SiteColumnFlag > 0)
											<td headers="channel">
												$validator.escapeHtml($ann_item.channelDisplayName)
											</td>
										#end
									#end
									<td >
										$!ann_item.getRange()
									</td>
									<td headers="date">
										$ann_item.Header.Date.toStringLocalFull()
									</td>
									
									#set ($ref = $entityManager.newReference($ann_item.Reference))
									#set ($origChannelRef = $service.channelReference($ref.Context,$ref.Container))

									#if ($!view != "view.bygroup")
										#if ($channel.allowRemoveMessage($ann_item.Message))
											#if ($origChannelRef.equals($channel.Reference))
											<td headers="checkbox" class="screenOnly">
												<label for ="check-$rowCount" class="skip">$tlang.getString("gen.selectremove")</label>
												<input title="$tlang.getString("gen.selectremove")" type="checkbox" id="check-$rowCount" name="selectedMembers" value="$ann_item.Reference" />
											</td>
											#end
										#else
									 		#if ($allow_delete)
												#if ($origChannelRef.equals($channel.Reference))
												<td valign="top" headers="checkbox" class="screenOnly">
													<label for ="check-$rowCount" class="skip">$tlang.getString("gen.selectremove")</label>
													<input title="$tlang.getString("gen.selectremove")" type="checkbox" id="check-$rowCount" name="selectedMembers" value="$ann_item.Reference" disabled="disabled"/>
												</td>
												#end
											#end		
										#end
									#end
								</tr>
								#if ($displayOptions.isShowAnnouncementBody()) 
									<tr>
										<td>
										</td>
										<td colspan="6">
											<div class="textPanel">$ann_item.TrimmedBody</div>
										</td>
									</tr>	
									#end
							#end
						</table>
						#else
							</div> ##end navPanel
							<div class="instruction clear">
								#if ($!view == "view.public")
									$tlang.getString("gen.therearepublic")
								#else
									$tlang.getString("gen.thereare")
								#end
							</div>
							<form name="announcementListForm" action="#toolForm("AnnouncementAction")" method="post">
							</form>
						#end	
						
						#if ($messageListVector.iterator().hasNext())
							#if ($isOnWorkspaceTab.equals("false"))
								#if ($EnableItemCheckBoxes)
									#if ($allow_delete)
										<p class="act">
											<input type="submit" class="active" name="eventSubmit_doDeleteannouncement" value="$tlang.getString("gen.update")"  accesskey="s" />
											<input type="reset" name="reset" id="reset" value="$tlang.getString("gen.cancel")"  accesskey="x" />
										</p>
									#end
								#end
							#end
						</form>
					#end
				#else
					<h3>$tlang.getString("gen.announcements")</h3>
					#if ($alertMessage)<div class="alertMessage">$tlang.getString("gen.alert") $validator.escapeHtml($alertMessage)</div><div class="clear"></div>#end

						#if (!$messageListVector.iterator().hasNext())
							<p class="instruction">
            				$tlang.getString("gen.thereare")
							</p>
						#else
							<div class="navPanel">
								<div class="listNav">
									<div class="instruction">
										##$tlang.getString("gen.viewing") $topMsgPos - $btmMsgPos / $allMsgNumber $tlang.getString("gen.items")
										  $tlang.getString("gen.viewing") $topMsgPos - $btmMsgPos $tlang.getString("gen.separator") $allMsgNumber $tlang.getString("gen.items")
									</div>
									#if ($pagesize != 0)
										#if ($goFPButton == "true")
											<form name="firstpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
												<input type="submit" name="eventSubmit_doList_first" value="|&lt;" title="$tlang.getString("gen.first")" />
											</form>
										#else
											<form name="firstpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
												<input type="submit" name="eventSubmit_doList_first" value="|&lt;" disabled="disabled" />
											</form>
										#end
										#if ($goPPButton == "true")
											<form name="prevpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
												<input type="submit" name="eventSubmit_doList_prev" value="&lt;" title="$tlang.getString('gen.previous') $pagesize"  accesskey="p" />
											</form>
										#else
											<form name="prevpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
												<input type="submit" name="eventSubmit_doList_prev" value="&lt;" disabled="disabled" />
											</form>									
										#end
									#end
									<form name="pagesizeForm" class="inlineForm" method="post" action="#toolForm("$action")">
										<input type="hidden" name="eventSubmit_doChange_pagesize" value="changepagesize" />
										<span class="skip">$tlang.getString("gen.listnavselect")</span>
										<select name="selectPageSize" onchange="blur();document.pagesizeForm.submit();">
											<option value="5" #if($pagesize == 5) selected="selected" #end>$tlang.getString("gen.show5")</option>
											<option value="10" #if($pagesize == 10) selected="selected" #end>$tlang.getString("gen.show10")</option>
											<option value="20" #if($pagesize == 20) selected="selected" #end>$tlang.getString("gen.show20")</option>
											<option value="50" #if($pagesize == 50) selected="selected" #end>$tlang.getString("gen.show50")</option>
											<option value="100" #if($pagesize == 100) selected="selected" #end>$tlang.getString("gen.show100")</option>
											<option value="200" #if($pagesize == 200) selected="selected" #end>$tlang.getString("gen.show200")</option>
										</select>
									</form>
									#if ($pagesize != 0)
										#if ($goNPButton == "true")
											<form name="nextpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
												<input type="submit" name="eventSubmit_doList_next" value="&gt;" title="$tlang.getString('gen.next') $pagesize"  accesskey="n" />
											</form>
										#else
											<form name="nextpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
												<input type="submit" name="eventSubmit_doList_next" value="&gt;" disabled="disabled" />
											</form>
										#end				
										#if ($goLPButton == "true")
											<form name="lastpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
												<input type="submit" name="eventSubmit_doList_last" value="&gt;|" title="$tlang.getString("gen.last")" />
											</form>
										#else
											<form name="lastpageForm" class="inlineForm" method="post" action="#toolForm("$action")">
												<input type="submit" name="eventSubmit_doList_last" value="&gt;|" disabled="disabled" />
											</form>
										#end
									#end
##									<br />
								</div>
							</div>	
							<form name="announcementListForm" action="#toolForm("AnnouncementAction")" method="post">
							<table class="listHier" border="0" cellspacing="0" summary="$tlang.getString("gen.tablecaptionsitebody") ">
							 #set ($rowCount=0)
							 #foreach ($ann_item in $showMessagesList)
								#set ($rowCount =$rowCount + 1)
								<tr class="highLightRow">
									 <td>
									 	<h4>
											#if ($ann_item.Header.draft)
											<a href="#toolLinkParam("AnnouncementAction" "doReviseannouncement" "itemReference=$validator.escapeUrl($ann_item.reference)")" title="$tlang.getString("gen.editdraft") $validator.escapeHtml($ann_item.Header.subject)"><span class="highlight">$tlang.getString("gen.draft") - </span>
												$validator.escapeHtml($ann_item.Header.subject)</a>
											#else
												<a href="#toolLinkParam("AnnouncementAction" "doShowmetadata" "itemReference=$validator.escapeUrl($ann_item.reference)")" title="$tlang.getString("gen.viewann") $validator.escapeHtml($ann_item.Header.subject)">
												$validator.escapeHtml($ann_item.Header.subject)</a>
											#end
											#set ($size = 0)
											#if (!$ann_item.Header.Attachments.isEmpty())
												#set ($props = false)
												#set ($size = $ann_item.Header.Attachments.size())
												#foreach ($attachment in $ann_item.Header.Attachments)
													#set ($props = $attachment.Properties)
													#if (!$props)
															#if ($size > 0) #set ($size = $size - 1) #end
													#end
												#end
											#end
											#if ($size == 0)
											#else
												<img src = "#imageLink("sakai/attachments.gif")" border="0" alt="attachment" />
											#end
											</h4>
										</td>
										#if (!$displayOptions.isShowAnnouncementBody())
											<td>
										/	($validator.escapeHtml($ann_item.Header.From.DisplayName) - $ann_item.Header.Date.toStringLocalFull())
											</td>
										#end
										<td 
										#if  ( ($channel.allowEditMessage($ann_item.Id)) || ($channel.allowRemoveMessage($ann_item.Message)) ) 
										#end
										>
										#if  ( ($channel.allowEditMessage($ann_item.Id)) && ($channel.allowRemoveMessage($ann_item.Message)) ) 
											#set($separator=" | ")
										#else
											#set($separator="")
										#end
											#if ($channel.allowEditMessage($ann_item.Id))
												<span class="itemAction"><a href="#toolLinkParam("AnnouncementAction" "doReviseannouncement" "itemReference=$validator.escapeUrl($ann_item.reference)")" title="$tlang.getString("gen.editann") $validator.escapeHtml($ann_item.Header.subject)">$tlang.getString("gen.revise")</a>
											#end
											$separator 
											#if ($channel.allowRemoveMessage($ann_item.Message))
											<a href="#toolLinkParam("AnnouncementAction" "doDelete_announcement_link" "itemReference=$validator.escapeUrl($ann_item.reference)")" 	title="$tlang.getString("gen.removeann") $validator.escapeHtml($ann_item.Header.subject)">$tlang.getString("gen.delete")</a>
											#end
											</span>
										</td>
									#if ($displayOptions.isShowAnnouncementBody())
										</tr>
										<tr>
											## need to test this with the WYSIWIG - if a <p> is created...										
											<td colspan="2">
													<p class="textPanelFooter">
														($validator.escapeHtml($ann_item.Header.From.DisplayName) - $ann_item.Header.Date.toStringLocalFull())
													</p>	
												<div class="textPanel">$ann_item.TrimmedBody</div>
											</td>
										</tr>
									#end
								#end
						</table>
						</form>
					#end
				#end
			#end
		#end
	#end	
</div>
