##<!-- $Header: /cvs/sakai2/legacy/tools/src/webapp/vm/sitebrowser/chef_sitebrowser_list.vm,v 1.2 2005/06/06 16:26:15 suiyy.umich.edu Exp $ -->
<script type="text/javascript" language="JavaScript">
	focus_path = ["search"];
</script>
	
<div class="portletBody">
	
	#*
	<div class="chefToolBarWrapForm">
		#if (($menu) && (!$menu.isEmpty()))
			#foreach ($item in $menu.Items)
				## figure the link
				#set ($base=$sakai_ActionURL.reset().setParameter("sakai_action", $item.Action).toString())
		
				## enabled not field not divider (i.e. a button)
				#if (!$item.IsField)
					<a href="#" title="$item.Title" onclick="location = '$base'#if($item.Form)+buildQueryString('$item.Form')#end;return false;">
						$item.Title
					</a>
				## here's a text field in a form for the toolbar
				#else
				<form name="$item.Form" action="$base" class="inlineForm" method="post">
					<input size="15" value="$item.Value" name="$item.Title" id="$item.Title" type="text" class="searchField" />
				</form>
				#end
			## end of foreach loop
			#end
		## end if "if there's a menu" if
		#end
	</div>
	*#
	<div class="navIntraTool">
		<a href="#" onclick="location='#toolLink("$action" "doShow_simple_search")';return false;" onkeypress="location='#toolLink("$action" "doShow_simple_search")';return false;" title ="Search">$tlang.getString("list.search")</a>
	</div>
	<h3>$tlang.getString("list.results")</h3>
	#if ($sites.size() > 0)
		<div class="navPanel">
			<div class="viewNav">
				<div class="instruction indnt1">
				#if ("$!siteType" == "") #set($siteType="Any") #end
						#if ($termSelection)
							$allMsgNumber $tlang.getString("list.sites") "$siteType" $tlang.getString("list.type2") "$!searchText" $tlang.getString("list.text") "$termSelection" $tlang.getString("list.aca")    	
						#else
							$allMsgNumber $tlang.getString("list.sites") "$siteType" $tlang.getString("list.type1") "$!searchText".
						#end
					</p>	
			</div>
			<div class="listNav">
				<div class="instruction">$tlang.getString("list.view") $topMsgPos - $btmMsgPos $tlang.getString("list.of") $allMsgNumber $tlang.getString("list.items")</div>
				#if ($pagesize != 0)
					#if ($goPPButton == "true")
						<form name="nextpageForm" style="display:inline" method="post" action="#toolForm("$action")">
							<input type="submit" name="eventSubmit_doList_prev" value="&lt;"  title="$tlang.getString("list.previous") $pagesize" accesskey="p" />
						</form>
					#else
						<input type="submit" name="eventSubmit_doList_prev" value="&lt;"  disabled="disabled" />
					#end
				#end
			
				<form name="pagesizeForm" style="display:inline" method="post" action="#toolForm("$action")">
					<input type="hidden" name="eventSubmit_doChange_pagesize" value="changepagesize" />
						<label for="select" class="skip">$tlang.getString("list.select")</label>
						<select name="selectPageSize" onchange="blur();document.pagesizeForm.submit();" id="select">
							<option value="5" #if($pagesize == 5) selected="selected" #end>$tlang.getString("list.show1")</option>
							<option value="10" #if($pagesize == 10) selected="selected" #end>$tlang.getString("list.show2")</option>
							<option value="20" #if($pagesize == 20) selected="selected" #end>$tlang.getString("list.show3")</option>
							<option value="50" #if($pagesize == 50) selected="selected" #end>$tlang.getString("list.show4")</option>
							<option value="100" #if($pagesize == 100) selected="selected" #end>$tlang.getString("list.show5")</option>
							<option value="200" #if($pagesize == 200) selected="selected" #end>$tlang.getString("list.show6")</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("list.next") $pagesize" accesskey="n" />
						</form>
					#else
							<input type="submit" name="eventSubmit_doList_next" value="&gt;" disabled="disabled" />
					#end
				#end

			</div>
		</div>

	#set ($siteCount = 0)
		<table summary ="$tlang.getString("list.summary")" class="listHier lines nolines" cellspacing="0" cellpadding="0" border="0">
		
			<tr>
				<th scope="col" id="title">$tlang.getString("list.work")</th>
				<th scope="col" id="type">$tlang.getString("list.type")</th>
				<th scope="col" id="owner">$tlang.getString("list.owner")</th>
				<th scope="col" id="joinable">$tlang.getString("list.joinable")</th>
				<th scope="col" id="term">$tlang.getString("list.term")</th>
				<th scope="col" id="description">$tlang.getString("list.description")</th>
			</tr>
			#foreach ($site in $sites)
                #set ($siteCount=$siteCount + 1)
                #set ($shortDesc = "")
                #set ($desc = "")
                <tr>
                        <td headers="title">
							<h4>
                             <a href="#toolLinkParam("$action" "doVisit" "id=$validator.escapeUrl($site.Id)")" title="$tlang.getString("list.go") $validator.escapeHtml($site.Title) $tlang.getString("site")">
                                        $validator.escapeHtml($site.Title)
                               </a>
							  </h4> 
                       </td>

                        <td headers="type">
                        #set($type = $site.Type)
                     	$validator.escapeHtml($!type)
                        </td>
                        
                        <td headers="owner">
                        $site.CreatedBy.DisplayName
                        </td>
                        
                        <td headers="joinable">
                        $site.isJoinable()
                        </td>

                        <td headers="term">
             			#if ($termProp)
             				#if ($site.getProperties().getProperty($termProp))
	                        	$site.getProperties().getProperty($termProp)
	                        #else
	                        	n/a
	                        #end
             			#else
	                        n/a
	                    #end
                        </td>
                                                
                        <td headers="description">
                                #set ($shortDesc = $site.ShortDescription)

                                #if ($shortDesc)
                                        #if ($shortDesc.equals(""))
                                               #set ($desc = $site.Description)
                                               #if ($desc)
		                                               #if ($desc.length() > 85)
		                                                       #set ($desc = $desc.substring(0, 85))
		                                                       $validator.escapeHtml($desc)...
		                                               #else
		                                               		#if ($desc.equals(""))
		                                               				&nbsp;
		                                               		#else
		                                                       		$validator.escapeHtml($desc)
		                                                    #end
		                                               #end
                                               #else
 	                                           		&nbsp;
                                               #end
                                                     
                                        #else
                                                $validator.escapeHtml($shortDesc)
                                        #end
                                #else
                                        #set ($desc = $site.Description)
                                        #if ($desc)
		                                        #if ($desc.length() > 85)
		                                                #set ($desc = $desc.substring(0, 85))
		                                                $validator.escapeHtml($desc)...
		                                        #else
		                                                #if ($desc.equals(""))
		                                               			&nbsp;
		                                               	#else
		                                                	    $validator.escapeHtml($desc)
		                                                #end
		                                        #end
		                                 #else
 	                                           	&nbsp;
                                         #end
                                #end &nbsp;
                        </td>
                </tr>
			#end ##foreach
		</table>
#else
		<p class="instruction">
			$tlang.getString("list.nosites")
		</p>
#end

</div>
