<%--
  /**
   * Copyright (c) 2003 by Sun Microsystems, Inc. All rights reserved.
   * Use is subject to license terms.
   *
   * "@(#)sm_createpoolwiz_selecttray.jsp    1.15    03/08/07     SMI"
   * 
   */
 --%>
<%@ include file="/layout/toptags.jsp"%>
<html:html>

<head>
<%@include file="/layout/page_head_section.jsp"%>
</head>

<%@ include file="/layout/wizard_body_tag.jsp" %>
<html:form action="/CreatePoolWizard.do">
<%@ include file="/wizard/wizard_framework_fields.jsp"%>

<div class="content-layout">

<%@ include file="/layout/user_messages.jsp"%>
<% T4Interface currentT4 =
      (T4Interface)session.getAttribute(Constants.HttpSessionFields.CURRENT_T4);
%>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr class="wizard-content-title-row">
    <td>
      <div class="wizard-content-title-text">
        <bean:message key="storage.mgmt.pool.createwiz.selecttray.header" arg0="<%=currentT4.getName()%>"/>
      </div>
    </td>
  </tr>
  <tr>
    <td class="wizard-content-divider"><img alt width="1" height="1" src="/images/general/dot.gif" border="0"></td>
  </tr>
</table>

<!-- spacer between two sections -->
<%@ include file="/layout/spacer.jsp"%>

<!-- tray listing instructions -->
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><bean:message key="storage.mgmt.pool.createwiz.selecttray.instructions"/>
    </td>
  </tr>
</table>

<% if(session.getAttribute("disableNext") == null) { %>


<!-- spacer between two sections -->
<%@ include file="/layout/spacer.jsp"%>
 
  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td nowrap>
        <table border="0" cellspacing="0" cellpadding="0">          
          <tr>
            <td><img alt width="1" height="2" border="0" src="images/general/dot.gif"></td>
          </tr>
          <tr>
            <td nowrap>
              <table class="back-table" border="0" cellspacing="0" cellpadding="1">
                <tr>
                  <td>
                    <table class="front-table" border="0" cellspacing="0" cellpadding="0">
                     <logic:present name="<%=Constants.HttpSessionFields.CREATE_POOL_FORM_NAME%>" property="traysWithSpace">
                      <tr class="header-row">
                        <td></td>
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.id"/>
                          </div>
                        </td>      
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.type"/> 
                          </div>
                        </td>       
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.drivenum.short"/> 
                          </div>
                        </td>           
                        <td nowrap>
                          <div class="table-header-text">
                           <bean:message key="tray.table.unassigned"/> 
                          </div>
                        </td>
                        <% if(currentT4.isFeatureSupported(
                             Constants.SupportedFeature.FEATURE_ARRAY_HOT_SPARE)) { 
                        %>
                        <td nowrap>
                          <div class="table-header-text">
                           <bean:message key="tray.table.ahs"/> 
                          </div>
                        </td>
                        <% } %>
                      </tr>
                      <!-- Begin tray row listing(s) -->                                                    
		      <%
		      //get form
		      com.sun.netstorage.array.mgmt.cfg.ui.forms.PoolCreateForm pcf = 
		      	( com.sun.netstorage.array.mgmt.cfg.ui.forms.PoolCreateForm)
			session.getAttribute(Constants.HttpSessionFields.CREATE_POOL_FORM_NAME);
		      %>
                                                                                      
 				 	    <logic:iterate id="tray" name="<%=Constants.HttpSessionFields.CREATE_POOL_FORM_NAME%>" property="traysWithSpace" type="TrayInterface" indexId="idx">
                          <tr>           
                            <td>
			       <%if(pcf.getTrayToModify() != null && ((TrayInterface)pcf.getTrayToModify()).getId().equals(tray.getId())) { %>
                               <input type="radio" name="index" checked value="<%=idx%>">

			       <% } else { %>
                               <input type="radio" name="index" value="<%=idx%>">
			       <% } %>
                            </td>                  
                            <td align="right">                         
                                <bean:write name="tray" property="id"/>
                            </td>     
                            <td align="center">                         
                                <%
                                  String type = "tray.type." + tray.getTrayType();
                                %>
                                <bean:message key="<%=type%>"/>
                            </td>  
                            <td align="right">                         
                                <bean:write name="tray" property="numberOfDrives"/>
                            </td>                    
                            <td align="right">
                              <%=tray.getNumberOfDisksInRole(Constants.Disks.ROLE_UNASSIGNED)%>
                            </td>                                                            
                            <% if(currentT4.isFeatureSupported(
                                Constants.SupportedFeature.FEATURE_ARRAY_HOT_SPARE)) { 
                            %>
                            <td align="right">                         
                              <%=tray.getNumberOfDisksInRole(Constants.Disks.ROLE_ARRAY_SPARE)%>
                            </td>                    
                            <% } %>
                         </tr>
                        </logic:iterate>
                        
                      </logic:present>                
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
<!-- spacer between two sections -->
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><img alt border="0" height="20" width="1" src="images/general/dot.gif"></td>
  </tr>
</table>

<!-- spacer between two sections -->
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><bean:message key="pool.creation.wizard.seltrays.directions"/></td>
  </tr>
</table>
<% } //end if there are trays with space %>
</div>

</html:form>
</body>

</html:html>
