suite
This commit is contained in:
parent
548982d228
commit
131427a68c
@ -47,8 +47,8 @@
|
||||
-else
|
||||
-if !@m_odr_rep
|
||||
-@m_odr_rep = @m_odr.m_odr_reps.new(:t => params[:t])
|
||||
-@m_odr_rep.particulars.build(:skip_organisation => true, :validate_name => true,:validate_email => true)
|
||||
-@m_odr_rep.m_odr_rep_ribs.build()
|
||||
-@m_odr_rep.particulars.build(:skip_organisation => true, :validate_name => true,:skip_email => (true if !@m_odr.email_needed), :validate_email => (true if @m_odr.email_needed),:validate_tel => (true if @m_odr.tel_needed),:skip_validation => (true if !@m_odr.address_needed))
|
||||
-@m_odr_rep.m_odr_rep_ribs.build() if @m_odr.rib_process
|
||||
|
||||
- @m_odr.m_odr_file_types.each do |ft|
|
||||
-@m_odr_rep.m_odr_files.build(:m_odr_file_type_id => ft.id)
|
||||
@ -56,6 +56,7 @@
|
||||
|
||||
#odr_form
|
||||
=semantic_form_for [:public, @m_odr_rep], html: { multipart: true } , :remote => false do |f|
|
||||
=debug @m_odr_rep.errors.messages if current_admin
|
||||
=f.hidden_field :m_odr_id
|
||||
=hidden_field_tag :force, params[:force]
|
||||
=f.hidden_field :t
|
||||
@ -69,62 +70,75 @@
|
||||
=f.hidden_field :validate_name
|
||||
=f.hidden_field :skip_organisation
|
||||
=f.hidden_field :validate_tel
|
||||
=f.hidden_field :validate_email
|
||||
=f.hidden_field :skip_email
|
||||
=f.hidden_field :skip_validation
|
||||
|
||||
%table
|
||||
%table{:style => "width:100%;"}
|
||||
%tr
|
||||
%td{:style => "width:20%;padding-right:4px;"}
|
||||
=f.input :civilite, :label => false, :placeholder => "Civilité", :as => :select, :collection => [[qit("don-particular-civilite-mme","Mme."), "Mme"], [qit("don-particular-civilite-m","M."), "M"]], :include_blank => true
|
||||
%td{:style => "width:40%;padding-right:4px;"}
|
||||
=f.input :name, :label => false, :placeholder => "Nom"
|
||||
=f.input :name, :label => false, :placeholder => (@m_odr_rep.m_odr.name_label? ? @m_odr_rep.m_odr.name_label : "Nom")
|
||||
|
||||
%td{:style => "width:40%"}
|
||||
=f.input :firstname, :label => false, :placeholder => "Prénom"
|
||||
=f.input :firstname, :label => false, :placeholder => (@m_odr_rep.m_odr.firstname_label? ? @m_odr_rep.m_odr.firstname_label : "Nom")
|
||||
|
||||
=f.input :address_2, :label => false, :placeholder => "Adresse"
|
||||
=f.input :address_3, :label => false, :placeholder => "Adresse suite"
|
||||
%table
|
||||
%tr
|
||||
%td{:style => "width:30%;padding-right:4px;"}
|
||||
=f.input :cp, :label => false, :placeholder => "Code postal"
|
||||
%td{:style => "width:70%"}
|
||||
=f.input :city, :label => false, :placeholder => "Ville"
|
||||
-if @m_odr_rep.m_odr.address_process
|
||||
=f.input :address_2, :label => false, :placeholder => "Adresse"
|
||||
=f.input :address_3, :label => false, :placeholder => "Adresse suite"
|
||||
%table{:style => "width:100%;"}
|
||||
%tr
|
||||
%td{:style => "width:30%;padding-right:4px;"}
|
||||
=f.input :cp, :label => false, :placeholder => "Code postal"
|
||||
%td{:style => "width:70%"}
|
||||
=f.input :city, :label => false, :placeholder => "Ville"
|
||||
|
||||
=f.input :country, :label => false, :placeholder => "Pays", :priority_countries => ["FR", "CH", "BE"], :include_blank => false, :locale => @lang.slug
|
||||
.select=f.input :country, :label => false, :placeholder => "Pays", :priority_countries => ["FR", "CH", "BE"], :include_blank => false, :locale => @lang.slug
|
||||
|
||||
=f.input :email, :label => "Email :"
|
||||
|
||||
=f.input :tel, :label => "Tel :"
|
||||
-if @m_odr_rep.m_odr.email_process
|
||||
=f.input :email, :label => (!@m_odr_rep.m_odr.placeholder? ? false : "Email :"), :placeholder => (@m_odr_rep.m_odr.placeholder? ? false : "Email")
|
||||
|
||||
-if @m_odr_rep.m_odr.tel_process
|
||||
=f.input :tel, :label => (!@m_odr_rep.m_odr.placeholder? ? false : "Tel :"), :placeholder => (@m_odr_rep.m_odr.placeholder? ? false : "Tel")
|
||||
Nous ne vous contacterons par téléphone qu’en cas de problème avec votre dossier
|
||||
|
||||
.form_pannel
|
||||
%h3 Vos coordonnées bancaires
|
||||
-if @m_odr_rep.m_odr_rep_ribs.size > 0
|
||||
.form_pannel
|
||||
%h3 Vos coordonnées bancaires
|
||||
|
||||
=f.inputs do
|
||||
=f.semantic_fields_for :m_odr_rep_ribs do |f|
|
||||
%table
|
||||
%tr
|
||||
%td{:style => "width:20%;padding-right:4px;"}
|
||||
=f.input :bic, :label => "Bic : "
|
||||
%td{:style => "width:40%;padding-right:4px;"}
|
||||
=f.input :iban, :label => "Iban :", :input_html => {:class => "iban_input"}
|
||||
=f.inputs do
|
||||
=f.semantic_fields_for :m_odr_rep_ribs do |f|
|
||||
%table
|
||||
%tr
|
||||
%td{:style => "width:20%;padding-right:4px;"}
|
||||
=f.input :bic, :label => "Bic : "
|
||||
%td{:style => "width:40%;padding-right:4px;"}
|
||||
=f.input :iban, :label => "Iban :", :input_html => {:class => "iban_input"}
|
||||
|
||||
:javascript
|
||||
$('.iban_input').mask('SSAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AA', {
|
||||
placeholder: '____ ____ ____ ____ ____ ____ ____ ____ __'
|
||||
});
|
||||
:javascript
|
||||
$('.iban_input').mask('SSAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AA', {
|
||||
placeholder: '____ ____ ____ ____ ____ ____ ____ ____ __'
|
||||
});
|
||||
|
||||
|
||||
.form_pannel
|
||||
%h3 Votre achat
|
||||
|
||||
=f.inputs do
|
||||
=f.input :m_odr_product_id, :label => "Pneu :", :as => :select, :collection => f.object.m_odr.m_odr_products.where(:m_odr_brand_id => f.object.m_odr.m_odr_brands.where("(start_at is null or start_at <= ?) and (public_end is null or public_end >= ?)", Date.today,Date.today) ).order("m_odr_brand_id ASC, m_odr_products.name"), :member_label => :member_label, :include_blank => true
|
||||
-if f.object.m_odr.m_odr_product_cats.count > 0
|
||||
=f.inputs do
|
||||
=f.input :m_odr_product_cat_id, :label => (!@m_odr_rep.m_odr.placeholder ? false :(@m_odr_rep.m_odr.product_cat_label? ? @m_odr_rep.m_odr.product_cat_label : "Types :")), :as => :select, :collection => f.object.m_odr.m_odr_product_cats.order("id ASC"), :member_label => :name, :include_blank => false
|
||||
|
||||
|
||||
=f.inputs do
|
||||
=f.input :qte, :label => "Nombre de pneus :", :as => :select, :collection => [1,2], :include_blank => true
|
||||
=f.input :m_odr_product_id, :label => (!@m_odr_rep.m_odr.placeholder ? false :(@m_odr_rep.m_odr.product_label? ? @m_odr_rep.m_odr.product_label : "Pneu :")), :as => :select, :collection => f.object.m_odr.m_odr_products.where(:m_odr_brand_id => f.object.m_odr.m_odr_brands.where("(start_at is null or start_at <= ?) and (public_end is null or public_end >= ?)", Date.today,Date.today) ).order("m_odr_brand_id ASC, m_odr_products.name"), :member_label => :member_label, :include_blank => true, :prompt => (@m_odr_rep.m_odr.product_label? ? @m_odr_rep.m_odr.product_label : "Pneu")
|
||||
|
||||
=f.inputs do
|
||||
=f.input :m_odr_place, :label => "Point de vente :", :as => :select, :collection => f.object.m_odr.m_odr_places.order(:name), :include_blank => true
|
||||
=f.input :qte, :label => (!@m_odr_rep.m_odr.placeholder ? false :(@m_odr_rep.m_odr.qte_label? ? @m_odr_rep.m_odr.qte_label : "Nombre de pneus :")), :as => :select, :collection => f.object.m_odr.m_odr_product_remises.group(:qte).order("qte").map{|a| a.qte}, :include_blank => true, :prompt => (@m_odr_rep.m_odr.qte_label? ? @m_odr_rep.m_odr.qte_label : "Nombre de pneus")
|
||||
|
||||
=f.inputs do
|
||||
=f.input :m_odr_place, :label => (!@m_odr_rep.m_odr.placeholder ? false :(@m_odr_rep.m_odr.place_label? ? @m_odr_rep.m_odr.place_label : "Point de vente :")), :as => :select, :collection => f.object.m_odr.m_odr_places.order(:name), :include_blank => true, :prompt => (@m_odr_rep.m_odr.place_label? ? @m_odr_rep.m_odr.place_label : "Point de vente :")
|
||||
|
||||
|
||||
|
||||
@ -133,6 +147,8 @@
|
||||
=f.input :file, :label => f.object.m_odr_file_type.name
|
||||
=f.hidden_field :m_odr_file_type_id
|
||||
|
||||
-if @m_odr_rep.m_odr.confirm_case_needed
|
||||
=f.input :rgpd, :label => (@m_odr_rep.m_odr.confirm_case_label? ? @m_odr_rep.m_odr.confirm_case_label : "J'accepte les conditions générales")
|
||||
%br
|
||||
%center=f.submit "Envoyer", :class => "btn btn-primary btn-lg"
|
||||
%br
|
||||
@ -149,3 +165,75 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-if [3,4].include?(@m_odr_rep.m_odr_id)
|
||||
:scss
|
||||
body{
|
||||
color:#333}
|
||||
h3{
|
||||
text-transform:uppercase;
|
||||
text-align:center;
|
||||
font-weight:bold;
|
||||
}
|
||||
.form-control{
|
||||
border-radius:0;
|
||||
font-size:1.2em;
|
||||
width:100%;
|
||||
box-sizing:border-box;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 0;
|
||||
outline: 0;
|
||||
background: #f6f6f6;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
box-shadow:0 0 0 white !important;
|
||||
padding: 25px 14px;
|
||||
|
||||
&:focus{
|
||||
border-color: #fdda26;
|
||||
|
||||
}
|
||||
}
|
||||
.form_pannel{
|
||||
box-shadow:0 0 0 white !important;
|
||||
|
||||
}
|
||||
|
||||
.select { position: relative; text-align: left; }
|
||||
|
||||
|
||||
.select select {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
height: 52px;
|
||||
|
||||
padding:0 14px;
|
||||
|
||||
border: 1px solid transparent;
|
||||
border-radius: 0; outline: 0; background: #f6f6f6; font-weight: normal; font-size: 14px; color: #333; -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer; }
|
||||
|
||||
|
||||
|
||||
|
||||
select{
|
||||
|
||||
|
||||
padding-right: 40px;
|
||||
padding-left: 14px;
|
||||
|
||||
|
||||
border-radius:0 !important;
|
||||
-webkit-appearance: none;
|
||||
color:#333;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.btn-primary{
|
||||
background:#fdda26;
|
||||
border:0;
|
||||
color:black;
|
||||
font-size:14px;
|
||||
padding:15px 40px;border-radius:0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user