%li.album_folder#album_folder{:id => album_folder.id}
  %span.over-zone
    =#link_to (ic(:"folder-o")+" "+album_folder.name+(" ("+album_folder.image_files.count.to_s+")" if album_folder.image_files.count > 0).to_s ), admin_image_files_path(:album_folder_id => album_folder.id ), :remote => true, :class => "large_link "+("active" if album_folder.id == params[:album_folder_id].to_i).to_s
    =link_to admin_image_files_path(:album_folder_id => album_folder.id ), :remote => true, :class => "large_link "+("active" if album_folder.id == params[:album_folder_id].to_i).to_s do
      %span.folder_expend{:onclick => ""}
        =ic(:"folder-o")
      =album_folder.name
      
      ="("+album_folder.images_count_cache.to_s+")" if album_folder.images_count_cache? and album_folder.images_count_cache.to_i > 0
    
    .right-links
      =link_to ic(:"plus-square-o"), new_admin_album_folder_path(:parent_id =>album_folder.id ), :remote => true
      =link_to ic(:"plus"), new_admin_album_path(:album_folder_id =>album_folder.id ), :remote => true
  
  %ol{:style => (params[:remote] ? "display:block;" : "display:none;")}
    =render album_folder.children.order(:name)
    
    -album_folder.albums.order(:name).each do |album|
      %li.albums{}
        .right-links2{:style => "float:right"}
    
          =link_to ic(:"pencil"), edit_admin_album_path(album.id), :remote => true
        
        
        =link_to (ic(:"picture-o")+" "+album.name+(" ("+album.images_count_cache.to_s+")" if album.images_count_cache.to_i > 0).to_s), admin_image_files_path(:album_id => album.id, :manager => params[:manager], :multiple => params[:multiple]), :remote => true, :id => "album_"+album.id.to_s,:data_album_id => album.id, :data_album_path => admin_album_path(:format => "js",:album_id => album.id, :manager => params[:manager], :multiple => params[:multiple], :id => album.id), :data_edit_album_path => edit_admin_album_path(:format => "js",:album_id => album.id, :manager => params[:manager], :multiple => params[:multiple], :id => album.id),:class => (album.id == params[:album_id].to_i ? " active" : " image_file_receptable").to_s+" large_link"
       
        
        
        

-if params[:remote]
  :coffeescript
    $("#album_folders .large_link").click ->
      $("#album_folders .large_link").removeClass("active")
      $(this).addClass("active")
      $('#image_files_container').html("Chargement en cours...");
    
    
    
    $("#album_folders .folder_expend").click (event) -> 
      $(this).closest('li').find('ol:first').toggle()
      event.stopPropagation()
      return false
    