#message_form
  .form
  
    %h3 Contenu du message
    
  
    =f.hidden_field :forum_topic_id
    =f.hidden_field :forum_user_id
    
    %br
    %br
    
    
    .forum_message


      .left

        .user
          =image_tag((current_fuser.avatar? ? current_fuser.avatar.square.url : ""), :class => "avatar" )
          %br
          =current_fuser.firstname+" "+current_fuser.name
      
        .date=l @message.created_at, :format => :human if @message and @message.created_at
  
      .right{:style => "padding:0px;"}
        .content{:style => "border:0px;padding:2% !important;min-height:200px;background:transparent !important;"}
          =raw f.object.description
    =f.text_area :description, :id => "redactor_content", :style => "display:none;"  
    
    .fix-submit
      =f.submit "Sauvegarder", :class => "btn btn-primary"



    :javascript
      $("#message_form").closest("form").submit(function (e){
    
        $("textarea").val($('#message_form .content').html());
        $("#toolbar-text").html("");
    
      });

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

      
  
  