<%
/**
 * Created by The eXo Platform SARL
 * Author : Dang Van Minh
 *          minh.dang@exoplatform.com
 * Dec 29, 2006
 * 3:28:26 PM 
 */
%>
<%
	private String pathTitle(String inputStr, int defauLength) {
	  String sortName = inputStr ;
	  if(inputStr.length() > defauLength) {
	    sortName = "..." + inputStr.substring(inputStr.length() - defauLength, inputStr.length()) ;
	  }
	  return sortName ;
	}
%>
<div class="UIScriptList" id="$uicomponent.id">
  <table class="UIGrid">
    <thead>
      <tr>
  	    <th><%=_ctx.appRes("UIScriptList.header.scriptName")%></th>
  	    <th><%=_ctx.appRes("UIScriptList.header.path")%></th>
  	    <th><%=_ctx.appRes("UIScriptList.header.baseVersion")%></th>
  	    <th><%=_ctx.appRes("UIScriptList.header.action")%></th>
      </tr>
    </thead>
    <tbody>
      <%
        def rowClass = null ;
  	    boolean even = true ;
  	    for (node in uicomponent.getScriptList()) {
  	      if(even) rowClass = "EvenRow" ;  
  	      else rowClass =  "OddRow" ; 
  	      even = !even ;
      %>
          <tr class="$rowClass">
            <td><div class="Text"><%=node.getName()%></div></td>
            <td><div class="Text" title="<%=node.getPath()%>"><%=pathTitle(node.getPath(), 30)%></div></td>
            <td><div class="Text"><%=node.getBaseVersion()%></div></td>
	          <td>
	          	<div class="ActionContainer">
	            	<img class="Edit16x16Icon" src="/eXoResources/skin/sharedImages/Blank.gif" onclick="<%=uicomponent.event("Edit", node.getName())%>" alt="<%=_ctx.appRes("UIScriptList.tooltip.Edit")%>" title="<%=_ctx.appRes("UIScriptList.tooltip.Edit")%>"/>
	            	<img class="Delete16x16Icon" src="/eXoResources/skin/sharedImages/Blank.gif" onclick="<%=uicomponent.event("Delete", node.getName())%>" alt="<%=_ctx.appRes("UIScriptList.tooltip.Delete")%>" title="<%=_ctx.appRes("UIScriptList.tooltip.Delete")%>"/>
	            </div>
	          </td>	                    
          </tr>
      <%}%>  
    </tbody>
  </table>
  <% if(uicomponent.getUIPageIterator().getAvailablePage() > 1){ %>
  <div style="margin:1px 0px 5px 0px;">
    <%_ctx.renderUIComponent(uicomponent.getUIPageIterator())%>
  </div>
  <% } %>
	<div class="UIAction">
	  <% for(action in uicomponent.getActions()) { %>
		  <a onclick="<%=uicomponent.event(action)%>" class="ActionButton LightBlueStyle" href="javascript:void(0);"><%=_ctx.appRes("UIScriptList.action." + action)%></a>	  				      
	  <% } %>
	</div>
</div>
