

=f.hidden_field :particular_type
=f.hidden_field :skip_validation, :class => "skip_validation"
=f.input :pro, :label => "Je fais un don au nom d'une organisation ou d'une association", :input_html => {:onchange => "organisation_check($(this));", :class => "organisation_checkbox"}
.organisation_fields{:style => ("display:none" if !f.object.pro)}
  =f.input :organisation, :label => "Organisation"

%table
  %tr
    %td{:style => "width:50%"}
      =f.input :firstname, :label => "Prénom"
    %td{:style => "width:50%"}
      =f.input :name, :label => "Nom"
    
=f.input :address_2, :label => "Adresse"
=f.input :address_3, :label => "Adresse suite"
%table
  %tr
    %td{:style => "width:30%"}
      =f.input :cp, :label => "Code postal"
    %td{:style => "width:70%"}
      =f.input :city, :label => "Ville"

=f.input :country, :label => "Pays", :priority_countries => ["FR", "CH", "BE"], :include_blank => true
=f.input :email, :label => "Email"
=f.input :tel, :label => "Téléphone"

:coffeescript
  @organisation_check = (element) ->
    
    if element.is(':checked')
      element.closest('form').find('.organisation_fields').show()
      element.css('background', 'red')
    else
      element.closest('form').find('.organisation_fields').hide()
      
  