=semantic_form_for( [:portlet, @title_content], :remote => true, :html => {:"data-portlet-id" => (@title_content.portlet.id if @title_content.portlet)}) do |f|
  
  =f.text_field :content, :style => "width:98%;", :class => "inputText", :style => ("display:none;" if @title_content.id)

  Importance :
  = f.select :level, TitleContent::LEVELS
  -if TitleContent::STYLES.size > 0
    Style :
    = f.select :style, TitleContent::STYLES
  %br

-if @title_content.id
  
  :javascript
    
    $("#element_form form").submit(function (e){
    
      $("#element_form #title_content_content").val($('#portlet_'+$("#element_form form").data("portlet-id")+' .title_content_inline').redactor('code.get'));
      $("#toolbar-text").html("");
    
    });
    
    $('#portlet_'+$("#element_form form").data("portlet-id")+' .title_content_inline').redactor({
      focus: true,
      toolbarExternal: '#toolbar-text',
      buttonSource: true,
      plugins : [ 'fontcolor', 'scriptbuttons'],
      buttons: [ 'bold', 'italic'],
      allowedTags: ['sup', "strong", "em", "sub", "span", "br"],
      linebreaks: true
    
    
  
    });