%tr#annonce_row{:id => annonce.id, :class => ("success " if annonce.moderated and !annonce.refused).to_s+("warning " if annonce.moderated and annonce.refused).to_s}
  %td
    =l annonce.created_at, :format => :short
  %td{:style => "width:200px"}
    -if annonce.default_photo
      =image_tag annonce.default_photo.file.medium.thumb.url
  %td
    
    = link_to annonce.annonce_account.pseudo_admin, [:admin, annonce.annonce_account] if annonce.annonce_account
    
  %td
    =annonce.title
    
  %td
  
    -if annonce.frontpage
      =#link_to "Ne plus afficher cette annonce sur la page d'accueil", admin_annonce_path(:id => annonce.id, :annonce => {:frontpage => false}), :method => "PATCH", :class => "btn btn-danger", :remote => true
    -else
      =#link_to "Autoriser l'affiche en page d'accueil", admin_annonce_path(:id => annonce.id, :annonce => {:frontpage => true}), :method => "PATCH", :class => "btn btn-success", :remote => true
  
  %td

  
    =link_to "Accepter", admin_annonce_path(:id => annonce.id, :annonce => {:refused => "NULL"}), :method => "PATCH", :class => "btn btn-success", :remote => true

    =link_to "Refuser", admin_annonce_path(:id => annonce.id, :annonce => {:refused => 1}), :method => "PATCH", :class => "btn btn-danger", :remote => true
  %td
    -if annonce.refused
      refusé avant
  %td
    =link_to "Voir l'annonce", public_annonce_path(annonce)
    
  