.html_content_form
  
  =semantic_form_for( [:portlet, @html_content], :remote => true) do |f|


    =f.text_area :content, :style => "width:98%;height:400px;", :class => "inputText", :id => "ace_editor_textarea"

    %pre#ace_editor_pre{:style => "margin:0px;"}
    =raw "<!---"
    <script>
    var editor;

    editor = ace.edit("ace_editor_pre");
    editor.setTheme("ace/theme/textmate");
    editor.getSession().setMode("ace/mode/html");
    editor.setPrintMarginColumn(0);
    editor.session.setUseWrapMode(true);

    var textarea = $('#ace_editor_textarea').hide();
    editor.getSession().setValue(textarea.val());
  
    editor.getSession().on('change', function(){

    textarea.val(editor.getSession().getValue());

  
    });
  


    </script>
  
    =raw "---->"
    %table.form_table
      %tr
        %td Style :
        %td= f.select :content_type, HtmlContent::CONTENT_TYPES
    
  
  
    .action
      %button{:onclick => "$(this).closest('.html_content_form').toggleClass('large');editor.resize() ;return false;"} zoom
    


    -if HtmlContent::STYLES.size > 0
      %table.form_table
        %tr
          %td Style :
          %td= f.select :style, HtmlContent::STYLES
  
      
    
