<%
  String[] hiddenField1 = ["jcrPath=/node/jcr:content", "nodetype=nt:resource", "mixintype=dc:elementSet", "visible=false"] ; 
  String[] hiddenField2 = ["jcrPath=/node/jcr:content/jcr:encoding", "visible=false", "UTF-8"] ;  
  String[] hiddenField4 = ["jcrPath=/node/jcr:content/jcr:lastModified", "visible=false"] ;
  String[] hiddenField5 = ["jcrPath=/node/jcr:content/dc:date", "visible=false"] ;
  String[] hiddenField6 = ["jcrPath=/node/jcr:content/jcr:mimeType", "visible=false", "text/css"] ;
  uicomponent.addHiddenField("hiddenInput1", hiddenField1) ;
  uicomponent.addHiddenField("hiddenInput2", hiddenField2) ;
  uicomponent.addHiddenField("hiddenInput6", hiddenField6) ;
  uicomponent.addCalendarField("hiddenInput4", hiddenField4) ;
  uicomponent.addCalendarField("hiddenInput5", hiddenField5) ;
%>
<style>
	.UIForm .HorizontalLayout textarea { 
	  font-size:11px;
	  height:275px !important;
	  width:525px !important;
	 }
</style>
<div class="UIForm">  
  <% uiform.begin() %>
  <div class="HorizontalLayout">
    <table class="UIFormGrid">
        <tr>
          <td class="FieldLabel"><%=_ctx.appRes("CSSFile.dialog.label.name")%></td>
          <td class="FieldComponent">
            <%
              String[] fieldName = ["jcrPath=/node", "nodetype=nt:file", "mixintype=exo:cssFile,mix:i18n","editable=if-null", "validate=name, empty"] ;
              uicomponent.addTextField("name", fieldName) ; 
            %>
          </td>
        </tr>
        
        <tr>
        	<td class="FieldLabel"><%=_ctx.appRes("CSSFile.dialog.label.active")%></td>
        	<td class="FieldComponent">
        		<%
        			String[] fieldActive = ["jcrPath=/node/exo:active", "options=true,false", "onchange=false"] ;
        			uicomponent.addSelectBoxField("activeCSS", fieldActive) ;
        		%>
        	</td>
        </tr>
        
        <tr>
        	<td class="FieldLabel"><%=_ctx.appRes("CSSFile.dialog.label.priority")%></td>
        	<td class="FieldComponent">
        		<%
        			String[] fieldPriority = ["jcrPath=/node/exo:priority", "validate=org.exoplatform.webui.form.validator.NumberFormatValidator"] ;
        			uicomponent.addTextField("CSSpriority", fieldPriority) ;
        		%>
        	</td>
        </tr>
        <tr>
        	<td class="FieldLabel"><%=_ctx.appRes("ElementSet.dialog.label.language")%></td>
			<td class="FieldComponent">
			<%
			  String lang = org.exoplatform.portal.webui.util.Util.getPortalRequestContext().getLocale().getLanguage();
			  String[] fieldLang = ["jcrPath=/node/exo:language", "options=en,fr,es,de", lang] ;
			  uicomponent.addSelectBoxField("lang", fieldLang) ;
			%>
			</td>
		</tr>     
        <tr>
          <td class="FieldLabel"><%=_ctx.appRes("CSSFile.dialog.label.content")%></td>
          <td class="FieldComponent">
            <%
              if(uicomponent.isEditing()) { 
                def curNode = uicomponent.getNode() ;
                if(curNode.hasNode("jcr:content")) {
                  def content = curNode.getNode("jcr:content") ;                                      
                  String[] fieldSummary = ["jcrPath=/node/jcr:content/jcr:data"] ;
                  uicomponent.addTextAreaField("contentHtml", fieldSummary) ;                                                       
                  }
                } else {                           
                String[] fieldSummary = ["jcrPath=/node/jcr:content/jcr:data"] ;
                uicomponent.addTextAreaField("contentHtml", fieldSummary) ;                
              }
            %>      
          </td>
        </tr>
               
    </table>       
    <%/* start render action*/%>
    <div class="UIAction" style="display:block;"> 
      <table class="ActionContainer" align="center">
        <tr>
          <td align="center">
            <% for(action in uicomponent.getActions()) { 
                 String actionLabel = _ctx.appRes(uicomponent.getName() + ".action." + action) ;
                 String link = uicomponent.event(action) ;
            %>
              <a href="$link" class="ActionButton LightBlueStyle">
                <div class="ButtonLeft">
                  <div class="ButtonRight">
                    <div class="ButtonMiddle">
                      $actionLabel
                    </div>
                  </div>
                </div>
              </a>
            <%}%>          
          </td>
        </tr>
      </table>
    </div>
    <%/* end render action*/%>
  </div>
  <%uiform.end()%>
</div>