%table.table
  %tr
    %td
      Nombre signataires

    %td
      -@ps = PetitionSignator.where("imported is null")
      =@ps.length
  %tr
    %td
      Nombre signataires (sans doublons, par email)

    %td
      -@ps = PetitionSignator.where("imported is null")
      -@ps = @ps.group("email")
      =@ps.length
      
  %tr
    %td
      Nombre signataires avec mail validé, sans doublons

    %td
      -@ps = PetitionSignator.where("imported is null and enabled = 1")
      -@ps = @ps.group("email")
      =@ps.length
  
  %tr  
    %td
      Avec tel ou adresse (ou les deux, sans doublons, par email)

    %td
      -@ps = PetitionSignator.where("imported is null")
      -@ps = @ps.where("(address is not null and address != '') or (phone is not null and phone != '')")
      -@ps = @ps.group("email")
      =@ps.length
  
  %tr  
    %td
      Avec tel

    %td
      -@ps = PetitionSignator.where("imported is null")
      -@ps = @ps.where("(phone is not null and phone != '')")
      -@ps = @ps.group("email")
      =@ps.length


%table.table
  -@ps.limit(100).each do |signator|
    %tr{:class => (signator.enabled ? "success" : "warning")}
      %td=l signator.created_at, :format => :date
      %td=signator.name
      %td=signator.firstname
      %td=signator.address
      %td=signator.address2
      %td
        =signator.cp
        =signator.city
      %td=signator.country
      %td=signator.phone
      %td=signator.email
      %td=#link_to i(:envelope), reconfirm_admin_petition_path(signator) if !signator.enabled
    