diff --git a/app/assets/javascripts/admin.coffee b/app/assets/javascripts/admin.coffee index a833449..1612ede 100644 --- a/app/assets/javascripts/admin.coffee +++ b/app/assets/javascripts/admin.coffee @@ -8,7 +8,7 @@ #= require event_form #= require bootstrap - +#= require ./vendor/jquery.mask # require vendor/jquery-sortable #= require vendor/jquery.event.drag.js #= require vendor/bootstrap-slider diff --git a/app/assets/stylesheets/public.scss b/app/assets/stylesheets/public.scss index 64a2577..b290e3b 100644 --- a/app/assets/stylesheets/public.scss +++ b/app/assets/stylesheets/public.scss @@ -5652,18 +5652,21 @@ div.modeles_similaires { font-family: 'Fugaz One', cursive; text-transform: uppercase; } + + .absolute_logo { + position: absolute; + top: 0px; + right: 0px; + background-color: #fff; + padding: 5px; + img { + max-height: 35px; + width: auto; + } + } + } -.absolute_logo { - position: absolute; - top: 0px; - right: 0px; - background-color: #fff; - padding: 5px; - img { - max-height: 35px; - width: auto; - } -} + .img_lien { a { position: relative; @@ -10193,6 +10196,17 @@ a.sp-video { background-color:#ffe500; } + + &.new_btn_red{ + background-color:#CC4B14; + + } + + &.new_btn_big{ + padding:10px 20px; + + } + } h1{ @@ -10214,10 +10228,15 @@ a.sp-video { .absolute_logo{ background:white; - top:0; - right:0; + float:right; + padding:5px; + position:relative; + top:-5px; + right:-5px; + margin-left:5px; img{ - height:30px; + max-height:100px; + max-width:150px; } } h3{ @@ -10274,7 +10293,8 @@ a.sp-video { margin-bottom:30px; } .logo{ - height:40px; + max-width:150px; + max-height:100px; } .circuit_img{ diff --git a/app/controllers/public/circuits_controller.rb b/app/controllers/public/circuits_controller.rb index 45bd483..790a744 100644 --- a/app/controllers/public/circuits_controller.rb +++ b/app/controllers/public/circuits_controller.rb @@ -4,7 +4,7 @@ class Public::CircuitsController < ApplicationController def index - @circuits = Circuit.all + @circuits = Circuit.order("name ASC").all @circuits_active = true end diff --git a/app/controllers/public/particulars_controller.rb b/app/controllers/public/particulars_controller.rb index ebf12bd..96ae758 100644 --- a/app/controllers/public/particulars_controller.rb +++ b/app/controllers/public/particulars_controller.rb @@ -27,7 +27,7 @@ class Public::ParticularsController < ApplicationController def edit - @particular = current_p_customer.particulars.find(params[:id]) + @particular = current_p_customer.particular #@particular.force_validation = true end diff --git a/app/models/m_odr_file_product.rb b/app/models/m_odr_file_product.rb index a364866..e5ea584 100644 --- a/app/models/m_odr_file_product.rb +++ b/app/models/m_odr_file_product.rb @@ -3,7 +3,7 @@ class MOdrFileProduct < ApplicationRecord belongs_to :m_odr_product belongs_to :m_odr_product_size - validates :qte, :presence => true + validates :qte, :presence => true, numericality: { greater_than: 0} before_save do if self.m_odr_product_size self.m_odr_product = self.m_odr_product_size.m_odr_product diff --git a/app/models/p_customer.rb b/app/models/p_customer.rb index 567b23a..f7b3856 100644 --- a/app/models/p_customer.rb +++ b/app/models/p_customer.rb @@ -69,7 +69,7 @@ class PCustomer < ApplicationRecord validates :email, :presence => true, :uniqueness => true validates :cgv, :presence => true, :if => :require_cgv - validates :rgpd, :presence => true, :if => :require_cgv + #validates :rgpd, :presence => true, :if => :require_cgv validates :past_id, :uniqueness => true, :if => :imported diff --git a/app/views/admin/m_odr_primes/_head.html.haml b/app/views/admin/m_odr_primes/_head.html.haml index 9fe4863..558d603 100644 --- a/app/views/admin/m_odr_primes/_head.html.haml +++ b/app/views/admin/m_odr_primes/_head.html.haml @@ -14,5 +14,5 @@ %td Rib %td -if @m_odr_prime.p_customer and @m_odr_prime.p_customer.valid_m_odr_rep_rib - =@m_odr_prime.p_customer.valid_m_odr_rep_rib.iban + =@m_odr_prime.p_customer.valid_m_odr_rep_rib.iban.to_s.gsub(/(.{4})(?=.)/, '\1 \2') %br=@m_odr_prime.p_customer.valid_m_odr_rep_rib.bic diff --git a/app/views/admin/m_odr_rep_ribs/_form.html.haml b/app/views/admin/m_odr_rep_ribs/_form.html.haml index e728e0e..490a43a 100644 --- a/app/views/admin/m_odr_rep_ribs/_form.html.haml +++ b/app/views/admin/m_odr_rep_ribs/_form.html.haml @@ -3,7 +3,8 @@ .content =f.inputs do = f.hidden_field :p_customer_id - = f.input :iban, :label => "iban :" + = f.input :iban, :label => "iban :" , :input_html => {:class => "iban_input"} + = f.input :bic, :label => "bic :" %hr = f.input :admin_ok, :label => "Décision :", :collection => [["Validé",true], ["Refusé", false]], :as => :select @@ -16,4 +17,7 @@ .actions=f.submit "sauvegarder", :class => "btn btn-primary" - \ No newline at end of file + + +:javascript + $('.iban_input').mask('SSAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AA', {placeholder: '____ ____ ____ ____ ____ ____ ____ ____ __'}); diff --git a/app/views/admin/m_odr_rep_ribs/_m_odr_rep_rib.html.haml b/app/views/admin/m_odr_rep_ribs/_m_odr_rep_rib.html.haml index 44f15bf..5c3cb92 100644 --- a/app/views/admin/m_odr_rep_ribs/_m_odr_rep_rib.html.haml +++ b/app/views/admin/m_odr_rep_ribs/_m_odr_rep_rib.html.haml @@ -2,6 +2,10 @@ %tr#m_odr_rep_rib_row{:id => m_odr_rep_rib.id} -tr = {} + -tr[:iban] = capture do + %td + =m_odr_rep_rib.iban.to_s.gsub(/(.{4})(?=.)/, '\1 \2') + -tr[:p_customer] = capture do %td =link_to m_odr_rep_rib.p_customer.show_name, [:admin, m_odr_rep_rib.p_customer] if m_odr_rep_rib.p_customer diff --git a/app/views/admin/m_odr_reps/_left_column.html.haml b/app/views/admin/m_odr_reps/_left_column.html.haml index 15e49e0..a4e67b8 100644 --- a/app/views/admin/m_odr_reps/_left_column.html.haml +++ b/app/views/admin/m_odr_reps/_left_column.html.haml @@ -103,7 +103,7 @@ RIB : %tr %td IBAN %td - =m_odr_rep_rib.iban + =m_odr_rep_rib.iban.to_s.gsub(/(.{4})(?=.)/, '\1 \2') %tr %td BIC diff --git a/app/views/admin/p_bank_accounts/_p_bank_account.html.haml b/app/views/admin/p_bank_accounts/_p_bank_account.html.haml index 4b9bdce..625695d 100644 --- a/app/views/admin/p_bank_accounts/_p_bank_account.html.haml +++ b/app/views/admin/p_bank_accounts/_p_bank_account.html.haml @@ -1,6 +1,6 @@ %tr#p_bank_account{:id => p_bank_account.id} %td= p_bank_account.p_bank.name - %td= p_bank_account.iban + %td= p_bank_account.iban.to_s.gsub(/(.{4})(?=.)/, '\1 \2') %td= p_bank_account.bic %td= p_bank_account.compta_cpt %td= p_bank_account.compta_journ diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index 58046f6..4dacc91 100644 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -53,8 +53,8 @@ =raw '' =raw '' - =raw '' - =raw '' + =raw '' + =raw '' =raw '' @@ -195,13 +195,11 @@ %h3.footer-section__title.ui-title-inner Liens utiles %ul.footer-list.footer-list_columns.list-unstyled %li - %a{:accesskey => "3", :href => "https://www.mamotosurcircuit.com/4-plan-site.html", :title => "Plan du site"} Plan du site + %a{:accesskey => "3", :href => "/fr/plan-site.html", :title => "Plan du site"} Plan du site %li - %a{:href => "https://www.mamotosurcircuit.com/108-partenaires.html", :title => "Partenaires"} Partenaires + %a{:accesskey => "8", :href => "/fr/mentions-legales.html", :title => "Mentions légales"} Mentions légales %li - %a{:accesskey => "8", :href => "https://www.mamotosurcircuit.com/5-mentions-legales.html", :title => "Mentions légales"} Mentions légales - %li - %a{:accesskey => "8", :href => "https://www.mamotosurcircuit.com/123-conditions-generales-utilisation.html", :title => "Conditions générales d'utilisation"} Conditions générales d'utilisation + %a{:accesskey => "8", :href => "/fr/conditions-generales-utilisation.html", :title => "Conditions générales d'utilisation"} Conditions générales d'utilisation .col-md-4 %section.footer-section %h3.footer-section__title.ui-title-inner Nous contacter diff --git a/app/views/public/circuits/_circuit.html.haml b/app/views/public/circuits/_circuit.html.haml index 4f03b79..9f7ea72 100644 --- a/app/views/public/circuits/_circuit.html.haml +++ b/app/views/public/circuits/_circuit.html.haml @@ -5,8 +5,9 @@ =link_to [:public, circuit], :class => "circuit" do -img = "" + -img = circuit.logo.file.large.medium.url if circuit.logo -img = circuit.image_file.file.large.medium.url if circuit.image_file - .img{:style => ("background-image:url('#{img}');" if img)} + .img{:style => ("background-image:url('#{img}');" if img).to_s+(" background-size:contain;" if !circuit.image_file ).to_s} .desc @@ -17,8 +18,14 @@ .titre_list %h3=circuit.name .details - =simple_format circuit.description - + -if circuit.description.size > 250 + %p + =circuit.description.truncate(250) + + %u + + d'infos + -else + =simple_format circuit.description .info_lien .block_info =circuit.cp diff --git a/app/views/public/circuits/show.html.haml b/app/views/public/circuits/show.html.haml index 1d69c0c..9ac963a 100644 --- a/app/views/public/circuits/show.html.haml +++ b/app/views/public/circuits/show.html.haml @@ -6,13 +6,7 @@ %h1 =@circuit.name - %p.localisation - - =@circuit.address2 - =@circuit.address3 if @circuit.address3? - =@circuit.cp - =@circuit.city - =@circuit.country + .clear @@ -24,12 +18,26 @@ =simple_format @circuit.description %br - -if @circuit.website? + .right - =link_to "Site officiel", @circuit.website, :target => "_blank", :class => "new_btn" + -if @circuit.website? + =link_to "Site officiel", @circuit.website, :target => "_blank", :class => "new_btn" + -if @circuit.facebook? + + =link_to raw(ic(:'facebook-f')+"   Page Facebook"), @circuit.facebook, :target => "_blank", :class => "new_btn" + + .clear .clear - + %br + %br + %p.localisation + + =@circuit.address2 + =@circuit.address3 if @circuit.address3? + =@circuit.cp + =@circuit.city + =@circuit.country .info_lien diff --git a/app/views/public/m_events/_m_event.html.haml b/app/views/public/m_events/_m_event.html.haml index af91cf8..b42fcad 100644 --- a/app/views/public/m_events/_m_event.html.haml +++ b/app/views/public/m_events/_m_event.html.haml @@ -37,7 +37,7 @@ %br %br .right_roulage.right - =link_to "Réserver (site officiel)", m_event.link.to_s, :target => "_blank" + =link_to "Réserver", m_event.link.to_s, :target => "_blank" .clear diff --git a/app/views/public/m_odr_file_products/_form.html.haml b/app/views/public/m_odr_file_products/_form.html.haml index 2adc687..7e0428c 100644 --- a/app/views/public/m_odr_file_products/_form.html.haml +++ b/app/views/public/m_odr_file_products/_form.html.haml @@ -1,7 +1,7 @@ %tr.m_odr_file_product_form.field %td - = form.input :m_odr_product_size, :label => "Produit :", :collection => option_groups_from_collection_for_select(MOdrProduct.all, :m_odr_product_sizes, :name, :id, :name), :as => :select, :include_blank => false, :member_label => :member_label + = form.input :m_odr_product_size, :label => "Produit :", :collection => option_groups_from_collection_for_select(MOdrProduct.all, :m_odr_product_sizes, :name, :id, :name), :as => :select, :include_blank => false, :member_label => :member_label, :include_blank => "Choisissez le profil et la dimension"   %td{:style => "width:60px;"} = form.input :qte, :label => "Qté :" diff --git a/app/views/public/m_odr_file_roulages/_form.html.haml b/app/views/public/m_odr_file_roulages/_form.html.haml index e7f2375..ca5d5d0 100644 --- a/app/views/public/m_odr_file_roulages/_form.html.haml +++ b/app/views/public/m_odr_file_roulages/_form.html.haml @@ -1,5 +1,5 @@ %tr.m_odr_file_roulage_form.field - %td= form.input :date, :label => "Date :" , :as => :string , :input_html => {:autocomplete => "off", :class => "year_date_picker"} + %td= form.input :date, :label => "Date de roulage :" , :as => :string , :input_html => {:autocomplete => "off", :class => "year_date_picker"} =#%td=# form.input :m_event_id, :label => "Journée de roulage :", :as => :date, :collection => MEvent.all, :member_label => :member_label, :as => :select diff --git a/app/views/public/m_odr_files/new.html.haml b/app/views/public/m_odr_files/new.html.haml index eea77a0..0e86fb1 100644 --- a/app/views/public/m_odr_files/new.html.haml +++ b/app/views/public/m_odr_files/new.html.haml @@ -1,10 +1,10 @@ .center_content{:style => "max-width:700px;"} -if @m_odr_file.m_odr_file_type_id == 1 - %h1 Ajouter une facture de roulage + %h1 Envoyer une facture de roulage -elsif @m_odr_file.m_odr_file_type_id == 2 - %h1 Ajouter une facture d'achat + %h1 Envoyer une facture de pneus =render :partial => "form" %br \ No newline at end of file diff --git a/app/views/public/m_odr_primes/_head.html.haml b/app/views/public/m_odr_primes/_head.html.haml index 9fe4863..558d603 100644 --- a/app/views/public/m_odr_primes/_head.html.haml +++ b/app/views/public/m_odr_primes/_head.html.haml @@ -14,5 +14,5 @@ %td Rib %td -if @m_odr_prime.p_customer and @m_odr_prime.p_customer.valid_m_odr_rep_rib - =@m_odr_prime.p_customer.valid_m_odr_rep_rib.iban + =@m_odr_prime.p_customer.valid_m_odr_rep_rib.iban.to_s.gsub(/(.{4})(?=.)/, '\1 \2') %br=@m_odr_prime.p_customer.valid_m_odr_rep_rib.bic diff --git a/app/views/public/m_odr_rep_ribs/_form.html.haml b/app/views/public/m_odr_rep_ribs/_form.html.haml index 87170c6..0811548 100644 --- a/app/views/public/m_odr_rep_ribs/_form.html.haml +++ b/app/views/public/m_odr_rep_ribs/_form.html.haml @@ -3,7 +3,13 @@ .content =f.inputs do = f.hidden_field :p_customer_id - = f.input :iban, :label => "Iban :" + = f.input :iban, :label => "Iban :" , :input_html => {:class => "iban_input"} + + :javascript + $('.iban_input').mask('SSAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AA', { + placeholder: '____ ____ ____ ____ ____ ____ ____ ____ __' + }); + = f.input :bic, :label => "Bic :" .actions=f.submit "sauvegarder" #, :class => "btn btn-primary" diff --git a/app/views/public/m_odr_rep_ribs/_m_odr_rep_rib.html.haml b/app/views/public/m_odr_rep_ribs/_m_odr_rep_rib.html.haml index 7d39052..236e179 100644 --- a/app/views/public/m_odr_rep_ribs/_m_odr_rep_rib.html.haml +++ b/app/views/public/m_odr_rep_ribs/_m_odr_rep_rib.html.haml @@ -1,7 +1,7 @@ %tr#m_odr_rep_rib_row{:id => m_odr_rep_rib.id} %td - =m_odr_rep_rib.iban + =m_odr_rep_rib.iban.to_s.gsub(/(.{4})(?=.)/, '\1 \2') %td =m_odr_rep_rib.bic %td diff --git a/app/views/public/my_account/index.html.haml b/app/views/public/my_account/index.html.haml index 2945d54..9bab6b6 100644 --- a/app/views/public/my_account/index.html.haml +++ b/app/views/public/my_account/index.html.haml @@ -67,7 +67,7 @@ .rib IBAN : - =rib.iban + =rib.iban.to_s.gsub(/(.{4})(?=.)/, '\1 \2') %br BIC : =rib.bic @@ -84,7 +84,7 @@ .rib IBAN : - =rib.iban + =rib.iban.to_s.gsub(/(.{4})(?=.)/, '\1 \2') %br BIC : =rib.bic @@ -97,17 +97,25 @@ RIB non renseigné .rib= link_to "Ajouter mon rib", new_public_m_odr_rep_rib_path() - - .doc_pannel + .clear + + %br + %br .right - =c = current_p_customer.m_odr_primes.where(:state => "Virement envoyé").count - -if c > 1 - primes obtenues sur 5 pour 2020 - -else - prime obtenue sur 5 pour 2020 + + - %h3 Mes primes + %h3 + Mes primes : + + %span{:style => "font-size:16px;"} + =c = current_p_customer.m_odr_primes.where(:state => "Virement envoyé").count + -if c > 1 + primes obtenues sur 5 pour 2020 + -else + prime obtenue sur 5 pour 2020 + -if current_p_customer.m_odr_primes.count > 0 %table.table =render current_p_customer.m_odr_primes @@ -129,8 +137,9 @@ Vous n'avez pas encore déposé de facture d'achat .align_center - = link_to 'Envoyer une facture d\'achat', new_public_m_odr_file_path(:m_odr_file_type_id => 2), :class => "new_btn" - .doc_pannel + = link_to 'Envoyer une facture de pneus', new_public_m_odr_file_path(:m_odr_file_type_id => 2), :class => "new_btn" + %br + %br %h3 Mes factures de roulage -if m_odr_files = current_p_customer.m_odr_files.where(:m_odr_file_type_id => 1) and m_odr_files.count > 0 %table.table @@ -142,8 +151,6 @@ .align_center = link_to 'Envoyer une facture de roulage', new_public_m_odr_file_path(:m_odr_file_type_id => 1), :class => "new_btn" - =link_to "Découvrir les avantages du Dunlop Sponsor Program", "/fr/primes.html" - %br %br %br diff --git a/app/views/public/organisateurs/show.html.haml b/app/views/public/organisateurs/show.html.haml index 3e4a5aa..da11ecf 100644 --- a/app/views/public/organisateurs/show.html.haml +++ b/app/views/public/organisateurs/show.html.haml @@ -16,13 +16,7 @@ %br =@organisateur.name - %p.localisation{:style => "text-align:center !important;"} - - =#@organisateur.address2 - =#@organisateur.address3 if @organisateur.address3? - =@organisateur.cp - =@organisateur.city - =@organisateur.country + .clear %br @@ -45,9 +39,17 @@ -if @organisateur.facebook? - =link_to "Page Facebook", @organisateur.facebook, :target => "_blank", :class => "new_btn" + =link_to raw(ic(:'facebook-f')+"   Page Facebook"), @organisateur.facebook, :target => "_blank", :class => "new_btn" + + %p.localisation{:style => "text-align:center !important;"} + =#@organisateur.address2 + =#@organisateur.address3 if @organisateur.address3? + =@organisateur.cp + =@organisateur.city + =@organisateur.country + .clear .clear diff --git a/app/views/public/p_customer_auths/new.haml b/app/views/public/p_customer_auths/new.haml index ed52a40..60bb6a3 100755 --- a/app/views/public/p_customer_auths/new.haml +++ b/app/views/public/p_customer_auths/new.haml @@ -31,7 +31,7 @@ %p{:style => "text-align:center"} - = submit_tag "Se connecter", :class => "btn btn-primary" + = submit_tag "Se connecter", :class => "new_btn new_btn_red new_btn_big" %p{:style => "text-align:center"} =link_to qit("lost-password","Mot de passe perdu ?"), password_reset_public_p_customer_auths_path(:for_order => params[:for_order]), :class => "shop" @@ -43,5 +43,5 @@ %br %br %center - =link_to "Créer mon compte", new_public_p_customer_path ,:class => "new_btn" + =link_to "Créer mon compte", new_public_p_customer_path ,:class => "new_btn new_btn_red new_btn_big" =#render :partial => "public/p_customers/new_form" diff --git a/app/views/public/p_customers/_new_form.html.haml b/app/views/public/p_customers/_new_form.html.haml index 1e9f7ce..823dbce 100644 --- a/app/views/public/p_customers/_new_form.html.haml +++ b/app/views/public/p_customers/_new_form.html.haml @@ -5,10 +5,10 @@ =f.inputs do =f.hidden_field :valid_public - =f.input :parent_code, :label => "Code ambassadeur :" + =f.input :parent_code, :label => "Code ambassadeur" - =f.input :email, :label => "Email :" - =f.input :password, :label => "Mot de passe :", :as => :password + =f.input :email, :label => "Email" + =f.input :password, :label => "Mot de passe", :as => :password =f.semantic_fields_for :particulars do |form| =render :partial => "public/particulars/inner_form", :locals => {:form => form} @@ -21,8 +21,18 @@ .col-sm-4 = f.input :circuit_3_id, :label => "Circuit préféré 3 :", :include_blank => true, :collection => Circuit.all, :as => :select, :member_label => :member_label - =f.input :cgv, :label => "Je reconnais avoir pris connaissance des conditions générales d'utilisation du site" + =f.input :cgv, :label => raw("Je reconnais avoir pris connaissance des conditions générales d'utilisation du site") =f.input :rgpd, :label => "J'accepte que mes coordonnées soient transmises à Dunlop et ses partenaires afin de pouvoir bénéficier de toutes les primes et offres présentes sur le site" + %br - =f.submit "Créer mon compte", :class => "btn btn-primary" \ No newline at end of file + %center=f.submit "Créer mon compte", :class => "new_btn new_btn_red new_btn_big" + + :scss + .control-label{ + input{ + position:relative; + top:5px; + } + } + \ No newline at end of file