-if @text_content.id
  =semantic_form_for( [:portlet, @text_content], :remote => true, :html => {:"data-portlet-id" => @text_content.portlet.id}) do |f|
  
    %p{:style => "text-align:center;"}= f.submit "Sauvegarder", :class => "btn btn-primary"
  
    =f.text_area :content, :style => "width:98%;height:600px;", :class => "redactor_content", :style => "display:none;"

  
  
  
    -if TextContent::STYLES.size > 0
      Style :
      = f.select :style, TextContent::STYLES


 
    :javascript
      $("#element_form form").submit(function (e){
      
        $("textarea").val($('#portlet_'+$("#element_form form").data("portlet-id")+' .content').html());
        $("#toolbar-text").html("");
      
      });
  
      $('#portlet_'+$("#element_form form").data("portlet-id")+' .content').redactor({
        toolbarExternal: '#toolbar-text',
        lang: 'fr',
        buttons : ['undo','redo','|', 'formatting', '|', 'bold', 'italic', 'deleted','underline','|', 'alignleft', 'aligncenter', 'alignright', 'justify', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'table', 'link', '|','fontcolor', 'backcolor','|', 'horizontalrule', '|','html']
      
      
    
      });
  
    



    
  
  
-else
  =semantic_form_for( [:portlet, @text_content], :remote => true) do |f|
  
    %p{:style => "text-align:center;"}= f.submit "Sauvegarder", :class => "btn btn-primary"
  
    =f.text_area :content, :style => "width:98%;height:600px;", :class => "redactor_content"

  
  
  
    -if TextContent::STYLES.size > 0
      Style :
      = f.select :style, TextContent::STYLES


  
  

    :javascript
    
      $('.redactor_content').redactor({
        toolbarExternal: '#toolbar-text',
        lang: 'fr',
       
        buttons : ['undo','redo','|', 'formatting', '|', 'bold', 'italic', 'deleted','underline','|', 'alignleft', 'aligncenter', 'alignright', 'justify', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'table', 'link', '|','fontcolor', 'backcolor','|', 'horizontalrule', '|','html']
      
    
      });
  
  



    
  
  
