This commit is contained in:
Nicolas Bally 2020-05-13 20:53:58 +02:00
parent a9dc10ded8
commit c739748330
9 changed files with 62 additions and 10 deletions

View File

@ -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

View File

@ -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){

View File

@ -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 {

View File

@ -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;}

View File

@ -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'

View File

@ -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
<a href='/fr/mentions-legales.html'>Mentions légales<a>
.clear
:javascript
resize()
:javascript
alert("");
$.cookieBar();

View File

@ -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.<br />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 <a href='/fr/mentions-legales.html'>politique de confidentialité<a>.")
.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;
}
}

View File

@ -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

View File

@ -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|