diff --git a/app/assets/javascripts/public.js.coffee b/app/assets/javascripts/public.js.coffee index b9c8070..02acfd6 100644 --- a/app/assets/javascripts/public.js.coffee +++ b/app/assets/javascripts/public.js.coffee @@ -6,6 +6,8 @@ #= require ./vendor/jquery.flexslider #= require ./vendor/markerclusterer +#= require vendor/jquery.cookiebar.js + #= require ./vendor/jquery.mask #= require ./vendor/jquery.fitvids #= require ./vendor/jquery.bxslider diff --git a/app/assets/javascripts/vendor/jquery.cookiebar.js b/app/assets/javascripts/vendor/jquery.cookiebar.js index 99e8224..0a50bb4 100755 --- a/app/assets/javascripts/vendor/jquery.cookiebar.js +++ b/app/assets/javascripts/vendor/jquery.cookiebar.js @@ -32,7 +32,7 @@ declineFunction: function(cookieValue){if(cookieValue=='enabled' || cookieValue=='accepted') window.location = window.location.href;}, //Function to run after decline policyButton: true, //Set to true to show Privacy Policy button policyText: 'En savoir plus.', //Text on Privacy Policy button - policyURL: 'https://payrepmc.quartz.xyz/fr/mentions-legales.html', //URL of Privacy Policy + policyURL: '/fr/mentions-legales.html', //URL of Privacy Policy autoEnable: true, //Set to true for cookies to be accepted automatically. Banner still shows acceptOnContinue: false, //Set to true to accept cookies when visitor moves to another page acceptOnScroll: false, //Set to true to accept cookies when visitor scrolls X pixels up or down @@ -175,7 +175,7 @@ var anyClick = function(e){ if(!$(e.target).hasClass('cb-policy')) cookieAccept(); }; - + alert('a'); $('#cookie-bar .cb-enable').click(function(){cookieAccept();return false;}); $('#cookie-bar .cb-disable').click(function(){cookieDecline();return false;}); if(options.acceptOnScroll){ diff --git a/app/assets/stylesheets/public.scss b/app/assets/stylesheets/public.scss index 109bc00..3937e5a 100644 --- a/app/assets/stylesheets/public.scss +++ b/app/assets/stylesheets/public.scss @@ -25,7 +25,9 @@ $cursive_font : 'Galada', cursive; @import "vendor/flipclock"; @import "vendor/jquery.cookiebar"; - +img{ + max-width:100%; +} body{ padding:0; font-family:lato; @@ -618,7 +620,7 @@ h2{ float: none; } -} + #sub_footer { text-align:center; @@ -719,7 +721,7 @@ h2{ margin: 5px 14%; } - +} @media screen and (max-width: 880px) { #sub_footer #logos { diff --git a/app/assets/stylesheets/vendor/jquery.cookiebar.css b/app/assets/stylesheets/vendor/jquery.cookiebar.css index 15cd21d..5ab76ba 100755 --- a/app/assets/stylesheets/vendor/jquery.cookiebar.css +++ b/app/assets/stylesheets/vendor/jquery.cookiebar.css @@ -3,8 +3,8 @@ #cookie-bar.fixed.bottom {bottom:0; top:auto;} #cookie-bar p {margin:0; padding:0;max-width:800px;margin:auto;} #cookie-bar a {color:#ffffff; display:inline-block; border-radius:3px; text-decoration:none; padding:0 6px; margin-left:8px;} -#cookie-bar .cb-enable {background:orange;} -#cookie-bar .cb-enable:hover {background:orange;} +#cookie-bar .cb-enable {background:#53a7dc;} +#cookie-bar .cb-enable:hover {background:#53a7dc;} #cookie-bar .cb-disable {background:#990000;} #cookie-bar .cb-disable:hover {background:#bb0000;} #cookie-bar .cb-policy {background:transparent;text-decoration:underline;} diff --git a/app/models/contact.rb b/app/models/contact.rb index 74ec773..94916d5 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -10,7 +10,15 @@ class Contact < ActiveRecord::Base has_many :contact_files - + validates :rgpd, :presence => true, :if => :rgpd_needed? + + def rgpd_needed? + if (self.id and self.created_at > Time.parse("2020-05-13 20:30")) or !self.id + true + else + false + end + end def syncro require 'net/https' diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index 99059da..0ffdd57 100644 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -248,6 +248,11 @@ %br 38430 MOIRANS + %br + %br + %br + + #contacts %p =ic :phone @@ -260,9 +265,18 @@ =ic :"envelope-o" contact@ets-payre.fr + %br + %br + Mentions légales + + .clear :javascript resize() + :javascript + alert(""); + $.cookieBar(); + diff --git a/app/views/public/contacts/_form.html.haml b/app/views/public/contacts/_form.html.haml index 547805d..3bf61ec 100755 --- a/app/views/public/contacts/_form.html.haml +++ b/app/views/public/contacts/_form.html.haml @@ -31,12 +31,30 @@ %td{:colspan => 2} =f.input :message, :label =>false , :placeholder => "Message" + + .rgpd + =f.input :rgpd, :label => raw("En soumettant ce formulaire, j'accepte que les informations saisies soient exploitées dans le cadre de la demande de contact et de la relation commerciale qui peut en découler.
Pour connaître et exercer vos droits, notamment de retrat de votre consentement à l'utilisation des données collectées par ce formulaire, veuillez consulter notre
politique de confidentialité.") .submit =f.submit "Envoyer", :class => "btn" - + :scss + .rgpd{ + color:white; + width:600px;max-width:95%; + margin-bottom:10px; + input{ + display:inline-block !important; + width:auto !important; + margin-right:7px; + } + + a{ + color:#53a7dc; + text-decoration:none; + } + } diff --git a/db/migrate/20200513175921_add_rgpd_to_contacts.rb b/db/migrate/20200513175921_add_rgpd_to_contacts.rb new file mode 100644 index 0000000..f802eb0 --- /dev/null +++ b/db/migrate/20200513175921_add_rgpd_to_contacts.rb @@ -0,0 +1,6 @@ +class AddRgpdToContacts < ActiveRecord::Migration + def change + add_column :contacts, :rgpd, :boolean, :default => false + add_column :contacts, :cgv, :boolean, :default => false + end +end diff --git a/db/schema.rb b/db/schema.rb index 0da97da..5ab2e7d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180801225533) do +ActiveRecord::Schema.define(version: 20200513175921) do create_table "admin_admin_roles", force: :cascade do |t| t.integer "admin_id", limit: 4 @@ -277,6 +277,8 @@ ActiveRecord::Schema.define(version: 20180801225533) do t.string "contact_status", limit: 255 t.string "corporate", limit: 255 t.boolean "urgent", default: false + t.boolean "rgpd", default: false + t.boolean "cgv", default: false end create_table "d_products", force: :cascade do |t|