%h1= @newsletter.title
%table.table
  %tr
    %th Date d'envoi
    %th Nombre de messages envoyés
    %th Nombre de messages lus
    %th Nombre de messages non-lus
  -ArchiveNewsletter.where(:newsletter_id => @newsletter.id).all.each do |archive_newsletter|
    %tr
      %td=l archive_newsletter.created_at
      %td=mail_send = archive_newsletter.mail_archives.count()
      %td
        =mail_read = archive_newsletter.mail_archives.where(:readed => true).count()
        -if mail_send > 0
          ="("
          =number_to_percentage (100.0*mail_read)/mail_send, :precision => 1
          =")"
      %td
        =mail_no_read = mail_send - mail_read
        -if mail_send > 0
          ="("
          =link_to number_to_percentage((100.0*mail_no_read)/mail_send, :precision => 1), history_detail_admin_newsletter_path(archive_newsletter.id)
          =")"
        
        
        