.row-fluid
  .span9
    = link_to 'Ajouter une citation dans le reposoir', new_admin_quote_path, :remote => true, :class => "btn btn-success btn-large", :style => "float:right;"
    %h1 Liste des quotes



  
    %table.table.table-striped
      %thead#Admin_rows_header.rows_header
    
        %tr
          %td
            Titre du quote
          %td
            Auteur
          %td
            Tags
          %td
            Public
      
        
  
      
          %td{:style => "width:100px"}
            &nbsp;
  
    
      
      
      %tbody#quote_rows.rows
    
        =render @quotes

  .span3
    %h3 Tags
    =render :partial => "tags"
  

  :coffeescript
    root = exports ? this
    root.tag_id = []
  
  
    $(document.body).on "click", "#tags .tag_label", ->
    
      if $(this).hasClass("active")
        $(this).removeClass "active"  
      
      else
        $(this).addClass "active"
    
      root.tag_id = []
    
      $("#tags .tag_label.active").each ->
        root.tag_id.push $(this).data "tag_id"
      
      if root.tag_id.length > 0
        $(".set_tag").show()
      else
        $(".set_tag").hide()
   
   
    $(document.body).on "click", ".set_tag", ->    
    
      $.ajax({
        url:$(this).attr("href"), 
        type: "PUT",
        data: { 
        tag_id : tag_id
        } 

      })

      return false
  

  
  


